Acknowledged

Fundamental flaw with native pairing

It is clear that Garmin wants apps to use native pairing with sensors and has created a SensorDelegate for this in system 5.1. In fact it is stated that this is *needed*. See https://developer.garmin.com/connect-iq/core-topics/pairing-wireless-devices/

But there is a problem, you cannot have two apps access the same sensor. So, what if you want to have an widget/glance and a datafield, in the same way we have for the tempe sensor, or simply two different apps for different purposes. This is not possible with the new native pairing.

If app A pairs a sensor, all the data associated with that paired sensor is private to that app.

If app B comes along and wants to access the same sensor, it has not way to know the sensor is already paired by app A. Sensor.getRegisteredSensors() does not return natively paired CIQ sensors, and even if it did, the associated data is private to app A and cannot be accessed by app B. If it was able to determine the sensor was already paired, it could potentially scan and get additional data itself, but that kind of defeats the object of the pairing process. And anyway, it cannot.

If app B instead tries to pair the same sensor using a unique name, it can be detected, but the watch (or other device) will not pair it a second time. If Sensor.notifyNewSensor() is called by app B for a sensor already paired by app A, the request is ignored and onPair() is never called. So, this is not an option.

So, it appears this process if fundamentally flawed if you want to have multiple apps using the same sensor.

Given it appears Garmin wants sensors to be paired at a device level, and I think this is a great enhancement, this is a serious problem.

Parents
  • But is that new? My DataField always had this problem. I have to explain users NOT to pair the ANT+ HRM strap in the system settings, because the the CIQ SDK can't see it. So I think for most apps it'll make sense to pair the new Garmin wat, and for the few apps where it doesn't make sense it still works the old way (minus the annoying popup) 

    But maybe this is fundamentally different for Bluetooth, especially for new sensors that implement secure connection (though I hope they can still fall back to old mode to be compatible with old devices - though this basically opens the gate for security attacks, like the bad guy forces the sensor to think the device only supports the old protocol, though maybe it can be ok if the sensor doesn't allow itself to do that if it's already paired to another device)

Comment
  • But is that new? My DataField always had this problem. I have to explain users NOT to pair the ANT+ HRM strap in the system settings, because the the CIQ SDK can't see it. So I think for most apps it'll make sense to pair the new Garmin wat, and for the few apps where it doesn't make sense it still works the old way (minus the annoying popup) 

    But maybe this is fundamentally different for Bluetooth, especially for new sensors that implement secure connection (though I hope they can still fall back to old mode to be compatible with old devices - though this basically opens the gate for security attacks, like the bad guy forces the sensor to think the device only supports the old protocol, though maybe it can be ok if the sensor doesn't allow itself to do that if it's already paired to another device)

Children