Skip to content

Provide API for configuring the mapping from Cyphal priority level [0,7] to DSCP value #16

@pavel-kirienko

Description

@pavel-kirienko

See OpenCyphal/specification#127

 typedef struct UdpardTxQueue
 {
     /// The maximum number of frames this queue is allowed to contain. An attempt to push more will fail with an
     /// out-of-memory error even if the memory is not exhausted. This value can be changed by the user at any moment.
     /// The purpose of this limitation is to ensure that a blocked queue does not exhaust the heap memory.
     size_t capacity;

     /// The transport-layer maximum transmission unit (MTU). The value can be changed arbitrarily at any time between
     /// pushes. It defines the maximum number of data bytes per UDP data frame in outgoing transfers via this queue.
     ///
     /// Only the standard values should be used as recommended by the specification;
     /// otherwise, networking interoperability issues may arise. See recommended values UDPARD_MTU_*.
     ///
     /// Valid values are any valid UDP frame data length value not smaller than 8.
     /// Invalid values are treated as the nearest valid value. The default is the maximum valid value.
     size_t mtu_bytes;

     /// The number of frames that are currently contained in the queue, initially zero.
     /// Do not modify this field!
     size_t size;

     /// The root of the priority queue is NULL if the queue is empty. Do not modify this field!
     UdpardTreeNode* root;

+    /// Mapping from the Cyphal priority level in [0,7], where the highest priority is at index 0
+    /// and the lowest priority is at the last element of the array, to the IP DSCP field value.
+    /// By default, the mapping is initialized per the recommendations given in the Cyphal/UDP specification.
+    uint8_t dscp_value_per_priority_level[UDPARD_PRIORITY_MAX + 1U];
+
     /// This field can be arbitrarily mutated by the user. It is never accessed by the library.
     /// Its purpose is to simplify integration with OOP interfaces.
     void* user_reference;
 } UdpardTxQueue;

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions