Crate canadensis_udp
source · [−]Expand description
UAVCAN/UDP transport
The current version of the transport is documented at https://pyuavcan.readthedocs.io/en/latest/api/pyuavcan.transport.udp.html.
This implementation requires the std
library for sockets.
How sockets work
Sending
A transport can use one socket to send all outgoing message and service transfers. This socket gets bound to a normal address derived from the local node ID and an ephemeral UDP port.
Outgoing message transfers get sent to a multicast address based on the port ID and the fixed UDP port 16383.
Outgoing request transfers get sent to the address of the destination node with a UDP port number based on the service ID.
Receiving message transfers
Each subscription requires its own socket. The socket gets bound to the multicast address derived from the subject ID and the fixed UDP port 16383.
When the transport receives a packet, it knows the subject ID (associated with the socket) and extracts the source node ID from the source IP address.
Receiving service transfers
Each subscription requires its own socket. The socket gets bound to a normal address derived from the local node ID and a UDP port based on the service ID.
When the transport receives a packet, it knows the service ID (associated with the socket) and extracts the source node ID from the source IP address.
Structs
An address of a node
A UDP node ID
UDP transport receiver
A UDP transfer identifier
The UAVCAN/UDP transport