You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Garmin speed & cadence sensors, and they have nothing in their location field AFAICT.
However, they are named, i.e. SPD-BLE0XXXXXX.
If I'm reading it right, the code will only listen to a sensor which has "Wheel" in its location. While I might be able to write that to the device, would it be possible detect which sensor is which based on the device name as well?
The text was updated successfully, but these errors were encountered:
Not all sensors implement all the characteristics defined in BLE spec. the BLE CSCP spec defines the location characteristic as optional. I don't have a Garmin sensor to test this with, but I'd believe you if you said that the Garmin sensors don't implement the "location" characteristic (which seems to be what you are saying).
It's been a while since I've looked at this code. I believe that when the thread corresponding to each sensor is started, it reads the "location" characteristic from the sensor and stores this in a variable. This is done in the line self._location = sensor.get_location() within CSCTrainer.worker(). It shouldn't be too hard to change this behavior.
Implementation would be easier if the user just defined the location of each sensors based on its address (eg. D0:AC:A5:BF:B7:52), rather than reading the name, which I suppose is another characteristic (but I'm not sure about this). This would be only slightly more complex for the user to set up, compared with using the name, since the user has to figure out the address of the sensor anyways, and as long as you're figuring this out one sensor at a time, you'll know which one is in which location of your bike.
I'd be happy to receive a PR to allow the user to either manually set the location of each sensor, or for the user to specify location based on the name of the sensor (eg. SPD-BLE0xxxxx), rather than relying on reading the "location" characteristic from the sensor. I'd just ask that if the user doesn't somehow specify the sensor locations, that program continues to read the location characteristic from the sensor.
I have Garmin speed & cadence sensors, and they have nothing in their location field AFAICT.
However, they are named, i.e. SPD-BLE0XXXXXX.
If I'm reading it right, the code will only listen to a sensor which has "Wheel" in its location. While I might be able to write that to the device, would it be possible detect which sensor is which based on the device name as well?
The text was updated successfully, but these errors were encountered: