starryalley / CSC_BLE_Bridge

Android app that bridges ANT+ Cycling Speed/Cadence/HR sensors as Bluetooth LE sensors
MIT License
68 stars 17 forks source link

Add in support for multiple ANT+ devices of the same type #20

Closed michaelrhughes closed 3 years ago

michaelrhughes commented 3 years ago

This is a big one 😄

My wife's device keeps on pairing and I have to run upstairs to pair my footpod 🤣. To support multiple ANT+ devices I needed to do a lot of refactoring. If you feel this should be a fork instead of a PR let me know. Normally I would do this in a series of smaller PRs but I was low on time for this one.

Motivations for this PR:

Disclaimers:

New Code Organization:

Adding a new Sensor

To add a new sensor you should be able to: 1) Add a new AntDevice, Add a new AntDeviceConnector 2) Add a new BleServiceType with all the BLE specific stuff, add it to the list of serviceTypes 3) Hook the two up between AntToBleBridge 4) No need to add UI or worry about lifecycle of Pcc or BLE

ScreenShots

You can see only one of the Stride SDM devices is broadcasting to BLE right now:

Screenshot_20210218-212250_CSC_BLE_Bridge

The updated Stop button:

Screenshot_20210218-212307_CSC_BLE_Bridge

starryalley commented 3 years ago

Awesome PR. I had to find some time to digest this but really appreciated your work!! Thank you!!

leaskovski commented 3 years ago

Do we know if this awesome PR is going to get accepted any time soon?

starryalley commented 3 years ago

Oh my goodness I completely forgot this. Merged.