cordova-plugin-ble-central icon indicating copy to clipboard operation
cordova-plugin-ble-central copied to clipboard

How to create GATT server with CTS (Current Time Service) to broadcast this time from smartphone to the BLE device ?

Open Sebartus opened this issue 4 years ago • 1 comments

I am using this plugin to read data from BLE broadcast frame:

ble.scan([], 30, function(device) {
          
           decode: "advertising": /* ArrayBuffer or map */
                
}, function(failure){       
                
});

then I decode: "advertising": /* ArrayBuffer or map */ where part of decoded data is time in Epoch Time standard ( it is stored in that broadcast frame in Manufacturer Data with other data ). That time supports CTS. The application on the mobile phone ( android & ios ) should provide the CST (Current Time Service) characteristics but how to achieve it with this plugin ?

Thank you for any help or suggestions.

Sebartus avatar Jul 21 '21 14:07 Sebartus

Hello @Sebartus

Unfortunately, this plugin doesn't provide the capability to define a service and characteristic, as would be necessary to support the proper CTS workflow.

I have no real plans to add the feature, as it's doesn't seem straightforward to make this work properly cross-platform. If you do end up getting an implementation working, I'd certainly be interested in a PR to this effect 🙂

peitschie avatar Nov 20 '21 06:11 peitschie