cordova-plugin-ble-central
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 ?
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.
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 🙂