Skip to content

Instantly share code, notes, and snippets.

@jacobrosenthal
Created September 28, 2015 22:06
Show Gist options
  • Save jacobrosenthal/0cff7544c46346573e56 to your computer and use it in GitHub Desktop.
Save jacobrosenthal/0cff7544c46346573e56 to your computer and use it in GitHub Desktop.
Bleno Battery OSX (yosemite) bindings
^CJacobs-MacBook-Air:bleno jacobrosenthalDEBUG=bindings node examples/battery-service/main.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1443477764659",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
bindings xpcEvent: {
"kCBMsgId": 6,
"kCBMsgArgs": {
"kCBMsgArgState": 5
}
} +4ms
bindings state change poweredOn +2ms
on -> stateChange: poweredOn
bindings sendCBMsg: 8, {
"kCBAdvDataLocalName": "Battery",
"kCBAdvDataServiceUUIDs": [
{
"type": "Buffer",
"data": [
24,
15
]
}
]
} +4ms
bindings xpcEvent: {
"kCBMsgId": 16,
"kCBMsgArgs": {
"kCBMsgArgResult": 0
}
} +6ms
on -> advertisingStart: success
bindings sendCBMsg: 12, null +2ms
bindings sendCBMsg: 10, {
"kCBMsgArgAttributeID": 1,
"kCBMsgArgAttributeIDs": [],
"kCBMsgArgCharacteristics": [
{
"kCBMsgArgAttributeID": 2,
"kCBMsgArgAttributePermissions": 1,
"kCBMsgArgCharacteristicProperties": 2,
"kCBMsgArgData": null,
"kCBMsgArgDescriptors": [
{
"kCBMsgArgData": "Battery level between 0 and 100 percent",
"kCBMsgArgUUID": {
"type": "Buffer",
"data": [
41,
1
]
}
},
{
"kCBMsgArgData": {
"type": "Buffer",
"data": [
4,
1,
39,
173,
1,
0,
0
]
},
"kCBMsgArgUUID": {
"type": "Buffer",
"data": [
41,
4
]
}
}
],
"kCBMsgArgUUID": {
"type": "Buffer",
"data": [
42,
25
]
}
}
],
"kCBMsgArgType": 1,
"kCBMsgArgUUID": {
"type": "Buffer",
"data": [
24,
15
]
}
} +1ms
bindings xpcEvent: {
"kCBMsgId": 18,
"kCBMsgArgs": {
"kCBMsgArgAttributeID": 1,
"kCBMsgArgResult": 27
}
} +1ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment