add reliable BLE telemetry transport
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#define TRIKKE_WIRE_HEADER_SIZE 36
|
||||
#define TRIKKE_WIRE_SAMPLE_RECORD_SIZE 20
|
||||
#define TRIKKE_WIRE_METADATA_SIZE 48
|
||||
#define TRIKKE_WIRE_STATUS_SIZE 32
|
||||
#define TRIKKE_WIRE_MAX_RECORDS 8
|
||||
#define TRIKKE_WIRE_MAX_PACKET_SIZE \
|
||||
(TRIKKE_WIRE_HEADER_SIZE + \
|
||||
@@ -15,6 +16,7 @@
|
||||
|
||||
#define TRIKKE_PACKET_TYPE_METADATA 1
|
||||
#define TRIKKE_PACKET_TYPE_SAMPLES 2
|
||||
#define TRIKKE_PACKET_TYPE_STATUS 3
|
||||
|
||||
#define TRIKKE_PACKET_FLAG_TIMESTAMP_DELTA_SATURATED 0x01
|
||||
#define TRIKKE_WIRE_TIMESTAMP_DELTA_UNIT_US 10
|
||||
@@ -50,6 +52,16 @@ typedef struct {
|
||||
float gyro_mdps_per_lsb;
|
||||
} trikke_wire_metadata_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t sensor_read_failure_count;
|
||||
uint32_t queue_overflow_count;
|
||||
uint32_t transport_begin_retry_count;
|
||||
uint32_t transport_disconnect_count;
|
||||
uint32_t transport_send_failure_count;
|
||||
uint32_t transport_replay_count;
|
||||
uint32_t transport_invalid_ack_count;
|
||||
} trikke_wire_status_t;
|
||||
|
||||
bool trikke_wire_timestamp_delta_fits(
|
||||
int64_t previous_timestamp_us,
|
||||
int64_t timestamp_us);
|
||||
@@ -71,3 +83,12 @@ size_t trikke_encode_sample_packet(
|
||||
uint32_t loop_overrun_count,
|
||||
const trikke_wire_sample_t *samples,
|
||||
size_t sample_count);
|
||||
|
||||
size_t trikke_encode_status_packet(
|
||||
uint8_t *output,
|
||||
size_t output_size,
|
||||
uint32_t packet_sequence,
|
||||
int64_t timestamp_us,
|
||||
uint32_t dropped_sample_count,
|
||||
uint32_t loop_overrun_count,
|
||||
const trikke_wire_status_t *status);
|
||||
|
||||
Reference in New Issue
Block a user