Skip to content

Commit

Permalink
Rename feature config tokens (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland authored Oct 11, 2023
1 parent c4f78b2 commit eb657de
Show file tree
Hide file tree
Showing 85 changed files with 585 additions and 583 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arduino_esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
mkdir -p $ARDUINO_BASE
cd $ARDUINO_BASE
platformio init -b esp32thing_plus --project-option="build_flags=-DZ_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3"
platformio init -b esp32thing_plus --project-option="build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3"
cd $ARDUINO_BASE/lib
ln -s $ZENOH_PICO_BASE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Compile debug
run: |
mkdir build
emcmake cmake -E env CFLAGS="-DZ_LINK_WS=1 -DZ_LINK_TCP=0 -DZ_LINK_UDP_MULTICAST=0 -DZ_LINK_UDP_UNICAST=0 -DZ_SCOUTING_UDP=0" cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_STANDARD=11 -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DBUILD_MULTICAST=OFF -DBUILD_INTEGRATION=OFF -DBUILD_TOOLS=OFF -DZENOH_DEBUG=3 -H. -Bbuild
emcmake cmake -E env CFLAGS="-DZ_FEATURE_LINK_WS=1 -DZ_FEATURE_LINK_TCP=0 -DZ_FEATURE_LINK_UDP_MULTICAST=0 -DZ_FEATURE_LINK_UDP_UNICAST=0 -DZ_FEATURE_SCOUTING_UDP=0" cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_STANDARD=11 -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF -DBUILD_MULTICAST=OFF -DBUILD_INTEGRATION=OFF -DBUILD_TOOLS=OFF -DZENOH_DEBUG=3 -H. -Bbuild
make -C build
2 changes: 1 addition & 1 deletion .github/workflows/mbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
mkdir -p $MBED_BASE
cd $MBED_BASE
pio init -b nucleo_f767zi --project-option="framework=mbed" --project-option="build_flags=-DZ_LINK_SERIAL=1 -DZENOH_DEBUG=3"
pio init -b nucleo_f767zi --project-option="framework=mbed" --project-option="build_flags=-DZ_FEATURE_LINK_SERIAL=1 -DZENOH_DEBUG=3"
cd $MBED_BASE/lib
ln -s $ZENOH_PICO_BASE
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zephyr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
mkdir -p $ZEPHYR_BASE
cd $ZEPHYR_BASE
pio init -b nucleo_f767zi --project-option="framework=zephyr" --project-option="build_flags=-DZ_LINK_SERIAL=1 -DZENOH_DEBUG=3"
pio init -b nucleo_f767zi --project-option="framework=zephyr" --project-option="build_flags=-DZ_FEATURE_LINK_SERIAL=1 -DZENOH_DEBUG=3"
cd $ZEPHYR_BASE/lib
ln -s $ZENOH_PICO_BASE
Expand Down
2 changes: 1 addition & 1 deletion extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"-<system/unix/>",
"-<system/windows/>",
"-<system/zephyr/>"]
CPPDEFINES = ["ZENOH_ARDUINO_OPENCR", "ZENOH_C_STANDARD=99", "Z_MULTI_THREAD=0"]
CPPDEFINES = ["ZENOH_ARDUINO_OPENCR", "ZENOH_C_STANDARD=99", "Z_FEATURE_MULTI_THREAD=0"]

elif FRAMEWORK == 'espidf':
SRC_FILTER = ["+<*>",
Expand Down
162 changes: 82 additions & 80 deletions include/zenoh-pico/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,117 +102,148 @@
#define Z_CONFIG_ADD_TIMESTAMP_KEY 0x4A
#define Z_CONFIG_ADD_TIMESTAMP_DEFAULT "false"

/*------------------ Compile-time configuration properties ------------------*/
/*------------------ Compile-time feature configuration ------------------*/

/**
* Default length for Zenoh ID. Maximum size is 16 bytes.
* This configuration will only be applied to Zenoh IDs generated by Zenoh-Pico.
* Enable multi-thread support.
*/
#ifndef Z_ZID_LENGTH
#define Z_ZID_LENGTH 16
#ifndef Z_FEATURE_MULTI_THREAD
#define Z_FEATURE_MULTI_THREAD 1
#endif

#ifndef Z_TSID_LENGTH
#define Z_TSID_LENGTH 16
/**
* Enable dynamic memory allocation.
*/
#ifndef Z_FEATURE_DYNAMIC_MEMORY_ALLOCATION
#define Z_FEATURE_DYNAMIC_MEMORY_ALLOCATION 0
#endif

/**
* Protocol version identifier.
* Do not change this value.
* Enable TCP links.
*/
#ifndef Z_PROTO_VERSION
#define Z_PROTO_VERSION 0x08
#ifndef Z_FEATURE_LINK_TCP
#define Z_FEATURE_LINK_TCP 1
#endif

/**
* Default session lease in milliseconds.
* Enable Bluetooth links.
*/
#ifndef Z_TRANSPORT_LEASE
#define Z_TRANSPORT_LEASE 10000
#ifndef Z_FEATURE_LINK_BLUETOOTH
#define Z_FEATURE_LINK_BLUETOOTH 0
#endif

/**
* Default session lease expire factor.
* Enable WebSocket links.
*/
#ifndef Z_TRANSPORT_LEASE_EXPIRE_FACTOR
#define Z_TRANSPORT_LEASE_EXPIRE_FACTOR 3.5
#ifndef Z_FEATURE_LINK_WS
#define Z_FEATURE_LINK_WS 0
#endif

/**
* Default multicast session join interval in milliseconds.
* Enable Serial links.
*/
#ifndef Z_JOIN_INTERVAL
#define Z_JOIN_INTERVAL 2500
#ifndef Z_FEATURE_LINK_SERIAL
#define Z_FEATURE_LINK_SERIAL 0
#endif

/**
* Default socket timeout in milliseconds.
* Enable UDP Scouting.
*/
#ifndef Z_CONFIG_SOCKET_TIMEOUT
#define Z_CONFIG_SOCKET_TIMEOUT 100
#ifndef Z_FEATURE_SCOUTING_UDP
#define Z_FEATURE_SCOUTING_UDP 1
#endif

#ifndef Z_SN_RESOLUTION
#define Z_SN_RESOLUTION 0x02
/**
* Enable UDP Multicast links.
*/
#ifndef Z_FEATURE_LINK_UDP_MULTICAST
#define Z_FEATURE_LINK_UDP_MULTICAST 1
#endif

#ifndef Z_REQ_RESOLUTION
#define Z_REQ_RESOLUTION 0x02
/**
* Enable UDP Unicast links.
*/
#ifndef Z_FEATURE_LINK_UDP_UNICAST
#define Z_FEATURE_LINK_UDP_UNICAST 1
#endif

/**
* Enable multi-thread support.
* Enable Multicast Transport.
*/
#ifndef Z_MULTI_THREAD
#define Z_MULTI_THREAD 1
#ifndef Z_FEATURE_MULTICAST_TRANSPORT
#if Z_FEATURE_SCOUTING_UDP == 0 && Z_FEATURE_LINK_BLUETOOTH == 0 && Z_FEATURE_LINK_UDP_MULTICAST == 0
#define Z_FEATURE_MULTICAST_TRANSPORT 0
#else
#define Z_FEATURE_MULTICAST_TRANSPORT 1
#endif
#endif

/**
* Enable TCP links.
* Enable Unicast Transport.
*/
#ifndef Z_LINK_TCP
#define Z_LINK_TCP 1
#ifndef Z_FEATURE_UNICAST_TRANSPORT
#if Z_FEATURE_LINK_TCP == 0 && Z_FEATURE_LINK_UDP_UNICAST == 0 && Z_FEATURE_LINK_SERIAL == 0 && Z_FEATURE_LINK_WS == 0
#define Z_FEATURE_UNICAST_TRANSPORT 0
#else
#define Z_FEATURE_UNICAST_TRANSPORT 1
#endif
#endif

/*------------------ Compile-time configuration properties ------------------*/
/**
* Enable UDP Multicast links.
* Default length for Zenoh ID. Maximum size is 16 bytes.
* This configuration will only be applied to Zenoh IDs generated by Zenoh-Pico.
*/
#ifndef Z_LINK_UDP_MULTICAST
#define Z_LINK_UDP_MULTICAST 1
#ifndef Z_ZID_LENGTH
#define Z_ZID_LENGTH 16
#endif

#ifndef Z_TSID_LENGTH
#define Z_TSID_LENGTH 16
#endif

/**
* Enable UDP Unicast links.
* Protocol version identifier.
* Do not change this value.
*/
#ifndef Z_LINK_UDP_UNICAST
#define Z_LINK_UDP_UNICAST 1
#ifndef Z_PROTO_VERSION
#define Z_PROTO_VERSION 0x08
#endif

/**
* Enable Bluetooth links.
* Default session lease in milliseconds.
*/
#ifndef Z_LINK_BLUETOOTH
#define Z_LINK_BLUETOOTH 0
#ifndef Z_TRANSPORT_LEASE
#define Z_TRANSPORT_LEASE 10000
#endif

/**
* Enable Serial links.
* Default session lease expire factor.
*/
#ifndef Z_LINK_SERIAL
#define Z_LINK_SERIAL 0
#ifndef Z_TRANSPORT_LEASE_EXPIRE_FACTOR
#define Z_TRANSPORT_LEASE_EXPIRE_FACTOR 3.5
#endif

/**
* Enable WebSocket links.
* Default multicast session join interval in milliseconds.
*/
#ifndef Z_LINK_WS
#define Z_LINK_WS 0
#ifndef Z_JOIN_INTERVAL
#define Z_JOIN_INTERVAL 2500
#endif

/**
* Enable UDP Scouting.
* Default socket timeout in milliseconds.
*/
#ifndef Z_SCOUTING_UDP
#define Z_SCOUTING_UDP 1
#ifndef Z_CONFIG_SOCKET_TIMEOUT
#define Z_CONFIG_SOCKET_TIMEOUT 100
#endif

#ifndef Z_SN_RESOLUTION
#define Z_SN_RESOLUTION 0x02
#endif

#ifndef Z_REQ_RESOLUTION
#define Z_REQ_RESOLUTION 0x02
#endif

/**
Expand Down Expand Up @@ -242,33 +273,4 @@
#define Z_FRAG_MAX_SIZE 300000
#endif

/**
* Enable dynamic memory allocation.
*/
#ifndef Z_DYNAMIC_MEMORY_ALLOCATION
#define Z_DYNAMIC_MEMORY_ALLOCATION 0
#endif

/**
* Enable Multicast Transport.
*/
#ifndef Z_MULTICAST_TRANSPORT
#if Z_SCOUTING_UDP == 0 && Z_LINK_BLUETOOTH == 0 && Z_LINK_UDP_MULTICAST == 0
#define Z_MULTICAST_TRANSPORT 0
#else
#define Z_MULTICAST_TRANSPORT 1
#endif
#endif

/**
* Enable Unicast Transport.
*/
#ifndef Z_UNICAST_TRANSPORT
#if Z_LINK_TCP == 0 && Z_LINK_UDP_UNICAST == 0 && Z_LINK_SERIAL == 0 && Z_LINK_WS == 0
#define Z_UNICAST_TRANSPORT 0
#else
#define Z_UNICAST_TRANSPORT 1
#endif
#endif

#endif /* INCLUDE_ZENOH_PICO_CONFIG_H */
2 changes: 1 addition & 1 deletion include/zenoh-pico/link/config/bt.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "zenoh-pico/config.h"
#include "zenoh-pico/system/platform.h"

#if Z_LINK_BLUETOOTH == 1
#if Z_FEATURE_LINK_BLUETOOTH == 1

#define BT_CONFIG_ARGC 3

Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/link/config/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "zenoh-pico/config.h"
#include "zenoh-pico/system/platform.h"

#if Z_LINK_SERIAL == 1
#if Z_FEATURE_LINK_SERIAL == 1

#define SERIAL_CONFIG_ARGC 1

Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/link/config/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "zenoh-pico/collections/string.h"
#include "zenoh-pico/config.h"

#if Z_LINK_TCP == 1
#if Z_FEATURE_LINK_TCP == 1

#define TCP_CONFIG_ARGC 1

Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/link/config/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "zenoh-pico/collections/intmap.h"
#include "zenoh-pico/collections/string.h"

#if Z_LINK_UDP_UNICAST == 1 || Z_LINK_UDP_MULTICAST == 1
#if Z_FEATURE_LINK_UDP_UNICAST == 1 || Z_FEATURE_LINK_UDP_MULTICAST == 1

#define UDP_CONFIG_ARGC 3

Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/link/config/ws.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "zenoh-pico/collections/string.h"
#include "zenoh-pico/config.h"

#if Z_LINK_WS == 1
#if Z_FEATURE_LINK_WS == 1

#define WS_CONFIG_TOUT_KEY 0x01
#define WS_CONFIG_TOUT_STR "tout"
Expand Down
10 changes: 5 additions & 5 deletions include/zenoh-pico/link/endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
#include "zenoh-pico/utils/result.h"

/*------------------ Locator ------------------*/
#if Z_LINK_TCP == 1
#if Z_FEATURE_LINK_TCP == 1
#define TCP_SCHEMA "tcp"
#endif
#if Z_LINK_UDP_UNICAST == 1 || Z_LINK_UDP_MULTICAST == 1
#if Z_FEATURE_LINK_UDP_UNICAST == 1 || Z_FEATURE_LINK_UDP_MULTICAST == 1
#define UDP_SCHEMA "udp"
#endif
#if Z_LINK_BLUETOOTH == 1
#if Z_FEATURE_LINK_BLUETOOTH == 1
#define BT_SCHEMA "bt"
#endif
#if Z_LINK_SERIAL == 1
#if Z_FEATURE_LINK_SERIAL == 1
#define SERIAL_SCHEMA "serial"
#endif
#if Z_LINK_WS == 1
#if Z_FEATURE_LINK_WS == 1
#define WS_SCHEMA "ws"
#endif

Expand Down
Loading

0 comments on commit eb657de

Please sign in to comment.