Created
April 7, 2013 12:13
-
-
Save sandeepmistry/5330261 to your computer and use it in GitHub Desktop.
dbus-native BlueZ unmarshall error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ name: '/', | |
service: | |
{ name: 'org.bluez', | |
bus: | |
{ connection: [Object], | |
serial: 2, | |
cookies: [Object], | |
methodCallHandlers: {}, | |
signals: [Object], | |
exportedObjects: {}, | |
invoke: [Function], | |
invokeDbus: [Function], | |
mangle: [Function], | |
sendSignal: [Function], | |
sendError: [Function], | |
sendReply: [Function], | |
setMethodCallHandler: [Function], | |
exportInterface: [Function], | |
getService: [Function], | |
getObject: [Function], | |
getInterface: [Function], | |
addMatch: [Function], | |
removeMatch: [Function], | |
getId: [Function], | |
requestName: [Function], | |
releaseName: [Function], | |
listNames: [Function], | |
listActivatableNames: [Function], | |
updateActivationEnvironment: [Function], | |
startServiceByName: [Function], | |
getConnectionUnixUser: [Function], | |
getConnectionUnixProcessId: [Function], | |
getNameOwner: [Function], | |
nameHasOwner: [Function] }, | |
getObject: [Function], | |
getInterface: [Function] }, | |
as: [Function] } | |
{ name: 'xml', type: 's', direction: 'out' } | |
method: Introspect | |
{ name: 'properties', type: 'a{sv}', direction: 'out' } | |
method: GetProperties | |
{ name: 'adapter', type: 'o', direction: 'out' } | |
method: DefaultAdapter | |
{ name: 'pattern', type: 's', direction: 'in' } | |
{ name: 'adapter', type: 'o', direction: 'out' } | |
method: FindAdapter s | |
{ name: 'adapters', type: 'ao', direction: 'out' } | |
method: ListAdapters | |
============ signal: PropertyChanged | |
============ signal: AdapterAdded | |
============ signal: AdapterRemoved | |
============ signal: DefaultAdapterChanged | |
{ name: '/org/bluez/536/hci0', | |
service: | |
{ name: 'org.bluez', | |
bus: | |
{ connection: [Object], | |
serial: 4, | |
cookies: {}, | |
methodCallHandlers: {}, | |
signals: [Object], | |
exportedObjects: {}, | |
invoke: [Function], | |
invokeDbus: [Function], | |
mangle: [Function], | |
sendSignal: [Function], | |
sendError: [Function], | |
sendReply: [Function], | |
setMethodCallHandler: [Function], | |
exportInterface: [Function], | |
getService: [Function], | |
getObject: [Function], | |
getInterface: [Function], | |
addMatch: [Function], | |
removeMatch: [Function], | |
getId: [Function], | |
requestName: [Function], | |
releaseName: [Function], | |
listNames: [Function], | |
listActivatableNames: [Function], | |
updateActivationEnvironment: [Function], | |
startServiceByName: [Function], | |
getConnectionUnixUser: [Function], | |
getConnectionUnixProcessId: [Function], | |
getNameOwner: [Function], | |
nameHasOwner: [Function], | |
name: ':1.261' }, | |
getObject: [Function], | |
getInterface: [Function] }, | |
as: [Function] } | |
{ name: 'xml', type: 's', direction: 'out' } | |
method: Introspect | |
{ name: 'properties', type: 'a{sv}', direction: 'out' } | |
method: GetProperties | |
{ name: 'name', type: 's', direction: 'in' } | |
{ name: 'value', type: 'v', direction: 'in' } | |
method: SetProperty sv | |
method: RequestSession | |
method: ReleaseSession | |
method: StartDiscovery | |
method: StopDiscovery | |
{ name: 'devices', type: 'ao', direction: 'out' } | |
method: ListDevices | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'device', type: 'o', direction: 'out' } | |
method: CreateDevice s | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'agent', type: 'o', direction: 'in' } | |
{ name: 'capability', type: 's', direction: 'in' } | |
{ name: 'device', type: 'o', direction: 'out' } | |
method: CreatePairedDevice sos | |
{ name: 'address', type: 's', direction: 'in' } | |
method: CancelDeviceCreation s | |
{ name: 'device', type: 'o', direction: 'in' } | |
method: RemoveDevice o | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'device', type: 'o', direction: 'out' } | |
method: FindDevice s | |
{ name: 'agent', type: 'o', direction: 'in' } | |
{ name: 'capability', type: 's', direction: 'in' } | |
method: RegisterAgent os | |
{ name: 'agent', type: 'o', direction: 'in' } | |
method: UnregisterAgent o | |
============ signal: PropertyChanged | |
============ signal: DeviceCreated | |
============ signal: DeviceRemoved | |
============ signal: DeviceFound | |
============ signal: DeviceDisappeared | |
{ name: 'record', type: 's', direction: 'in' } | |
{ name: 'handle', type: 'u', direction: 'out' } | |
method: AddRecord s | |
{ name: 'handle', type: 'u', direction: 'in' } | |
{ name: 'record', type: 's', direction: 'in' } | |
method: UpdateRecord us | |
{ name: 'handle', type: 'u', direction: 'in' } | |
method: RemoveRecord u | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'handle', type: 'u', direction: 'in' } | |
method: RequestAuthorization su | |
method: CancelAuthorization | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'hash', type: 'ay', direction: 'in' } | |
{ name: 'randomizer', type: 'ay', direction: 'in' } | |
method: AddRemoteData sayay | |
{ name: 'address', type: 's', direction: 'in' } | |
method: RemoveRemoteData s | |
{ name: 'hash', type: 'ay', direction: 'out' } | |
{ name: 'randomizer', type: 'ay', direction: 'out' } | |
method: ReadLocalData | |
{ name: 'uuid', type: 's', direction: 'in' } | |
{ name: 'bridge', type: 's', direction: 'in' } | |
method: Register ss | |
{ name: 'uuid', type: 's', direction: 'in' } | |
method: Unregister s | |
{ name: 'pattern', type: 's', direction: 'in' } | |
{ name: 'address', type: 's', direction: 'in' } | |
{ name: 'path', type: 's', direction: 'out' } | |
method: CreateProxy ss | |
{ name: 'paths', type: 'as', direction: 'out' } | |
method: ListProxies | |
{ name: 'path', type: 's', direction: 'in' } | |
method: RemoveProxy s | |
============ signal: ProxyCreated | |
============ signal: ProxyRemoved | |
{ name: 'properties', type: 'a{sv}', direction: 'out' } | |
method: GetProperties | |
method: Disconnect | |
============ signal: PropertyChanged | |
{ name: 'endpoint', type: 'o', direction: 'in' } | |
{ name: 'properties', type: 'a{sv}', direction: 'in' } | |
method: RegisterEndpoint oa{sv} | |
{ name: 'endpoint', type: 'o', direction: 'in' } | |
method: UnregisterEndpoint o | |
{ name: 'player', type: 'o', direction: 'in' } | |
{ name: 'properties', type: 'a{sv}', direction: 'in' } | |
{ name: 'metadata', type: 'a{sv}', direction: 'in' } | |
method: RegisterPlayer oa{sv}a{sv} | |
{ name: 'player', type: 'o', direction: 'in' } | |
method: UnregisterPlayer o | |
properties = | |
[ [ '', [ [], [] ] ], | |
[ 'ess\u0000\u0001s\u0000\u0000\u0011\u0000\u0000\u000000:19:0E:11:28:17\u0000\u0000\u0000\u0004\u0000\u0000\u0000Name\u0000\u0001s\u0000\u0010\u0000\u0000\u0000mistry-desktop-0\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000Class\u0000\u0001u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000Powered\u0000\u0001b\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\u0000\u0000Discoverable\u0000\u0001b\u0000\u0000\u0000\u0000\u0000\b\u0000\u0000\u0000Pairable\u0000\u0001b\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0013\u0000\u0000\u0000DiscoverableTimeout\u0000\u0001u\u0000\u0000<\u0000\u0000\u0000\u000f\u0000\u0000\u0000PairableTimeout\u0000\u0001u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u0000\u0000Discovering\u0000\u0001b\u0000\u0000\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000Devices\u0000\u0002ao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000UUIDs\u0000\u0002as\u0000\u0000\u00009\u0002\u0000\u0000$\u0000\u0000\u000000001000-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u000000001001-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000112d-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u000000001112-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000111f-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000111e-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000110a-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000110b-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000110c-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u00000000110e-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u000000001103-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u000000001105-0000-1000-8000-00805f9b34fb\u0000\u0000\u0000\u0000$\u0000\u0000\u000000001106-0000-1000-8000-00805f9b', | |
[ [], [] ] ] ] | |
/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:28 | |
switch (tree.type) { | |
^ | |
TypeError: Cannot read property 'type' of undefined | |
at read (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:28:17) | |
at readElement (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:91:9) | |
at readStruct (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:104:5) | |
at /home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:71:9 | |
at Object.<anonymous> (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:180:17) | |
at Object.self.tap (/home/mistry/bluez/node_modules/dbus-native/node_modules/binary/index.js:191:12) | |
at Object.<anonymous> (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:177:53) | |
at Object.self.tap (/home/mistry/bluez/node_modules/dbus-native/node_modules/binary/index.js:191:12) | |
at readSimpleType (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:176:35) | |
at readVariant (/home/mistry/bluez/node_modules/dbus-native/lib/unmarshall.js:62:5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dbus = require('dbus-native'); | |
var systemBus = dbus.systemBus(); | |
var bluezService = systemBus.getService('org.bluez'); | |
bluezService.getInterface('/', 'org.bluez.Manager', function(err, managerInterface) { | |
managerInterface.DefaultAdapter(function(err, defaultAdapter) { | |
bluezService.getInterface(defaultAdapter, 'org.bluez.Adapter', function(err, defaultAdapterInterface) { | |
defaultAdapterInterface.GetProperties(function(err, properties) { | |
console.log('properties = '); | |
console.log(properties); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment