@@ -88,24 +88,6 @@ Napi::Value ConvertToHashObject(Napi::Env env,
8888 return obj;
8989}
9090
91- Napi::Value ConvertToQoS (Napi::Env env, const rmw_qos_profile_t * qos_profile) {
92- Napi::Object qos = Napi::Object::New (env);
93- qos.Set (" depth" , Napi::Number::New (env, qos_profile->depth ));
94- qos.Set (" history" , Napi::Number::New (env, qos_profile->history ));
95- qos.Set (" reliability" , Napi::Number::New (env, qos_profile->reliability ));
96- qos.Set (" durability" , Napi::Number::New (env, qos_profile->durability ));
97- qos.Set (" lifespan" , ConvertRMWTimeToDuration (env, &qos_profile->lifespan ));
98- qos.Set (" deadline" , ConvertRMWTimeToDuration (env, &qos_profile->deadline ));
99- qos.Set (" liveliness" , Napi::Number::New (env, qos_profile->liveliness ));
100- qos.Set (
101- " liveliness_lease_duration" ,
102- ConvertRMWTimeToDuration (env, &qos_profile->liveliness_lease_duration ));
103- qos.Set (
104- " avoid_ros_namespace_conventions" ,
105- Napi::Boolean::New (env, qos_profile->avoid_ros_namespace_conventions ));
106- return qos;
107- }
108-
10991Napi::Value ConvertToJSTopicEndpoint (
11092 Napi::Env env, const rmw_topic_endpoint_info_t * topic_endpoint_info) {
11193 Napi::Array endpoint_gid = Napi::Array::New (env, RMW_GID_STORAGE_SIZE);
@@ -128,7 +110,7 @@ Napi::Value ConvertToJSTopicEndpoint(
128110 env, static_cast <int >(topic_endpoint_info->endpoint_type )));
129111 endpoint.Set (" endpoint_gid" , endpoint_gid);
130112 endpoint.Set (" qos_profile" ,
131- ConvertToQoS (env, &topic_endpoint_info->qos_profile ));
113+ rclnodejs:: ConvertToQoS (env, &topic_endpoint_info->qos_profile ));
132114 return endpoint;
133115}
134116
@@ -246,6 +228,24 @@ void ExtractNamesAndTypes(rcl_names_and_types_t names_and_types,
246228 }
247229}
248230
231+ Napi::Value ConvertToQoS (Napi::Env env, const rmw_qos_profile_t * qos_profile) {
232+ Napi::Object qos = Napi::Object::New (env);
233+ qos.Set (" depth" , Napi::Number::New (env, qos_profile->depth ));
234+ qos.Set (" history" , Napi::Number::New (env, qos_profile->history ));
235+ qos.Set (" reliability" , Napi::Number::New (env, qos_profile->reliability ));
236+ qos.Set (" durability" , Napi::Number::New (env, qos_profile->durability ));
237+ qos.Set (" lifespan" , ConvertRMWTimeToDuration (env, &qos_profile->lifespan ));
238+ qos.Set (" deadline" , ConvertRMWTimeToDuration (env, &qos_profile->deadline ));
239+ qos.Set (" liveliness" , Napi::Number::New (env, qos_profile->liveliness ));
240+ qos.Set (
241+ " liveliness_lease_duration" ,
242+ ConvertRMWTimeToDuration (env, &qos_profile->liveliness_lease_duration ));
243+ qos.Set (
244+ " avoid_ros_namespace_conventions" ,
245+ Napi::Boolean::New (env, qos_profile->avoid_ros_namespace_conventions ));
246+ return qos;
247+ }
248+
249249Napi::Array ConvertToJSTopicEndpointInfoList (
250250 Napi::Env env, const rmw_topic_endpoint_info_array_t * info_array) {
251251 Napi::Array list = Napi::Array::New (env, info_array->size );
0 commit comments