Skip to content

Commit

Permalink
Fix #245
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Sep 12, 2023
1 parent b68364f commit ee13957
Show file tree
Hide file tree
Showing 53 changed files with 120 additions and 120 deletions.
8 changes: 4 additions & 4 deletions examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -79,8 +79,8 @@ void setup() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/arduino/z_pub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -56,8 +56,8 @@ void setup() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/arduino/z_pull.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -67,8 +67,8 @@ void setup() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -67,8 +67,8 @@ void setup() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -65,8 +65,8 @@ void setup() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/espidf/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static int s_retry_count = 0;
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -133,8 +133,8 @@ void app_main() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/espidf/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static int s_retry_count = 0;
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -120,8 +120,8 @@ void app_main() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/espidf/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static int s_retry_count = 0;
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -126,8 +126,8 @@ void app_main() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static int s_retry_count = 0;
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -129,8 +129,8 @@ void app_main() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static int s_retry_count = 0;
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -126,8 +126,8 @@ void app_main() {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/mbed/z_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand Down Expand Up @@ -53,8 +53,8 @@ int main(int argc, char **argv) {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/mbed/z_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand All @@ -40,8 +40,8 @@ int main(int argc, char **argv) {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/mbed/z_pull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand All @@ -46,8 +46,8 @@ int main(int argc, char **argv) {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/mbed/z_queryable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand All @@ -49,8 +49,8 @@ int main(int argc, char **argv) {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
8 changes: 4 additions & 4 deletions examples/mbed/z_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#define CLIENT_OR_PEER 0 // 0: Client mode; 1: Peer mode
#if CLIENT_OR_PEER == 0
#define MODE "client"
#define PEER "" // If empty, it will scout
#define CONNECT "" // If empty, it will scout
#elif CLIENT_OR_PEER == 1
#define MODE "peer"
#define PEER "udp/224.0.0.225:7447#iface=en0"
#define CONNECT "udp/224.0.0.225:7447#iface=en0"
#else
#error "Unknown Zenoh operation mode. Check CLIENT_OR_PEER value."
#endif
Expand All @@ -46,8 +46,8 @@ int main(int argc, char **argv) {
// Initialize Zenoh Session and other parameters
z_owned_config_t config = z_config_default();
zp_config_insert(z_config_loan(&config), Z_CONFIG_MODE_KEY, z_string_make(MODE));
if (strcmp(PEER, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_PEER_KEY, z_string_make(PEER));
if (strcmp(CONNECT, "") != 0) {
zp_config_insert(z_config_loan(&config), Z_CONFIG_CONNECT_KEY, z_string_make(CONNECT));
}

// Open Zenoh session
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char **argv) {
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(mode));
if (locator != NULL) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(locator));
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(locator));
}

printf("Opening session...\n");
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(mode));
if (locator != NULL) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(locator));
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(locator));
}

printf("Opening session...\n");
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(mode));
if (locator != NULL) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(locator));
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(locator));
}

printf("Opening session...\n");
Expand Down
2 changes: 1 addition & 1 deletion examples/unix/c11/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char **argv) {
z_owned_config_t config = z_config_default();
zp_config_insert(z_loan(config), Z_CONFIG_MODE_KEY, z_string_make(mode));
if (locator != NULL) {
zp_config_insert(z_loan(config), Z_CONFIG_PEER_KEY, z_string_make(locator));
zp_config_insert(z_loan(config), Z_CONFIG_CONNECT_KEY, z_string_make(locator));
}

printf("Opening session...\n");
Expand Down
Loading

0 comments on commit ee13957

Please sign in to comment.