Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

travis image

  • Loading branch information...
commit d51a35078ff6f43910fe5f056c43283ea6d8a9b9 1 parent 2864af5
@sidorares authored
Showing with 51 additions and 0 deletions.
  1. +51 −0 README.md
View
51 README.md
@@ -2,6 +2,8 @@ node-dbus
===========
D-bus protocol client and server for node.js
+[![Build Status](https://secure.travis-ci.org/sidorares/node-dbus.png)](http://travis-ci.org/sidorares/node-dbus)
+
Installation
------------
@@ -43,3 +45,52 @@ sessionBus.getService('org.freedesktop.Notifications').getInterface(
});
});
```
+
+API
+---
+
+### Low level messaging: bus connection
+
+`connection = dbus.createClient(options)`
+
+options:
+ - socket - unix socket path
+ - port - TCP port
+ - host - TCP host
+ - busAddress - encoded bus address. Default is `DBUS_SESSION_BUS_ADDRESS` environment variable. See http://dbus.freedesktop.org/doc/dbus-specification.html#addresses
+ - ( TODO: add/document option to use adress from X11 session )
+
+connection has only one method, `message(msg)`
+
+message fields:
+ - type - methodCall, methodReturn, error or signal
+ - path - object path
+ - interface
+ - destination
+ - sender
+ - member
+ - serial
+ - signature
+ - body
+ - errorName
+ - replySerial
+
+connection signals:
+ - connect - emitted after successful authentication
+ - message
+ - error
+
+example:
+
+```js
+var dbus = require('dbus-native');
+var conn = dbus.createConnection();
+conn.message({
+ path:'/org/freedesktop/DBus',
+ destination: 'org.freedesktop.DBus',
+ 'interface': 'org.freedesktop.DBus',
+ member: 'Hello',
+ type: dbus.messageType.methodCall
+});
+conn.on('message', function(msg) { console.log(msg); });
+```
Please sign in to comment.
Something went wrong with that request. Please try again.