Midnight4577
Member since Apr 2022 • Last active Apr 2022Most recent activity
-
- 3 comments
- 562 views
-
I've been trying to create a custom BLE peripheral service with one characteristic which is writable through the NRF Connect app. Even though I have advertised it I can't seem to find the characteristic. Currently my code should create a service with the UUID of
f46b0001-b5bd-11ec-b909-0242ac120002
which has a characteristic with the UUID off46b0002-b5bd-11ec-b909-0242ac120002
and that holds the writable value42
.My code is as follows::
Bangle.loadWidgets(); Bangle.drawWidgets(); //f46b0001-b5bd-11ec-b909-0242ac120002 NRF.setServices({ 'f46b0001-b5bd-11ec-b909-0242ac120002': { 'f46b0002-b5bd-11ec-b909-0242ac120002' : { value : [42], description : "The Answer", readable: true, writable: true, onWrite : function() { Bangle.buzz(0.5, 1); } } } }, { uart : false, // optional, default is true. Enable BLE UART support advertise: [ 'f46b0001-b5bd-11ec-b909-0242ac120002'], // optional, list of service UUIDs to advertise ancs : false, // optional, Bangle.js-only, enable Apple ANCS support for notifications ams : false // optional, Bangle.js-only, enable Apple AMS support for media control });
I am on a iOS phone. I turned the Bluetooth off and back on as you suggested and everything works perfectly.
Thanks