Skip to content

Commit

Permalink
Clean up Kconfig and use tabs for indentation
Browse files Browse the repository at this point in the history
Using tabs is consistent with Zephyr upstream.

All default n statements are removed, as they are discouraged by Zephyr.
  • Loading branch information
martinjaeger committed Mar 26, 2024
1 parent e92ea90 commit b177028
Show file tree
Hide file tree
Showing 11 changed files with 303 additions and 309 deletions.
12 changes: 6 additions & 6 deletions src/Kconfig.auth
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# SPDX-License-Identifier: Apache-2.0

menuconfig THINGSET_AUTH
bool "Basic Authentication"
bool "Basic Authentication"

if THINGSET_AUTH

config THINGSET_AUTH_TOKEN_MAX_SIZE
int "Auth token max size"
range 8 65
default 16
int "Auth token max size"
range 8 65
default 16

config THINGSET_AUTH_TOKEN_EXPERT
string "Token to authenticate as expert user"
string "Token to authenticate as expert user"

config THINGSET_AUTH_TOKEN_MANUFACTURER
string "Token to authenticate as manufacturer"
string "Token to authenticate as manufacturer"

endif # THINGSET_AUTH
10 changes: 5 additions & 5 deletions src/Kconfig.ble
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# SPDX-License-Identifier: Apache-2.0

menuconfig THINGSET_BLE
bool "Bluetooth LE interface"
depends on BT
bool "Bluetooth LE interface"
depends on BT

if THINGSET_BLE

config THINGSET_BLE_RX_BUF_SIZE
int "ThingSet BLE RX buffer size"
range 64 2048
default 512
int "ThingSet BLE RX buffer size"
range 64 2048
default 512

endif # THINGSET_BLE
262 changes: 131 additions & 131 deletions src/Kconfig.can
Original file line number Diff line number Diff line change
Expand Up @@ -2,185 +2,185 @@
# SPDX-License-Identifier: Apache-2.0

menuconfig THINGSET_CAN
bool "CAN interface"
depends on CAN
depends on ISOTP_FAST
depends on ENTROPY_GENERATOR
select EVENTS
select ISOTP_FAST_CUSTOM_ADDRESSING
bool "CAN interface"
depends on CAN
depends on ISOTP_FAST
depends on ENTROPY_GENERATOR
select EVENTS
select ISOTP_FAST_CUSTOM_ADDRESSING

if THINGSET_CAN

config THINGSET_CAN_RX_BUF_SIZE
int "ThingSet CAN RX buffer size"
range 64 2048
default 600
help
Default value large enough to receive a 512 byte flash page for DFU.
int "ThingSet CAN RX buffer size"
range 64 2048
default 600
help
Default value large enough to receive a 512 byte flash page for DFU.

config THINGSET_CAN_ITEM_RX
bool "Support for reception of single-frame data items"
help
Single-frame reports containing one data item (type 0x2) are usually used
for control purposes. Enable this option to allow configuring a receive
callback once single-frame reports from other nodes were received.
bool "Support for reception of single-frame data items"
help
Single-frame reports containing one data item (type 0x2) are usually used
for control purposes. Enable this option to allow configuring a receive
callback once single-frame reports from other nodes were received.

For normal reports, the multi-frame reports of type 0x1 are more
efficient (especially in case of CAN FD).
For normal reports, the multi-frame reports of type 0x1 are more
efficient (especially in case of CAN FD).

config THINGSET_CAN_REPORT_RX
bool "Support for reception of multi-frame reports"
help
Multi-frame reports (type 0x1) are used to publish data items of one
group, subset or record over CAN. The size of one frame is 8 bytes
for classical CAN or up to 64 for CAN FD.
bool "Support for reception of multi-frame reports"
help
Multi-frame reports (type 0x1) are used to publish data items of one
group, subset or record over CAN. The size of one frame is 8 bytes
for classical CAN or up to 64 for CAN FD.

config THINGSET_CAN_REPORT_RX_BUFFER_SIZE
int "ThingSet CAN RX buffer size for reassembly of packetized reports"
depends on THINGSET_CAN_REPORT_RX
range 32 1024
default 64
help
Default value enough to receive at least a 10-element array via broadcast.
int "ThingSet CAN RX buffer size for reassembly of packetized reports"
depends on THINGSET_CAN_REPORT_RX
range 32 1024
default 64
help
Default value enough to receive at least a 10-element array via broadcast.

config THINGSET_CAN_REPORT_RX_NUM_BUFFERS
int "ThingSet CAN number of RX buffers for reassembly of packetized reports"
depends on THINGSET_CAN_REPORT_RX
range 1 64
default 8
help
Maximum number of unique senders anticipated on the CAN bus.
int "ThingSet CAN number of RX buffers for reassembly of packetized reports"
depends on THINGSET_CAN_REPORT_RX
range 1 64
default 8
help
Maximum number of unique senders anticipated on the CAN bus.

config THINGSET_CAN_REPORT_RX_BUCKETS
int "ThingSet CAN number of buckets into which RX buffers are divided"
depends on THINGSET_CAN_REPORT_RX
range 1 16
default 8
help
This is the number of entries in the hashtable used to efficiently look
up current buffers. The hash function is simply a modulo operation, so
for maximum efficiency a power-of-2 value should be used.
int "ThingSet CAN number of buckets into which RX buffers are divided"
depends on THINGSET_CAN_REPORT_RX
range 1 16
default 8
help
This is the number of entries in the hashtable used to efficiently look
up current buffers. The hash function is simply a modulo operation, so
for maximum efficiency a power-of-2 value should be used.

config THINGSET_CAN_REPORT_SEND_TIMEOUT
int "ThingSet CAN report send timeout"
range 0 100
default 30
help
Timeout in milliseconds to wait for a report frame to be successfully
submitted to the CAN TX FIFO.
int "ThingSet CAN report send timeout"
range 0 100
default 30
help
Timeout in milliseconds to wait for a report frame to be successfully
submitted to the CAN TX FIFO.

config THINGSET_CAN_FRAME_SEPARATION_TIME
int "ThingSet CAN minimum frame separation time"
range 0 127
default 1
help
Minimum time in milliseconds between the end of one frame and the
beginning of the next consecutive frame in multi-frame messages.
int "ThingSet CAN minimum frame separation time"
range 0 127
default 1
help
Minimum time in milliseconds between the end of one frame and the
beginning of the next consecutive frame in multi-frame messages.

This parameter is used for the STmin value in the underlying ISO-TP
protocol of request/response messages and as a delay between individual
frames of multi-frame reports.
This parameter is used for the STmin value in the underlying ISO-TP
protocol of request/response messages and as a delay between individual
frames of multi-frame reports.

config THINGSET_CAN_CONTROL_REPORTING
bool "Publish data of control subset"
help
Enable automatic publication of control data. The subset is application-
specific and has to be specified.
bool "Publish data of control subset"
help
Enable automatic publication of control data. The subset is application-
specific and has to be specified.

config THINGSET_CAN_CONTROL_SUBSET
bool "Subset containing control data to be published"
depends on THINGSET_CAN_CONTROL_REPORTING
bool "Subset containing control data to be published"
depends on THINGSET_CAN_CONTROL_REPORTING

config THINGSET_CAN_CONTROL_REPORTING_PERIOD
bool "Control data reporting interval in milliseconds"
depends on THINGSET_CAN_CONTROL_REPORTING
default 100
bool "Control data reporting interval in milliseconds"
depends on THINGSET_CAN_CONTROL_REPORTING
default 100

choice THINGSET_CAN_ROUTING
prompt "Message routing scheme"
default THINGSET_CAN_ROUTING_BUSES
help
Select how frames should be routed between different buses.
prompt "Message routing scheme"
default THINGSET_CAN_ROUTING_BUSES
help
Select how frames should be routed between different buses.

config THINGSET_CAN_ROUTING_BUSES
bool "Bus numbers"
depends on ISOTP_FAST
select ISOTP_FAST_CUSTOM_ADDRESSING
help
Bits 16-23 of the CAN ID are used for a target bus (higher nibble) and a
source bus (lower nibble).
bool "Bus numbers"
depends on ISOTP_FAST
select ISOTP_FAST_CUSTOM_ADDRESSING
help
Bits 16-23 of the CAN ID are used for a target bus (higher nibble) and a
source bus (lower nibble).

Buses should be used to allow message routing from one bus to any other bus.
There is no hierarchy between the buses.
Buses should be used to allow message routing from one bus to any other bus.
There is no hierarchy between the buses.

config THINGSET_CAN_ROUTING_BRIDGES
bool "Bridge numbers"
select ISOTP_FAST_FIXED_ADDRESSING
help
Bits 16-23 of the CAN ID are used to define a bridge number between 1 and
255. Each bridge defines the connection between two fixed buses. Bridge
number 0 is reserved local communication on the same bus (i.e. no routing).
bool "Bridge numbers"
select ISOTP_FAST_FIXED_ADDRESSING
help
Bits 16-23 of the CAN ID are used to define a bridge number between 1 and
255. Each bridge defines the connection between two fixed buses. Bridge
number 0 is reserved local communication on the same bus (i.e. no routing).

Bridges should be used if the maximum amount of 16 buses is not
sufficient. Otherwise, routing using bus numbers are more simple and generic.
Bridges should be used if the maximum amount of 16 buses is not
sufficient. Otherwise, routing using bus numbers are more simple and generic.

endchoice

config THINGSET_CAN_MULTIPLE_INSTANCES
bool "Support for multiple ThingSet CAN instances"
depends on ISOTP_FAST
help
If enabled, the CAN message processing does not happen in the
background anymore. Instead, each instance has to be initialized
for a dedicated CAN device and and messages have to be processed
manually in application threads.

The bus numbering scheme in the CAN ID is not compatible with
the current Zephyr upstream ISO-TP implementation, so it depends
on ISOTP_FAST.
bool "Support for multiple ThingSet CAN instances"
depends on ISOTP_FAST
help
If enabled, the CAN message processing does not happen in the
background anymore. Instead, each instance has to be initialized
for a dedicated CAN device and and messages have to be processed
manually in application threads.

The bus numbering scheme in the CAN ID is not compatible with
the current Zephyr upstream ISO-TP implementation, so it depends
on ISOTP_FAST.

config THINGSET_CAN_DEFAULT_ROUTE
int "ThingSet CAN default route"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
range 0 15 if THINGSET_CAN_ROUTING_BUSES
range 0 255 if THINGSET_CAN_ROUTING_BRIDGES
default 0
help
The bus or bridge number (depending on THINGSET_CAN_ROUTING choice) is
used to route messages between different buses.
int "ThingSet CAN default route"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
range 0 15 if THINGSET_CAN_ROUTING_BUSES
range 0 255 if THINGSET_CAN_ROUTING_BRIDGES
default 0
help
The bus or bridge number (depending on THINGSET_CAN_ROUTING choice) is
used to route messages between different buses.

For a single bus system, the default 0 should be used.
For a single bus system, the default 0 should be used.

config THINGSET_CAN_RESPONSE_DELAY
int "ThingSet CAN response delay"
range 0 100
default 10
help
Wait for the specified delay in milliseconds before sending out a
response after a request was received.
int "ThingSet CAN response delay"
range 0 100
default 10
help
Wait for the specified delay in milliseconds before sending out a
response after a request was received.

This delay gives the requesting side some more time to switch between
sending and receiving mode, as the Zephyr ISO-TP implementation does
not allow to use the same ID for listening and sending simultaneously.
This delay gives the requesting side some more time to switch between
sending and receiving mode, as the Zephyr ISO-TP implementation does
not allow to use the same ID for listening and sending simultaneously.

config THINGSET_CAN_THREAD_STACK_SIZE
int "ThingSet CAN thread stack size"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
default 2048
help
Stack size of thread for processing ThingSet messages transmitted
via CAN ISO-TP.
int "ThingSet CAN thread stack size"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
default 2048
help
Stack size of thread for processing ThingSet messages transmitted
via CAN ISO-TP.

Only available for single-instance implementation.
Only available for single-instance implementation.

config THINGSET_CAN_THREAD_PRIORITY
int "ThingSet CAN thread priority"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
default 2
help
Priority of thread for processing ThingSet messages transmitted
via CAN ISO-TP.

Only available for single-instance implementation.
int "ThingSet CAN thread priority"
depends on !THINGSET_CAN_MULTIPLE_INSTANCES
default 2
help
Priority of thread for processing ThingSet messages transmitted
via CAN ISO-TP.

Only available for single-instance implementation.

endif # THINGSET_CAN
Loading

0 comments on commit b177028

Please sign in to comment.