Skip to content

Commit

Permalink
Add z_reliability_default (#703)
Browse files Browse the repository at this point in the history
* Add z_reliability_default

* Fix z_sample_reliability docs
  • Loading branch information
sashacmc authored Oct 2, 2024
1 parent 884e68d commit 3567b4b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------
Expand Down
12 changes: 11 additions & 1 deletion include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3567b4b

Please sign in to comment.