Permalink
Browse files

Implement addMatch on DBusConnection

  • Loading branch information...
1 parent 5d6e4b5 commit ac6628a1b7066f479949d6bb6ee92684fecd2780 @rossburton committed May 16, 2012
Showing with 12 additions and 2 deletions.
  1. +12 −2 dbus.cc
View
@@ -672,7 +672,9 @@ class DBusConnectionWrap : ObjectWrap {
//NODE_SET_PROTOTYPE_METHOD(t, "close", close);
NODE_SET_PROTOTYPE_METHOD(t, "canSendType", canSendType);
-
+
+ NODE_SET_PROTOTYPE_METHOD(t, "addMatch", addMatch);
+
NODE_SET_PROTOTYPE_METHOD(t, "addFilter", addFilter);
//NODE_SET_PROTOTYPE_METHOD(t, "removeFilter", removeFilter);
@@ -866,7 +868,15 @@ class DBusConnectionWrap : ObjectWrap {
return scope.Close(object);
}
-
+ static Handle<Value> addMatch(const Arguments &args) {
+ REQ_STR_ARG(0, path);
+ DBusConnectionWrap* connection = THIS_CONNECTION(args);
+
+ dbus_bus_add_match(*connection, path, NULL);
+
+ return Undefined();
+ };
+
static void freeConnectionCallbackBaton(void* data) {
//delete (ConnectionCallbackBaton*)data;

0 comments on commit ac6628a

Please sign in to comment.