Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add z_reliability_default #703

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading