From b58415ec253618d71a74c855283ce1fa80e52b8f Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Wed, 2 Oct 2024 10:21:32 +0200 Subject: [PATCH 1/2] Add z_reliability_default --- docs/api.rst | 2 +- include/zenoh-pico/api/primitives.h | 10 ++++++++++ src/api/api.c | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index 3c8fe008f..2bd8af88d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -888,7 +888,7 @@ Functions .. autocfunction:: primitives.h::z_publisher_options_default .. autocfunction:: primitives.h::z_publisher_put_options_default .. autocfunction:: primitives.h::z_publisher_delete_options_default -.. TODO: implement .. autocfunction:: primitives.h::z_reliability_default +.. autocfunction:: primitives.h::z_reliability_default Ownership Functions ------------------- diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index ab2391092..6ff5c4b63 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -2124,6 +2124,16 @@ void z_scout_options_default(z_scout_options_t *options); */ z_result_t zp_send_join(const z_loaned_session_t *zs, const zp_send_join_options_t *options); +/** + * Gets the default reliability value (unstable). + * + * Return: + * The reliability wrapped as a :c:type:`z_reliability_t`. + */ +#ifdef Z_FEATURE_UNSTABLE_API +z_reliability_t z_reliability_default(void); +#endif + #ifdef __cplusplus } #endif diff --git a/src/api/api.c b/src/api/api.c index 982fad0a3..77941f4f3 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -1465,3 +1465,7 @@ z_result_t zp_send_join(const z_loaned_session_t *zs, const zp_send_join_options (void)(options); return _zp_send_join(_Z_RC_IN_VAL(zs)); } + +#ifdef Z_FEATURE_UNSTABLE_API +z_reliability_t z_reliability_default(void) { return Z_RELIABILITY_DEFAULT; } +#endif From 86d53118a6bf831e97e3bc8049d649f21e475da5 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Wed, 2 Oct 2024 10:27:35 +0200 Subject: [PATCH 2/2] Fix z_sample_reliability docs --- include/zenoh-pico/api/primitives.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index 6ff5c4b63..8daea5659 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -1404,6 +1404,7 @@ const z_loaned_encoding_t *z_sample_encoding(const z_loaned_sample_t *sample); */ z_sample_kind_t z_sample_kind(const z_loaned_sample_t *sample); +#ifdef Z_FEATURE_UNSTABLE_API /** * Gets the reliability a sample was received with (unstable). * @@ -1413,7 +1414,6 @@ z_sample_kind_t z_sample_kind(const z_loaned_sample_t *sample); * Return: * The reliability wrapped as a :c:type:`z_reliability_t`. */ -#ifdef Z_FEATURE_UNSTABLE_API z_reliability_t z_sample_reliability(const z_loaned_sample_t *sample); #endif @@ -2124,13 +2124,13 @@ void z_scout_options_default(z_scout_options_t *options); */ z_result_t zp_send_join(const z_loaned_session_t *zs, const zp_send_join_options_t *options); +#ifdef Z_FEATURE_UNSTABLE_API /** * Gets the default reliability value (unstable). * * Return: * The reliability wrapped as a :c:type:`z_reliability_t`. */ -#ifdef Z_FEATURE_UNSTABLE_API z_reliability_t z_reliability_default(void); #endif