@@ -87,7 +87,9 @@ void SendTopicsSubs::update(uxrSession *session, uxrStreamId reliable_out_stream
87
87
88
88
if (@ (pub[' topic_simple' ])_data_writer .id == UXR_INVALID_ID) {
89
89
// data writer not created yet
90
- create_data_writer (session, reliable_out_stream_id, participant_id, ORB_ID :: @ (pub[' topic_simple' ]), client_namespace, " @(pub['topic_name'])" , " @(pub['dds_type'])" , @ (pub[' topic_simple' ])_data_writer);
90
+ if (! create_data_writer (session, reliable_out_stream_id, participant_id, ORB_ID :: @ (pub[' topic_simple' ]), client_namespace, " @(pub['topic_name'])" , " @(pub['dds_type'])" , @ (pub[' topic_simple' ])_data_writer)) {
91
+ @ (pub[' topic_simple' ])_data_writer .id = UXR_INVALID_ID;
92
+ }
91
93
}
92
94
93
95
if (@ (pub[' topic_simple' ])_data_writer .id != UXR_INVALID_ID) {
@@ -107,7 +109,6 @@ void SendTopicsSubs::update(uxrSession *session, uxrStreamId reliable_out_stream
107
109
} else {
108
110
// PX4_ERR (" Error UXR_INVALID_ID @(pub['topic_simple'])" );
109
111
}
110
-
111
112
}
112
113
@ [ end for ]@
113
114
}
@@ -152,14 +153,15 @@ static void on_topic_update(uxrSession *session, uxrObjectId object_id, uint16_t
152
153
153
154
bool RcvTopicsPubs :: init (uxrSession * session, uxrStreamId reliable_out_stream_id, uxrStreamId reliable_in_stream_id, uxrStreamId best_effort_in_stream_id, uxrObjectId participant_id, const char * client_namespace)
154
155
{
156
+ bool ret = true ;
155
157
@ [ for idx, sub in enumerate (subscriptions)]@
156
158
{
157
159
uint16_t queue_depth = uORB :: DefaultQueueSize < @ (sub[' simple_base_type' ])_s> :: value * 2 ; // use a bit larger queue size than internal
158
- create_data_reader (session, reliable_out_stream_id, best_effort_in_stream_id, participant_id, @ (idx), client_namespace, " @(sub['topic_name'])" , " @(sub['dds_type'])" , queue_depth);
160
+ ret = create_data_reader (session, reliable_out_stream_id, best_effort_in_stream_id, participant_id, @ (idx), client_namespace, " @(sub['topic_name'])" , " @(sub['dds_type'])" , queue_depth);
159
161
}
160
162
@ [ end for ]@
161
163
162
164
uxr_set_topic_callback (session, on_topic_update, this );
163
165
164
- return true ;
166
+ return ret ;
165
167
}
0 commit comments