sandeepmistry / node-sensortag

Node.js lib for the TI SensorTag
MIT License
218 stars 111 forks source link

Is it necessary to call discoverServicesAndCharacteristics? #25

Closed bbirand closed 9 years ago

bbirand commented 9 years ago

Hi,

I'm playing around with this library, and things are working nicely. Following the example in test.js, I created a minimal script that calls connect, discoverServicesAndCharacteristics, enableIrTemperature and so on.

It seems like in order to call enableIrTemperature, I need to first call discoverServicesAndCharacteristics. This incorporates quite a bit of delay (roughly 5s). I understand that some of the characteristics will be different for each SensorTag. But for most operations, the characteristic IDs are known ahead of time.

Is it really necessary to call the discoverServicesAndCharacteristics for those cases?

sandeepmistry commented 9 years ago

@bbirand yes, you must call discoverServicesAndCharacteristics all the time.

On OS X, CoreBluetooth doesn't allow you to interact with services/characteristics without it. However, in OS X 10.9, it's a quicker since they are "cached".