Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose low-level api #20

Closed
acrisci opened this issue Apr 3, 2019 · 0 comments
Closed

Expose low-level api #20

acrisci opened this issue Apr 3, 2019 · 0 comments

Comments

@acrisci
Copy link
Member

acrisci commented Apr 3, 2019

A low-level api would allow clients to send and receive arbitrary messages on the bus. This api would be needed for implementing dbus-send or dbus-monitor with this library.

let serial = bus.serial();
let msg = {
  type: METHOD_CALL,
  serial: serial,
  interface: 'org.test.interface',
  destination: 'org.test.name',
  member: 'SomeMethod',
  signature: 's',
  body: 'hello world'
};

bus.sendMessage(msg);

bus.on('message', (msg) => {
  if (msg.replySerial === serial) {
    // handle reply
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant