Skip to content

Instantly share code, notes, and snippets.

@hatzel
Created December 4, 2016 14:55
Show Gist options
  • Save hatzel/abb3ea759f564ab46be8f2cab3f278c5 to your computer and use it in GitHub Desktop.
Save hatzel/abb3ea759f564ab46be8f2cab3f278c5 to your computer and use it in GitHub Desktop.
When executing this in the examples directory of node-dbus you can observe incorrect datatypes being sent.
var DBus = require('../');
var dbus = new DBus();
function Type(signature, name) {
return { type: signature, name: name };
}
var service = dbus.registerService('session', 'test.lol');
var obj = service.createObject('/test/lol');
var iface1 = obj.createInterface('test.lol.i1');
iface1.addProperty('byte', {
type: Type('d', 'some_double'),
getter: function(callback) {
callback(1.0);
}
});
iface1.addProperty('uint32', {
type: Type('d', 'some_double'),
getter: function(callback) {
callback(257.0);
}
});
iface1.addProperty('double', {
type: Type('d', 'some_double'),
getter: function(callback) {
callback(257.5);
}
});
iface1.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment