Skip to content

Commit

Permalink
Remove legacy z_qos_t type
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Aug 14, 2024
1 parent 331d1d3 commit 1459efc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 46 deletions.
1 change: 0 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ Data Structures
.. autoctype:: types.h::zp_read_options_t
.. autoctype:: types.h::zp_send_keep_alive_options_t
.. autoctype:: types.h::zp_send_join_options_t
.. autoctype:: types.h::z_qos_t
.. autoctype:: types.h::z_bytes_reader_t
.. autoctype:: types.h::z_bytes_iterator_t
.. autoctype:: types.h::z_bytes_writer_t
Expand Down
13 changes: 1 addition & 12 deletions include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -1618,17 +1618,6 @@ 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);

/**
* Gets the qos value of a sample by aliasing it.
*
* 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`.
*/
z_qos_t z_sample_qos(const z_loaned_sample_t *sample);

/**
* Got sample qos congestion control value.
*
Expand Down Expand Up @@ -1657,7 +1646,7 @@ bool z_sample_express(const z_loaned_sample_t *sample);
* 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`.
* The priority wrapped as a :c:type:`z_priority_t`.
* Got sample qos priority value.
*/
z_priority_t z_sample_priority(const z_loaned_sample_t *sample);
Expand Down
30 changes: 0 additions & 30 deletions include/zenoh-pico/api/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,36 +417,6 @@ typedef struct {
z_what_t what;
} z_scout_options_t;

/**
* QoS settings of a zenoh message.
*/
typedef _z_qos_t z_qos_t;

/**
* Returns message priority.
*/
static inline z_priority_t z_qos_get_priority(z_qos_t qos) {
z_priority_t ret = _z_n_qos_get_priority(qos);
return ret == _Z_PRIORITY_CONTROL ? Z_PRIORITY_DEFAULT : ret;
}

/**
* Returns message congestion control.
*/
static inline z_congestion_control_t z_qos_get_congestion_control(z_qos_t qos) {
return _z_n_qos_get_congestion_control(qos);
}

/**
* Returns message express flag. If set to true, the message is not batched to reduce the latency.
*/
static inline _Bool z_qos_get_express(z_qos_t qos) { return _z_n_qos_get_express(qos); }

/**
* Returns default qos settings.
*/
static inline z_qos_t z_qos_default(void) { return _Z_N_QOS_DEFAULT; }

/**
* Represents a data sample.
*
Expand Down
1 change: 0 additions & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,6 @@ const z_timestamp_t *z_sample_timestamp(const z_loaned_sample_t *sample) {
}
}
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);
Expand Down
4 changes: 2 additions & 2 deletions tests/z_test_fragment_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ void data_handler(const z_loaned_sample_t *sample, void *ctx) {
}
}
printf("[rx]: Received packet on %s, len: %d, validity: %d, qos {priority: %d, cong_ctrl: %d}\n",
z_string_data(z_loan(keystr)), (int)data_len, is_valid, z_qos_get_priority(sample->qos),
z_qos_get_congestion_control(sample->qos));
z_string_data(z_loan(keystr)), (int)data_len, is_valid, z_sample_priority(sample),
z_sample_congestion_control(sample));
z_drop(z_move(value));
}

Expand Down

0 comments on commit 1459efc

Please sign in to comment.