Commit Graph

15 Commits

Author SHA1 Message Date
Jaap van Ekris 6baf81b6f1
Improved consistency
Improved the consistency of the PM5 serial number
2023-04-24 15:12:48 +02:00
Abász e7c40873cd Fix HR battery level not showing (fixes: #132)
Fix the HR battery level not showing on the HR metric tile (ANT and BLE)
For ANT handle case when BatteryLevel is not present only BatteryStatus.
BLE devices do not necessarily send battery level with all HR broadcast so
read the battery level on connect.
2023-03-25 21:00:33 +01:00
Abász ee667d727a Prevent BLE HR monitor process crash (fixes: #135)
In case of an uncaught exception in the BLE HR child process the process
would crash and not restart. Add code to catch these uncaught exceptions
to prevent such crash and enable code to continue.
2023-03-25 21:00:33 +01:00
Abász aa3b39f86a Change PM5 serial to comply with C2 standards
The PM5 serial number should start with "43" (in line with consistent HW
and SW revision)
2023-02-12 22:55:26 +01:00
Abász 3f129ceec2 Add peripheral shutdown for app termination
In order to avoid errors with peripheral processes on the next startup
(e.g. ANT Stick getting stuck) graceful explicit shutdown of these is
necessary on app termination.
2023-02-12 22:52:02 +01:00
Abász 35303547e2 Fix error on simultaneous ANT peripheral startup
Move the peripheral startup sequence to an async function to ensure
proper startup order and to avoid multiple simultaneous calls to the
ANT stick causing app crash.
2023-02-12 22:40:16 +01:00
Abász 405bcab55a Code cleanup
Change logging level for the broadcast data of the ANT+ FE peripheral.
Fix callback signature mismatch in bleno `stopAdvertising()` method
2023-02-12 22:40:16 +01:00
Abász cd1ff3d001 Fix crash when peripheral mode changed too quickly
Add boolean guard flag to fix potential crash when user clicks the
peripheral change buttons without waiting for the first request to
complete in the GUI (i.e. clicks too quickly).
2023-02-12 22:40:16 +01:00
Abász 4f62b2322e Add ANT+ profile manager
- Implement an ANT+ profile manager similar to BLE
- Implement ANT+ Fitness Equipment profile to be able to broadcast data
- Add button to the UI to scroll through the ANT+ profiles
2023-02-12 22:40:16 +01:00
Abász e938f5d8a0 Fix app crash when bleMode is set to OFF initially
Add guard clauses to notifyMetric call if bleMode is off.
Set blePeripheral and hrmPeripheral to undefined to avoid repeated call
to destroy() (i.e. calling destroy() on an already destroyed peripheral)
2023-02-12 22:40:16 +01:00
Abász 3bb0229d3a Move to new ant-plus library
Move to a new, still maintained, ant-plus library that solves the
connection dropout issue experienced with the original when using HRM as
well as that provides a cleaner interface to manage the ANT device.
2023-02-12 22:40:16 +01:00
Abász 17d6a74332 Enable rotation of the heart rate monitor modes
Add button to the GUI so the user can switch between heart rate monitor
modes (BLE, ANT, OFF). Update peripheralManager to handle switching and
implement necessary changes to the structure of the peripheralManager.
2023-02-12 22:40:16 +01:00
Abász a3cd6e6f39 Add OFF mode to BLE peripheral and refactoring
Add OFF mode to be able to turn BLE advertisement off. Rename
switchPeripheralMode function to include BLE in order to be more
descriptive.
2023-02-12 22:40:16 +01:00
Abász 7ef338d856 Refactor heart rate peripherals
Refactor ANT manager to be a central class managing the ANT stick state.
This state could be used for future implementation of other ANT profiles
and the peripheralManager should be responsible for creating once needed
2023-02-12 22:40:16 +01:00
Abász 3edfe22434 Refactor and restructure peripheral related code
- Create a new main folder to include ANT and BLE
- Move peripheralManager with other files with shared information
- Refactor static notify characteristics
- Refactor code to be more uniform across the different peripherals
2023-02-12 22:40:16 +01:00