diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index a61e7cdb0..3fb6ed4a5 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -1429,6 +1429,39 @@ z_sample_kind_t z_sample_kind(const z_loaned_sample_t *sample); */ z_qos_t z_sample_qos(const z_loaned_sample_t *sample); +/** + * Got sample qos congestion control value. + * + * Parameters: + * sample: Pointer to a :c:type:`z_loaned_sample_t` to get the congestion control from. + * + * Return: + * The congestion control wrapped as a :c:type:`z_congestion_control_t`. + */ +z_congestion_control_t z_sample_congestion_control(const z_loaned_sample_t *sample); + +/** + * Got whether sample qos express flag was set or not. + * + * Parameters: + * sample: Pointer to a :c:type:`z_loaned_sample_t` to get the express flag from. + * + * Return: + * The express flag value. + */ +bool z_sample_express(const z_loaned_sample_t *sample); + +/** + * + * Parameters: + * sample: Pointer to a :c:type:`z_loaned_sample_t` to get the qos from. + * + * Return: + * The qos wrapped as a :c:type:`z_qos_t`. + * Got sample qos priority value. + */ +z_priority_t z_sample_priority(const z_loaned_sample_t *sample); + /** * Gets the attachment of a sample by aliasing it. * diff --git a/src/api/api.c b/src/api/api.c index cd81f222a..29c22dc19 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -922,6 +922,11 @@ z_timestamp_t z_sample_timestamp(const z_loaned_sample_t *sample) { return sampl const z_loaned_encoding_t *z_sample_encoding(const z_loaned_sample_t *sample) { return &sample->encoding; } z_qos_t z_sample_qos(const z_loaned_sample_t *sample) { return sample->qos; } const z_loaned_bytes_t *z_sample_attachment(const z_loaned_sample_t *sample) { return &sample->attachment; } +z_congestion_control_t z_sample_congestion_control(const z_loaned_sample_t *sample) { + return _z_n_qos_get_congestion_control(sample->qos); +} +bool z_sample_express(const z_loaned_sample_t *sample) { return _z_n_qos_get_express(sample->qos); } +z_priority_t z_sample_priority(const z_loaned_sample_t *sample) { return _z_n_qos_get_priority(sample->qos); } const z_loaned_bytes_t *z_reply_err_payload(const z_loaned_reply_err_t *reply_err) { return &reply_err->payload; } const z_loaned_encoding_t *z_reply_err_encoding(const z_loaned_reply_err_t *reply_err) { return &reply_err->encoding; }