From 22bf4285c32369c1454baf52c47a72258dee7d71 Mon Sep 17 00:00:00 2001 From: Jean-Roland Gosse Date: Tue, 26 Mar 2024 14:28:17 +0100 Subject: [PATCH] Fix esp32 CI (#386) * fix: const discard warning * build: fix platformio dependency check --- .github/workflows/arduino_esp32.yaml | 2 +- include/zenoh-pico/link/config/bt.h | 16 ++++++++-------- include/zenoh-pico/link/config/serial.h | 2 +- include/zenoh-pico/link/config/tcp.h | 2 +- include/zenoh-pico/link/config/udp.h | 16 ++++++++-------- src/api/api.c | 6 +++--- src/net/session.c | 6 +++--- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/arduino_esp32.yaml b/.github/workflows/arduino_esp32.yaml index ce4125da5..1bc0f27e4 100644 --- a/.github/workflows/arduino_esp32.yaml +++ b/.github/workflows/arduino_esp32.yaml @@ -51,7 +51,7 @@ jobs: mkdir -p $ARDUINO_BASE cd $ARDUINO_BASE - platformio init -b esp32thing_plus --project-option="build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC" + platformio init -b esp32thing_plus -O "build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC" -O "lib_ldf_mode=deep+" cd $ARDUINO_BASE/lib ln -s $ZENOH_PICO_BASE diff --git a/include/zenoh-pico/link/config/bt.h b/include/zenoh-pico/link/config/bt.h index 40827e76c..0a68898b0 100644 --- a/include/zenoh-pico/link/config/bt.h +++ b/include/zenoh-pico/link/config/bt.h @@ -32,14 +32,14 @@ #define BT_CONFIG_TOUT_KEY 0x03 #define BT_CONFIG_TOUT_STR "tout" -#define BT_CONFIG_MAPPING_BUILD \ - _z_str_intmapping_t args[BT_CONFIG_ARGC]; \ - args[0]._key = BT_CONFIG_MODE_KEY; \ - args[0]._str = BT_CONFIG_MODE_STR; \ - args[1]._key = BT_CONFIG_PROFILE_KEY; \ - args[1]._str = BT_CONFIG_PROFILE_STR; \ - args[2]._key = BT_CONFIG_TOUT_KEY; \ - args[2]._str = BT_CONFIG_TOUT_STR; +#define BT_CONFIG_MAPPING_BUILD \ + _z_str_intmapping_t args[BT_CONFIG_ARGC]; \ + args[0]._key = BT_CONFIG_MODE_KEY; \ + args[0]._str = (char *)BT_CONFIG_MODE_STR; \ + args[1]._key = BT_CONFIG_PROFILE_KEY; \ + args[1]._str = (char *)BT_CONFIG_PROFILE_STR; \ + args[2]._key = BT_CONFIG_TOUT_KEY; \ + args[2]._str = (char *)BT_CONFIG_TOUT_STR; size_t _z_bt_config_strlen(const _z_str_intmap_t *s); diff --git a/include/zenoh-pico/link/config/serial.h b/include/zenoh-pico/link/config/serial.h index 85270be62..7eb4408ba 100644 --- a/include/zenoh-pico/link/config/serial.h +++ b/include/zenoh-pico/link/config/serial.h @@ -45,7 +45,7 @@ #define SERIAL_CONFIG_MAPPING_BUILD \ _z_str_intmapping_t args[SERIAL_CONFIG_ARGC]; \ args[0]._key = SERIAL_CONFIG_BAUDRATE_KEY; \ - args[0]._str = SERIAL_CONFIG_BAUDRATE_STR; + args[0]._str = (char *)SERIAL_CONFIG_BAUDRATE_STR; // args[1]._key = SERIAL_CONFIG_DATABITS_KEY; // args[1]._str = SERIAL_CONFIG_DATABITS_STR; // args[2]._key = SERIAL_CONFIG_FLOWCONTROL_KEY; diff --git a/include/zenoh-pico/link/config/tcp.h b/include/zenoh-pico/link/config/tcp.h index ed57e7700..9e3e0f5a8 100644 --- a/include/zenoh-pico/link/config/tcp.h +++ b/include/zenoh-pico/link/config/tcp.h @@ -29,7 +29,7 @@ #define TCP_CONFIG_MAPPING_BUILD \ _z_str_intmapping_t args[TCP_CONFIG_ARGC]; \ args[0]._key = TCP_CONFIG_TOUT_KEY; \ - args[0]._str = TCP_CONFIG_TOUT_STR; + args[0]._str = (char *)TCP_CONFIG_TOUT_STR; size_t _z_tcp_config_strlen(const _z_str_intmap_t *s); diff --git a/include/zenoh-pico/link/config/udp.h b/include/zenoh-pico/link/config/udp.h index dd374b5b6..fb6ee2c64 100644 --- a/include/zenoh-pico/link/config/udp.h +++ b/include/zenoh-pico/link/config/udp.h @@ -30,14 +30,14 @@ #define UDP_CONFIG_JOIN_STR "join" #if Z_FEATURE_LINK_UDP_UNICAST == 1 || Z_FEATURE_LINK_UDP_MULTICAST == 1 -#define UDP_CONFIG_MAPPING_BUILD \ - _z_str_intmapping_t args[UDP_CONFIG_ARGC]; \ - args[0]._key = UDP_CONFIG_IFACE_KEY; \ - args[0]._str = UDP_CONFIG_IFACE_STR; \ - args[1]._key = UDP_CONFIG_TOUT_KEY; \ - args[1]._str = UDP_CONFIG_TOUT_STR; \ - args[2]._key = UDP_CONFIG_JOIN_KEY; \ - args[2]._str = UDP_CONFIG_JOIN_STR; +#define UDP_CONFIG_MAPPING_BUILD \ + _z_str_intmapping_t args[UDP_CONFIG_ARGC]; \ + args[0]._key = UDP_CONFIG_IFACE_KEY; \ + args[0]._str = (char *)UDP_CONFIG_IFACE_STR; \ + args[1]._key = UDP_CONFIG_TOUT_KEY; \ + args[1]._str = (char *)UDP_CONFIG_TOUT_STR; \ + args[2]._key = UDP_CONFIG_JOIN_KEY; \ + args[2]._str = (char *)UDP_CONFIG_JOIN_STR; size_t _z_udp_config_strlen(const _z_str_intmap_t *s); diff --git a/src/api/api.c b/src/api/api.c index c95ec26ab..95ba8fbea 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -502,19 +502,19 @@ int8_t z_scout(z_owned_scouting_config_t *config, z_owned_closure_hello_t *callb char *opt_as_str = _z_config_get(config->_value, Z_CONFIG_SCOUTING_WHAT_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_SCOUTING_WHAT_DEFAULT; + opt_as_str = (char *)Z_CONFIG_SCOUTING_WHAT_DEFAULT; } z_what_t what = strtol(opt_as_str, NULL, 10); opt_as_str = _z_config_get(config->_value, Z_CONFIG_MULTICAST_LOCATOR_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_MULTICAST_LOCATOR_DEFAULT; + opt_as_str = (char *)Z_CONFIG_MULTICAST_LOCATOR_DEFAULT; } char *mcast_locator = opt_as_str; opt_as_str = _z_config_get(config->_value, Z_CONFIG_SCOUTING_TIMEOUT_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_SCOUTING_TIMEOUT_DEFAULT; + opt_as_str = (char *)Z_CONFIG_SCOUTING_TIMEOUT_DEFAULT; } uint32_t timeout = strtoul(opt_as_str, NULL, 10); diff --git a/src/net/session.c b/src/net/session.c index 8925c962e..fd3d5997d 100644 --- a/src/net/session.c +++ b/src/net/session.c @@ -71,19 +71,19 @@ int8_t _z_open(_z_session_t *zn, _z_config_t *config) { if (connect == NULL && listen == NULL) { // Scout if peer is not configured opt_as_str = _z_config_get(config, Z_CONFIG_SCOUTING_WHAT_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_SCOUTING_WHAT_DEFAULT; + opt_as_str = (char *)Z_CONFIG_SCOUTING_WHAT_DEFAULT; } z_what_t what = strtol(opt_as_str, NULL, 10); opt_as_str = _z_config_get(config, Z_CONFIG_MULTICAST_LOCATOR_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_MULTICAST_LOCATOR_DEFAULT; + opt_as_str = (char *)Z_CONFIG_MULTICAST_LOCATOR_DEFAULT; } char *mcast_locator = opt_as_str; opt_as_str = _z_config_get(config, Z_CONFIG_SCOUTING_TIMEOUT_KEY); if (opt_as_str == NULL) { - opt_as_str = Z_CONFIG_SCOUTING_TIMEOUT_DEFAULT; + opt_as_str = (char *)Z_CONFIG_SCOUTING_TIMEOUT_DEFAULT; } uint32_t timeout = strtoul(opt_as_str, NULL, 10);