From 280888a5b3d66f418fc8888ed1d06b9b6987d488 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Wed, 20 Mar 2024 16:39:29 +0100 Subject: [PATCH] Add default get timeout --- include/zenoh-pico/config.h | 7 +++++++ src/api/api.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/zenoh-pico/config.h b/include/zenoh-pico/config.h index 31d8ccf4b..041f3a36b 100644 --- a/include/zenoh-pico/config.h +++ b/include/zenoh-pico/config.h @@ -330,4 +330,11 @@ #define ZP_ASM_NOP __asm__("nop") #endif +/** + * Default get timeout in milliseconds. + */ +#ifndef Z_GET_TIMEOUT_DEFAULT +#define Z_GET_TIMEOUT_DEFAULT 10000 +#endif + #endif /* INCLUDE_ZENOH_PICO_CONFIG_H */ diff --git a/src/api/api.c b/src/api/api.c index a1365a948..c95ec26ab 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -788,7 +788,7 @@ z_get_options_t z_get_options_default(void) { #if Z_FEATURE_ATTACHMENT == 1 // TODO:ATT.attachment = z_attachment_null() #endif - .timeout_ms = 0 + .timeout_ms = Z_GET_TIMEOUT_DEFAULT }; }