microRTPS: send the system ID with the RTPS packet header and remove the need for extra id fields in uORB

This allows that all messages (not only timesync messages) that get received on the same system that sent them do not get parsed. As the microRTPS agent is built currently, this will only happen right now if someone sets the same UDP port to send and receive data, or by manually changing the agent topics (which were always autogenerated).
This commit is contained in:
TSC21
2021-07-14 14:25:31 +02:00
committed by Nuno Marques
parent a10dab516c
commit ba3dbbd38d
8 changed files with 205 additions and 182 deletions
@@ -168,12 +168,15 @@ static int micrortps_start(int argc, char *argv[])
return -1;
}
// Set the system ID to FMU, in order to identify the client side
const uint8_t sys_id = static_cast<uint8_t>(MicroRtps::System::FMU);
switch (_options.transport) {
case options::eTransports::UART: {
transport_node = new UART_node(_options.device, _options.baudrate, _options.poll_ms,
_options.sw_flow_control, _options.hw_flow_control, _options.verbose_debug);
PX4_INFO("UART transport: device: %s; baudrate: %" PRIu32 "; sleep: %" PRIu32 "ms; poll: %" PRIu32
"ms; flow_control: %s",
_options.sw_flow_control, _options.hw_flow_control, sys_id,
_options.verbose_debug);
PX4_INFO("UART transport: device: %s; baudrate: %" PRIu32 "; sleep: %" PRIu32 "ms; flow_control: %s",
_options.device, _options.baudrate, _options.sleep_us, _options.poll_ms,
_options.sw_flow_control ? "SW enabled" : (_options.hw_flow_control ? "HW enabled" : "No"));
}
@@ -181,7 +184,7 @@ static int micrortps_start(int argc, char *argv[])
case options::eTransports::UDP: {
transport_node = new UDP_node(_options.ip, _options.recv_port, _options.send_port,
_options.verbose_debug);
sys_id, _options.verbose_debug);
PX4_INFO("UDP transport: ip address: %s; recv port: %" PRIu16 "; send port: %" PRIu16 "; sleep: %" PRIu32 "us",
_options.ip, _options.recv_port, _options.send_port, _options.sleep_us);