Most recent activity
-
-
The weirdest thing happened - when I enabled the sensors from my desktop browser (which triggers the device to stream sensor/gesture data), the CCCD's changed to
0x0100
(some are still0
, but the ones I need to be notified of changed to0x0100
).I'm still not getting notifications, but I'll keep playing with it.
-
-
It turns out the CCCD value for all the Notify characteristics are 0, which triggers the
"CCCD Handle Not Found"
error. I'm not sure if that's an invalid CCCD or it is but it triggers the error because0
is considered a false value. -
There was no
handle_cccd
property before, so I tried to set it manually viacharacteristic.hande_cccd = 0x1
.const BoseAR = { SERVICE_UUID: "0000fdd2-0000-1000-8000-00805f9b34fb", CHARACTERISTIC_UUIDs: { GESTURE_INFORMATION: "a0384f52-f95a-4bcd-b898-7b9ceec92dad", GESTURE_CONFIGURATION: "21e550af-f780-477b-9334-1f983296f1d7", GESTURE_DATA: "9014dd4e-79ba-4802-a275-894d3b85ac74", SENSOR_INFOMRATION: "855cb3e7-98ff-42a6-80fc-40b32a2221c1", SENSOR_CONFIGURATION: "5af38af6-000e-404b-9b46-07f77580890b", SENSOR_DATA: "56a72ab8-4988-4cc8-a752-fbd1d54a953d", }, GESTURE_IDs: { 129 : 'double tap', 130 : 'head nod', 131 : 'head shake', 192 : 'unknown gesture 192', 193 : 'unknown gesture 193', 194 : 'unknown gesture 194', }, getGestureNameByGestureId: function (GESTURE_ID) { return this.GESTURE_IDs[GESTURE_ID]; }, getGestureIdByGestureName: function(GESTURE_NAME) { return Object.keys(this.GESTURE_IDs).find(GESTURE_ID => { return this.GESTURE_IDs[GESTURE_ID] == GESTURE_NAME; }); }, _ableGesture : function(gestureName, enabled) { const _gestureId = this.getGestureIdByGestureName(gestureName); if(this.isConnected()) { return this.characteristics.GESTURE_CONFIGURATION.readValue().then(dataView => { for(let offset = 0; offset < dataView.byteLength; offset+=2) { const gestureId = dataView.getUint8(offset); if(gestureId == _gestureId) { dataView.setUint8(offset+1, enabled); } } return this.characteristics.GESTURE_CONFIGURATION.writeValue(dataView.buffer); }); } }, enableGesture : function(gestureName) { return this._ableGesture(gestureName, true); }, disableGesture : function(gestureName) { return this._ableGesture(gestureName, false); }, SENSOR_NAMEs: [ 'accelerometer', 'gyroscope', 'rotation', 'game rotation' ], SENSOR_SAMPLE_PERIODs: [ 320, 160, 80, 40, 20 ], ACCURACY_NAMEs: [ 'unreliable', 'low', 'medium', 'high' ], connect: function() { return NRF.requestDevice({ filters: [{services: [this.SERVICE_UUID]}], }).then(device => { this.device = device; return device.gatt.connect(); }).then(server => { this.server = server; return server.startBonding(); }).then(() => { return this.server.getPrimaryService(this.SERVICE_UUID); }).then(service => { this.service = service; this.characteristics = {}; return Object.keys(this.CHARACTERISTIC_UUIDs).reduce((promise, CHARACTERISTIC_NAME) => { const CHARACTERISTIC_UUID = this.CHARACTERISTIC_UUIDs[CHARACTERISTIC_NAME]; return promise.then(() => { return this.service.getCharacteristic(CHARACTERISTIC_UUID).then(characteristic => { console.log(CHARACTERISTIC_NAME); this.characteristics[CHARACTERISTIC_NAME] = characteristic; switch(CHARACTERISTIC_NAME) { case 'GESTURE_INFORMATION': break; case 'GESTURE_CONFIGURATION': break; case 'GESTURE_DATA': break; case 'SENSOR_INFOMRATION': break; case 'SENSOR_CONFIGURATION': break; case 'SENSOR_DATA': break; default: break; } if(characteristic.properties.notify) { //characteristic.handle_cccd = 0x1; characteristic.on('characteristicvaluechanged', event => { console.log(event); }); return characteristic.startNotifications(); } }); }); }, Promise.resolve([])); }).then(() => { console.log("FINISHED"); }); }, isConnected : function() { return this.device && this.device.gatt && this.device.gatt.connected; }, disconnect : function() { if(this.isConnected()) { this.device.gatt.disconnect(); } }, }; BoseAR.connect();
-
I'm writing a port of the Bose AR Web SDK to Bangle.js. Right now I'm able to connect to the BLE device, get the service/characteristics and read/write values, but I get a
CCCD Handle not found
error when I runcharacteristic.startNotifications()
on the characteristics with thenotify
property.I looked it up and it seems to look for a
handle_cccd
property on the characteristic so I looked it up and found the cccd0x1
and assigned it to the characteristics'characteristic.handle_cccd
property, and the error stopped. However I still don't get any notifications when adding an eventListener viacharacteristic.on('characteristicvaluechanged', callback)
. -
Thanks for the help! (I work with @ukaton) You've been very helpful!
We were able to access the motion sensor and some of the pressure sensors and make a simple demo we posted over on Twitter:
https://twitter.com/ConcreteSciFi/status/1152324107427442688
However, due to the lack of support for the ESP32 atm, we think it's best to switch to another platform. We'd like to use a lot more features on the ESP32, and we'll definitely switch back to Espruino in the future when appropriate. We love what your platform stands for.
https://hackaday.io/project/165333-missions-the-sole-of-mission-st