node dbus-native-async
D-bus protocol client and server for node.js
Installation
npm install dbus-native-async
or
git clone https://viktorlv30@bitbucket.org/viktorlv30/dbus-native-async.git # clone the repo cd node-dbus-asyncnpm install # install dependencies sudo cp examples/build_try_ts2_2node loginBusExample.js # if you want to test examples/loginBusExample.js after call another console as Alt+F2 and login into one more time and return to first console - you should see the result
Usage
Short example using desktop notifications service
/// /// /// ;;; try catch error
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:
var dbus = ;var conn = dbus;conn;conn;
Links
- https://github.com/sidorares/node-dbus - original project
- http://cgit.freedesktop.org/dbus - freedesktop reference C library