Skip to content

Commit

Permalink
Add dummy options parameter to z_open/z_close
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Sep 10, 2024
1 parent 9e926b5 commit d13fd0b
Show file tree
Hide file tree
Showing 82 changed files with 241 additions and 219 deletions.
2 changes: 1 addition & 1 deletion examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void setup() {

// Open Zenoh session
Serial.print("Opening Zenoh Session...");
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_pub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
4 changes: 2 additions & 2 deletions examples/arduino/z_pull.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand All @@ -76,7 +76,7 @@ void setup() {

if (zp_start_read_task(z_session_loan_mut(&s), NULL) < 0 || zp_start_lease_task(z_session_loan_mut(&s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -180,7 +180,7 @@ void app_main() {

printf("Closing Zenoh Session...");

z_close(z_move(s));
z_close(z_move(s), NULL);
printf("OK!\n");
}
#else
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -165,7 +165,7 @@ void app_main() {
printf("Closing Zenoh Session...");
z_undeclare_publisher(z_move(pub));

z_close(z_move(s));
z_close(z_move(s), NULL);
printf("OK!\n");
}
#else
Expand Down
6 changes: 3 additions & 3 deletions examples/espidf/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand All @@ -140,7 +140,7 @@ void app_main() {
// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
exit(-1);
}

Expand Down Expand Up @@ -181,7 +181,7 @@ void app_main() {
z_undeclare_subscriber(z_move(sub));
z_drop(z_move(handler));

z_close(z_move(s));
z_close(z_move(s), NULL);
printf("OK!\n");
}
#else
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ void app_main() {
printf("Closing Zenoh Session...");
z_undeclare_queryable(z_move(qable));

z_close(z_move(s));
z_close(z_move(s), NULL);
printf("OK!\n");
}
#else
Expand Down
4 changes: 2 additions & 2 deletions examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ void app_main() {
printf("Closing Zenoh Session...");
z_undeclare_subscriber(z_move(sub));

z_close(z_move(s));
z_close(z_move(s), NULL);
printf("OK!\n");
}
#else
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand Down Expand Up @@ -100,7 +100,7 @@ void app_main(void) {
}
}

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down Expand Up @@ -78,7 +78,7 @@ void app_main(void) {
if (zp_start_read_task(z_loan_mut(s), &read_task_opt) < 0 ||
zp_start_lease_task(z_loan_mut(s), &lease_task_opt) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand Down Expand Up @@ -108,7 +108,7 @@ void app_main(void) {

// Clean-up
z_undeclare_publisher(z_move(pub));
z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
4 changes: 2 additions & 2 deletions examples/freertos_plus_tcp/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down Expand Up @@ -80,7 +80,7 @@ void app_main(void) {

z_undeclare_publisher(z_move(pub));

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand Down Expand Up @@ -90,7 +90,7 @@ void app_main(void) {
z_undeclare_subscriber(z_move(sub));
z_drop(z_move(handler));

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
8 changes: 4 additions & 4 deletions examples/freertos_plus_tcp/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand All @@ -57,7 +57,7 @@ void app_main(void) {
z_view_keyexpr_from_str_unchecked(&vke, KEYEXPR);
if (z_declare_keyexpr(&ke, z_loan(s), z_loan(vke)) < 0) {
printf("Unable to declare key expression!\n");
z_close(z_move(s));
z_close(z_move(s), NULL);
return;
}

Expand All @@ -79,7 +79,7 @@ void app_main(void) {

// Clean up
z_undeclare_keyexpr(z_move(ke), z_loan(s));
z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand All @@ -98,7 +98,7 @@ void app_main(void) {

z_undeclare_queryable(z_move(qable));

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}

// Start read and lease tasks for zenoh-pico
if (zp_start_read_task(z_loan_mut(s), NULL) < 0 || zp_start_lease_task(z_loan_mut(s), NULL) < 0) {
printf("Unable to start read and lease tasks\n");
z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
return;
}

Expand All @@ -78,7 +78,7 @@ void app_main(void) {

z_undeclare_subscriber(z_move(sub));

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
4 changes: 2 additions & 2 deletions examples/freertos_plus_tcp/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
if (z_open(&s, z_move(config)) < 0) {
if (z_open(&s, z_move(config), NULL) < 0) {
printf("Unable to open session!\n");
return;
}
Expand All @@ -78,7 +78,7 @@ void app_main(void) {

z_undeclare_subscriber(z_move(sub));

z_close(z_move(s));
z_close(z_move(s), NULL);
}
#else
void app_main(void) {
Expand Down
4 changes: 2 additions & 2 deletions examples/mbed/z_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -101,7 +101,7 @@ int main(int argc, char **argv) {

printf("Closing Zenoh Session...");

z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
printf("OK!\n");

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/mbed/z_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
if (z_open(&s, z_config_move(&config)) < 0) {
if (z_open(&s, z_config_move(&config), NULL) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down Expand Up @@ -85,7 +85,7 @@ int main(int argc, char **argv) {
printf("Closing Zenoh Session...");
z_undeclare_publisher(z_publisher_move(&pub));

z_close(z_session_move(&s));
z_close(z_session_move(&s), NULL);
printf("OK!\n");

return 0;
Expand Down
Loading

0 comments on commit d13fd0b

Please sign in to comment.