Skip to main content

Crate rustorb_rtps

Crate rustorb_rtps 

Source
Expand description

The DDSI-RTPS 2.5 wire protocol for rustorb-dds.

What is here so far: reading and writing RTPS messages and submessages (DDSI-RTPS 2.5 clauses 8.3 and 9.4, rustorb-dds#3), the UDP transport (9.6.2, rustorb-dds#4), participant discovery (SPDP, 8.5.3, rustorb-dds#5) in spdp with the PL_CDR helpers in pl, and endpoint discovery and matching (SEDP, 8.5.4, rustorb-dds#6) in sedp, built on the reliable writer and reader of reliable, the message receiver of receiver and the QoS policies of qos. Changes too large for a datagram are split into DATA_FRAG and put back together by frag (8.4.14.1, rustorb-dds#18). The Writer Liveliness Protocol (8.4.13, rustorb-dds#19) is in wlp, and the endpoints of the DDS-XTypes TypeLookup service (rustorb-dds#33) in typelookup. The secure participant discovery of DDS Security (DCPSParticipantsSecure, rustorb-dds#69) is in spdp_secure.

use rustorb_rtps::*;

let mut msg = Message::new(Header::new(VendorId([0x01, 0x02]), GuidPrefix([7; 12])));
msg.submessages.push(Submessage::InfoTimestamp(InfoTimestamp {
    timestamp: Some(Time { seconds: 1, fraction: 0 }),
}));
msg.submessages.push(Submessage::Data(Data {
    reader_id: EntityId::UNKNOWN,
    writer_id: EntityId::user([0, 0, 1], entity_kind::USER_WRITER_NO_KEY),
    writer_sn: SequenceNumber(1),
    inline_qos: None,
    serialized_payload: Some(SerializedPayload {
        kind: PayloadKind::Data,
        bytes: vec![0x00, 0x01, 0x00, 0x00, 1, 0, 0, 0],
    }),
    non_standard_payload: false,
}));
let bytes = msg.encode(Endianness::Little).unwrap();
assert_eq!(Message::decode(&bytes).unwrap(), msg);

The user writers and readers built on these are in rustorb-dds.

Modules§

entity_kind
Values of EntityId::entity_kind (DDSI-RTPS 2.5, Table 9.1).
frag
Large data (DDSI-RTPS 2.5, 8.4.14.1): splitting a change into DATA_FRAG submessages, and putting the fragments back together.
pl
PL_CDR: parameter lists whose values are CDR, as used by the payloads of the discovery built-in endpoints (DDSI-RTPS 2.5, 9.6.3 and 10.3).
qos
The QoS policies that endpoint discovery reads and matches on.
receiver
The RTPS message receiver (DDSI-RTPS 2.5, 8.3.4): walks the submessages of a message and keeps the receiver state that tells entity submessages where they come from and who they are for.
reliable
Reliable writers and readers (DDSI-RTPS 2.5, 8.4.2, 8.4.9.2 and 8.4.12.2), without I/O.
sedp
The Simple Endpoint Discovery Protocol (DDSI-RTPS 2.5, 8.5.4, 8.5.5 and 9.6.3).
shm
A shared memory transport for participants of rustorb-dds on the same host (feature shm).
spdp
The Simple Participant Discovery Protocol (DDSI-RTPS 2.5, 8.5.3, 9.6.2 and 9.6.3).
spdp_secure
The DCPSParticipantsSecure builtin topic (DDS Security 1.2, 7.5.1.6).
submessage_id
Submessage ids (DDSI-RTPS 2.5, 9.4.5.1.1).
typelookup
The built-in endpoints of the TypeLookup service (DDS-XTypes 1.3 clause 7.6.3.3), with which participants ask each other for the TypeObjects of the types their endpoints announce.
udp
The UDPv4 transport and the default port numbers (DDSI-RTPS 2.5, 8.5.3.4, 9.5 and 9.6.2).
wlp
The Writer Liveliness Protocol (DDSI-RTPS 2.5, 8.4.13 and 9.6.3.1).

Structs§

AckNack
ACKNACK: a reader tells a writer what it has and what it misses (8.3.8.1).
BuiltinEndpointSet
The built-in endpoints a participant has (DDSI-RTPS 2.5, 9.3.2.12).
ChangeCount
A 64-bit count of changes, used in GAP (DDSI-RTPS 2.5, 8.3.5.11 and 9.3.2.11).
Count
A counter used to detect duplicate submessages (DDSI-RTPS 2.5, 8.3.5.10 and 9.4.2.13).
Data
DATA: a change to a data object, sent by a writer (8.3.8.2).
DataFrag
DATA_FRAG: some fragments of a change (8.3.8.3).
Duration
A length of time in NTP format: seconds + fraction / 2^32 (DDSI-RTPS 2.5, 9.3.2.1 and 9.3.2.3).
EntityId
The identifier of an entity within its participant (DDSI-RTPS 2.5, 9.3.1.2).
FragmentNumber
A 32-bit fragment number, starting at 1 (DDSI-RTPS 2.5, 8.3.5.6).
FragmentNumberSet
A set of up to 256 fragment numbers starting at base (DDSI-RTPS 2.5, 8.3.5.7 and 9.4.2.8).
Gap
GAP: a writer tells a reader that some changes will not be sent (8.3.8.4).
GroupDigest
Four octets that stand for a group of entities (DDSI-RTPS 2.5, 9.3.2.5).
Guid
A globally unique identifier of an entity (DDSI-RTPS 2.5, 9.3.1.5).
GuidPrefix
The 12-octet prefix shared by the GUIDs of all entities of one participant (DDSI-RTPS 2.5, 9.3.1.1).
Header
The fixed 20-octet header at the start of every message (9.4.4).
HeaderExtension
RTPS_HE: optional information that belongs to the message header (8.3.7). It must be the first submessage.
Heartbeat
HEARTBEAT: a writer tells readers which sequence numbers it has (8.3.8.6).
HeartbeatFrag
HEARTBEAT_FRAG: a writer tells readers which fragments it has (8.3.8.7).
HeartbeatGroupInfo
The group information of a HEARTBEAT (flag G, 8.3.8.6).
InfoDestination
INFO_DST: the participant the submessages that follow are for (8.3.8.8).
InfoReply
INFO_REPLY: where to send replies to the submessages that follow (8.3.8.9).
InfoReplyIp4
INFO_REPLY_IP4: the compact UDPv4 form of INFO_REPLY (9.4.5.15).
InfoSource
INFO_SRC: the logical source of the submessages that follow (8.3.8.10).
InfoTimestamp
INFO_TS: the source timestamp of the submessages that follow (8.3.8.11).
Locator
A transport address (DDSI-RTPS 2.5, 9.3.2.4).
LocatorUdpV4
The compact UDPv4 locator of INFO_REPLY_IP4 (DDSI-RTPS 2.5, 9.4.3.1).
Message
A whole RTPS message, as carried in one UDP datagram (9.5).
NackFrag
NACK_FRAG: a reader asks for missing fragments (8.3.8.12).
Pad
PAD: padding with no meaning (8.3.8.13).
Parameter
One parameter: an id and its value.
ParameterId
A parameter id (DDSI-RTPS 2.5, 9.4.2.11.2).
ParameterList
A list of parameters.
ProtocolVersion
An RTPS protocol version (DDSI-RTPS 2.5, 9.4.2.4).
SampleIdentity
The identity of a sample: its writer and its sequence number (SampleIdentity, DDS-RPC 1.0, 7.5.1.1.1). A reply carries that of its request in-line, as PID_RELATED_SAMPLE_IDENTITY (7.8.2).
SecurityParameters
The parameters of DDS Security in a discovery parameter list (ids 0x1000..=0x1fff and 0x5000..=0x5fff, DDS Security 1.2, 7.5.1.3), kept as octets for the security plugins. Their values depend on the byte order of the list, so each order has its own copy: a list read fills the one of its order; a list to write uses the one of its order.
SequenceNumber
A 64-bit signed sequence number (DDSI-RTPS 2.5, 8.3.5.4 and 9.3.2.10).
SequenceNumberSet
A set of up to 256 sequence numbers starting at base (DDSI-RTPS 2.5, 8.3.5.5 and 9.4.2.6).
SerializedPayload
The serialized payload of a DATA submessage, kept as octets (8.3.5.17, 9.4.2.12, clause 10).
Submessages
Iterator over the submessages of a message; see Message::parse.
Time
A point in time in NTP format: seconds + fraction / 2^32 (DDSI-RTPS 2.5, 9.3.2.1 and 9.3.2.2).
UnknownSubmessage
A submessage with an id this crate does not handle, kept as octets.
VendorId
The vendor of an RTPS implementation (DDSI-RTPS 2.5, 8.3.3.1.3).

Enums§

Checksum
The checksum of a HeaderExtension (9.4.2.15, Table 9.8).
DecodeError
Why a message, a submessage or a parameter list could not be read.
EncodeError
Why a message could not be written.
Endianness
The byte order of a submessage or of a CDR stream.
PayloadKind
What a serialized payload holds.
Submessage
One submessage.

Constants§

PROTOCOL_RTPS
PROTOCOL_RTPS.