rclnodejs 0.23.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/publisher.js +1 -2
- package/lib/subscription.js +1 -1
- package/package.json +1 -1
- package/src/rcl_bindings.cpp +13 -2
- package/types/interfaces.d.ts +0 -941
package/lib/publisher.js
CHANGED
|
@@ -32,8 +32,7 @@ class Publisher extends Entity {
|
|
|
32
32
|
* @type {string}
|
|
33
33
|
*/
|
|
34
34
|
get topic() {
|
|
35
|
-
|
|
36
|
-
return fullTopic.split('/').pop();
|
|
35
|
+
return rclnodejs.getPublisherTopic(this._handle);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/**
|
package/lib/subscription.js
CHANGED
package/package.json
CHANGED
package/src/rcl_bindings.cpp
CHANGED
|
@@ -942,7 +942,7 @@ NAN_METHOD(Publish) {
|
|
|
942
942
|
info.GetReturnValue().Set(Nan::Undefined());
|
|
943
943
|
}
|
|
944
944
|
|
|
945
|
-
NAN_METHOD(
|
|
945
|
+
NAN_METHOD(GetPublisherTopic) {
|
|
946
946
|
rcl_publisher_t* publisher = reinterpret_cast<rcl_publisher_t*>(
|
|
947
947
|
RclHandle::Unwrap<RclHandle>(
|
|
948
948
|
Nan::To<v8::Object>(info[0]).ToLocalChecked())
|
|
@@ -952,6 +952,16 @@ NAN_METHOD(GetTopic) {
|
|
|
952
952
|
info.GetReturnValue().Set(Nan::New(topic).ToLocalChecked());
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
+
NAN_METHOD(GetSubscriptionTopic) {
|
|
956
|
+
rcl_subscription_t* subscription = reinterpret_cast<rcl_subscription_t*>(
|
|
957
|
+
RclHandle::Unwrap<RclHandle>(
|
|
958
|
+
Nan::To<v8::Object>(info[0]).ToLocalChecked())
|
|
959
|
+
->ptr());
|
|
960
|
+
|
|
961
|
+
const char* topic = rcl_subscription_get_topic_name(subscription);
|
|
962
|
+
info.GetReturnValue().Set(Nan::New(topic).ToLocalChecked());
|
|
963
|
+
}
|
|
964
|
+
|
|
955
965
|
NAN_METHOD(CreateClient) {
|
|
956
966
|
v8::Local<v8::Context> currentContent = Nan::GetCurrentContext();
|
|
957
967
|
RclHandle* node_handle = RclHandle::Unwrap<RclHandle>(
|
|
@@ -2039,7 +2049,8 @@ std::vector<BindingMethod> binding_methods = {
|
|
|
2039
2049
|
{"clearContentFilter", ClearContentFilter},
|
|
2040
2050
|
{"createPublisher", CreatePublisher},
|
|
2041
2051
|
{"publish", Publish},
|
|
2042
|
-
{"
|
|
2052
|
+
{"getPublisherTopic", GetPublisherTopic},
|
|
2053
|
+
{"getSubscriptionTopic", GetSubscriptionTopic},
|
|
2043
2054
|
{"createClient", CreateClient},
|
|
2044
2055
|
{"rclTakeResponse", RclTakeResponse},
|
|
2045
2056
|
{"sendRequest", SendRequest},
|