Skip to content

Commit

Permalink
Update z_open result check
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Apr 29, 2024
1 parent 755fad0 commit c0049a6
Show file tree
Hide file tree
Showing 69 changed files with 69 additions and 138 deletions.
3 changes: 1 addition & 2 deletions examples/arduino/z_get.ino
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ void setup() {

// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
3 changes: 1 addition & 2 deletions examples/arduino/z_pub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
3 changes: 1 addition & 2 deletions examples/arduino/z_pull.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
3 changes: 1 addition & 2 deletions examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
3 changes: 1 addition & 2 deletions examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ void setup() {
// Open Zenoh session
Serial.print("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
Serial.println("Unable to open session!");
while (1) {
;
Expand Down
3 changes: 1 addition & 2 deletions examples/espidf/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/espidf/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/espidf/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ void app_main() {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/freertos_plus_tcp/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void app_main(void) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/mbed/z_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/mbed/z_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/mbed/z_pull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/mbed/z_queryable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/mbed/z_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ int main(int argc, char **argv) {
// Open Zenoh session
printf("Opening Zenoh Session...");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_get_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ int main(int argc, char** argv) {
z_owned_config_t config;
z_config_default(&config);
z_owned_session_t session;
z_open(&session, z_move(config));
if (!z_check(session)) {
if (z_open(&session, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ int main(int argc, char** argv) {
z_owned_config_t config;
z_config_default(&config);
z_owned_session_t session;
z_open(&session, z_move(config));
if (!z_check(session)) {
if (z_open(&session, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_pub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ int main(int argc, char **argv) {
}
// Open session
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_queryable_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_sub_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_sub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c11/z_sub_thr.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ int main(int argc, char **argv) {
}
// Open session
z_owned_session_t s;
z_open(&s, z_move(config));
if (!z_check(s)) {
if (z_open(&s, z_move(config)) < 0) {
printf("Unable to open session!\n");
exit(-1);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/unix/c99/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ int main(int argc, char **argv) {

printf("Opening session...\n");
z_owned_session_t s;
z_open(&s, z_config_move(&config));
if (!z_session_check(&s)) {
if (z_open(&s, z_config_move(&config)) < 0) {
printf("Unable to open session!\n");
return -1;
}
Expand Down
Loading

0 comments on commit c0049a6

Please sign in to comment.