Skip to main content

Module inline_qos

Module inline_qos 

Source
Expand description

Inline-QoS helpers for DDS-RPC and SEDP (DDS-RPC 1.0 §7.8.2).

Inline QoS is a crate::parameter_list::ParameterList in the body of a DATA/DATA_FRAG submessage (Q flag, Spec §9.4.5.3). Phase 2 already uses it for PID_KEY_HASH, PID_STATUS_INFO etc. — this module adds helpers for the RPC-specific inline-QoS PIDs:

  • PID_RELATED_SAMPLE_IDENTITY = 0x0083 (DDS-RPC 1.0 §7.8.2): is set by the reply writer in the inline QoS of every reply DATA; the value is the request_id (SampleIdentity = 16 byte writer_guid + 8 byte sequence_number) of the correlated request. Encoding: XCDR2-Final, alignment cap=4, i.e. 24 bytes without padding.

We encapsulate encode/decode here so that zerodds-rpc can work without a hard dependency on RTPS internals like the Parameter layout.

Modules§

status_info
Spec §9.6.3.9 — PID_STATUS_INFO bits.

Structs§

SampleIdentityBytes
Wire representation of a SampleIdentity (DDS-RPC 1.0 §7.5.1.1.1).

Constants§

SAMPLE_IDENTITY_WIRE_SIZE
Spec constant: 16 byte writer GUID + 8 byte sequence number.

Functions§

directed_write_matches_reader
Spec §8.7.7 — receiver-side filter: returns true if the sample is addressed to the reader with own_reader_guid (or no directed write is set). false if a PID_DIRECTED_WRITE is present and the value does NOT match own_guid — the caller MUST then discard the sample.
directed_write_param
Spec §8.7.7 / §9.6.2.2.5 — PID_DIRECTED_WRITE as inline QoS. Marks a sample as a point-to-point send to a single target reader (16 byte GUID). Other readers that receive the sample (e.g. via multicast) MUST discard it.
find_directed_write
Reads PID_DIRECTED_WRITE from an inline-QoS list.
find_key_hash
Reads PID_KEY_HASH from an inline-QoS list (Spec §9.6.4.8 + XTypes 1.3 §7.6.8). Returns the 16-byte identity of the instance, or None if the PID is missing / the value has an invalid length.
find_original_writer_info
Reads PID_ORIGINAL_WRITER_INFO from an inline-QoS list.
find_related_sample_identity
Reads PID_RELATED_SAMPLE_IDENTITY from an inline-QoS list.
find_status_info
Reads PID_STATUS_INFO from an inline-QoS list. Returns the 4-byte status word, or None if the PID is missing / the value is not 4 bytes.
lifecycle_inline_qos
Builds an inline-QoS ParameterList for a lifecycle marker — PID_KEY_HASH (16 byte) + PID_STATUS_INFO (4 byte). Sent by the writer on dispose/unregister_instance.
original_writer_info_param
Spec §8.7.9 — PID_ORIGINAL_WRITER_INFO as inline QoS. 24-byte value: 16 byte original GUID + 8 byte SequenceNumber (signed i64). Set by the persistence service when it forwards a historical sample on behalf of another writer.
related_sample_identity_param
Builds a Parameter with PID_RELATED_SAMPLE_IDENTITY (0x0083) and the 24-byte XCDR2 encoding of the SampleIdentity as the value.
reply_inline_qos
Builds an inline-QoS ParameterList that carries only the PID_RELATED_SAMPLE_IDENTITY — good enough for the reply DATA of a simple RPC operation. Callers can add further parameters (PID_KEY_HASH etc.) via push.
status_info_param
Builds a Parameter with PID_STATUS_INFO (0x0071). The value is a 4-byte status word (bits per status_info). The spec requires big-endian encoding independent of the RTPS header endianness (DDSI-RTPS 2.5 §9.6.3.9).