Closed rtholmes closed 9 years ago
@jcmurray Were you planning to extend the plugin more with some of your work with GATT?
It's a good question. This plugin originally stemmed from some work that I had done connecting Bluetooth Medical devices to BlackBerry 10 Cordova apps and I had implemented both SPP/RFCOMM legacy profiles as well as some Bluetooth LE profiles that some medical devices exposed via the GATT ( heart rate measurements, BP, and Oximeter etc. ). So, I have the code and the model works very nicely ... my dilemma was whether to include this in the existing plugin. BTLE has a large number of GATT profiles and I felt that adding these to the existing plugin would make it overly complex (the purpose of this is to help people learn how to use these technologies ) and become a bit of a Swiss Army knife which becomes unwieldy and difficult to use and maintain.
I suspect that it would be better to have another plugin that perhaps did HR, another for cycling cadence etc. -- I'll put it in my list of things to produce.
Yeah, I think it's better in the long run to separate plugins into separate groups. Perhaps based on major profile area - ie: we have simple SPP, maybe one focused on various GATT profiles that health and wearables might use?
@rtholmes Take a look at https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10-Cordova/SimpleBtLeHrPlugin added by #379. Does it do what you need?
Wow, works great @timwindsor ; thanks so much @jcmurray! This is awesome! Just a quick question: to add cadence, would you recommend just modifying the plugin and adding support for the additional profile, or would you recommend copying and adding the profile to a new plugin?
For the Cycling Speed and Cadence profile and for a code sample I'd probably clone the HRM plugin and replace the HRM specific parts by the Cadence parts -- 80-90%% of the plugin will be the same since it's really only the format of the characteristics and notification that will carry a different payload that would be different. You should be able to cookie-cutter it. Check out this earlier post on Cadence here: http://devblog.blackberry.com/2013/05/nfc-cadence-cascades/ -- you'll find all the necessary Cadence logic here as well https://github.com/blackberry/Cascades-Community-Samples/tree/master/CscMonitor .
The SimpleBtSppPlugin is a great proof of concept for working with bluetooth from Webworks. Is there any chance it could be extended to support GATT for non-chat applications, or would it be better to start from scratch?. For example, something that would work for the HR / Cadence scenarios here would be fantastic:
http://devblog.blackberry.com/2013/04/bluetooth-low-energy-and-the-internet-of-things/
http://devblog.blackberry.com/2013/05/nfc-cadence-cascades/