Skip to content

Commit

Permalink
travis image
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Dec 30, 2012
1 parent 2864af5 commit d51a350
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node-dbus
=========== ===========
D-bus protocol client and server for node.js 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 Installation
------------ ------------


Expand Down Expand Up @@ -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); });
```

0 comments on commit d51a350

Please sign in to comment.