From 859ba81e33a24b18ffc21a59574d83f76be957a6 Mon Sep 17 00:00:00 2001 From: Peter van der Perk Date: Sun, 9 Mar 2025 12:53:58 +0100 Subject: [PATCH] Zenoh fix gcc/sitl compile errors --- src/modules/zenoh/CMakeLists.txt | 2 ++ src/modules/zenoh/zenoh.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/zenoh/CMakeLists.txt b/src/modules/zenoh/CMakeLists.txt index ce2dce2e50..9fc0ba0cb1 100644 --- a/src/modules/zenoh/CMakeLists.txt +++ b/src/modules/zenoh/CMakeLists.txt @@ -59,6 +59,8 @@ target_compile_options(zenohpico_static PUBLIC -Wno-cast-align -Wno-stringop-truncation -Wno-unused-result -Wno-type-limits + -Wno-unused-variable + -Wno-maybe-uninitialized -DZ_BATCH_SIZE_RX=512 -DZ_BATCH_SIZE_TX=512) diff --git a/src/modules/zenoh/zenoh.cpp b/src/modules/zenoh/zenoh.cpp index ea93a27ecc..64ab6fc1ce 100644 --- a/src/modules/zenoh/zenoh.cpp +++ b/src/modules/zenoh/zenoh.cpp @@ -98,8 +98,13 @@ void ZENOH::run() int8_t ret; int i; +#ifndef BOARD_HAS_NO_UUID px4_guid_t px4_guid; board_get_px4_guid(px4_guid); +#else + // TODO Fill ID with something reasonable + px4_guid_t px4_guid = {0xAA, 0xBB, 0xAA}; +#endif Zenoh_Config z_config; @@ -149,7 +154,7 @@ void ZENOH::run() if (_zenoh_subscribers[i] != 0) { const uint8_t *rihs_hash = getRIHS01_Hash(type); toCamelCase(type); // Convert uORB type to camel case - snprintf(keyexpr, KEYEXPR_SIZE, "%li/%s/" + snprintf(keyexpr, KEYEXPR_SIZE, "%" PRId32 "/%s/" KEYEXPR_MSG_NAME "%s_/RIHS01_" "%02x%02x%02x%02x%02x%02x%02x%02x" "%02x%02x%02x%02x%02x%02x%02x%02x" @@ -194,7 +199,7 @@ void ZENOH::run() if (_zenoh_publishers[i] != 0) { const uint8_t *rihs_hash = getRIHS01_Hash(type); toCamelCase(type); // Convert uORB type to camel case - snprintf(keyexpr, KEYEXPR_SIZE, "%li/%s/" + snprintf(keyexpr, KEYEXPR_SIZE, "%" PRId32 "/%s/" KEYEXPR_MSG_NAME "%s_/RIHS01_" "%02x%02x%02x%02x%02x%02x%02x%02x" "%02x%02x%02x%02x%02x%02x%02x%02x"