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.
-
flocsy🤠
-
Cancel
-
Vote Up
0
Vote Down
-
-
More
-
Cancel
Comment-
flocsy🤠
-
Cancel
-
Vote Up
0
Vote Down
-
-
More
-
Cancel
Children