mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-28 09:14:07 +08:00
microdds_client: add _subs reset method to allow reconnections
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
This commit is contained in:
parent
00bfd5436a
commit
2a64145dcd
@ -37,6 +37,14 @@ struct SendTopicsSubs {
|
||||
uint32_t num_payload_sent{};
|
||||
|
||||
void update(uxrSession *session, uxrStreamId reliable_out_stream_id, uxrStreamId best_effort_stream_id, uxrObjectId participant_id, const char *client_namespace);
|
||||
void reset();
|
||||
};
|
||||
|
||||
void SendTopicsSubs::reset() {
|
||||
num_payload_sent = 0;
|
||||
@[ for idx, pub in enumerate(publications)]@
|
||||
@(pub['topic_simple'])_data_writer = uxr_object_id(0, UXR_INVALID_ID);
|
||||
@[ end for]@
|
||||
};
|
||||
|
||||
void SendTopicsSubs::update(uxrSession *session, uxrStreamId reliable_out_stream_id, uxrStreamId best_effort_stream_id, uxrObjectId participant_id, const char *client_namespace)
|
||||
|
||||
@ -371,6 +371,7 @@ void MicroddsClient::run()
|
||||
uxr_delete_session_retries(&session, _connected ? 1 : 0);
|
||||
_last_payload_tx_rate = 0;
|
||||
_last_payload_tx_rate = 0;
|
||||
_subs->reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user