mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-05 17:50:35 +08:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user