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..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,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); +#ifdef Z_FEATURE_UNSTABLE_API +/** + * Gets the default reliability value (unstable). + * + * Return: + * The reliability wrapped as a :c:type:`z_reliability_t`. + */ +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