Add reliable Android BLE ride recorder

This commit is contained in:
Jay
2026-08-20 12:40:39 -04:00
parent 3bad2275cc
commit 6e408a3048
40 changed files with 2781 additions and 120 deletions
+15
View File
@@ -10,6 +10,7 @@ extern "C" {
#define TRIKKE_BLE_FRAGMENT_HEADER_SIZE 8
#define TRIKKE_BLE_ACK_SIZE 8
#define TRIKKE_BLE_BEGIN_SESSION_SIZE 12
// BLE data notifications carry a little-endian packet sequence, byte offset,
// total TRK1 frame size, then the frame bytes at that offset. The unchanged
@@ -29,6 +30,20 @@ bool trikke_ble_decode_ack(
size_t ack_size,
uint32_t *packet_sequence);
// A session begin is ASCII "BGN1" followed by a receiver-generated uint64
// token. Repeating the same token is idempotent across BLE reconnects.
bool trikke_ble_decode_begin_session(
const uint8_t *command,
size_t command_size,
uint64_t *session_token);
// Notification delivery is active only after both the CCCD and session
// authorization are ready. Returns true when the effective state changes.
bool trikke_ble_update_subscription(
bool notify_enabled,
bool session_connection_ready,
bool *subscribed);
#ifdef __cplusplus
}
#endif