Add CACHE_STATUS UART poll and dashboard live stream.
Combine cached accel and tap in one low-overhead master command for ~16 ms host polling. The dashboard uses a single live-stream toggle plus per-slave accel-stream controls; fix live_stream state so polling is not cleared every slow client refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,6 +22,7 @@ idf_component_register(
|
||||
"cmd/cmd_accel_stream.c"
|
||||
"cmd/cmd_tap_notify.c"
|
||||
"cmd/cmd_tap_snapshot.c"
|
||||
"cmd/cmd_cache_status.c"
|
||||
"cmd/cmd_espnow_unicast_test.c"
|
||||
"cmd/cmd_espnow_find_me.c"
|
||||
"cmd/cmd_restart.c"
|
||||
|
||||
@@ -225,6 +225,7 @@ Host and master speak nanopb-encoded `UartMessage` inside UART frames (byte 0 =
|
||||
| 24 | `ACCEL_SNAPSHOT` | Implemented (`cmd/cmd_accel_snapshot.c`) — cached slave accel from ESP-NOW stream |
|
||||
| 27 | `TAP_NOTIFY` | Implemented (`cmd/cmd_tap_notify.c`) — get/set which tap kinds notify via ESP-NOW |
|
||||
| 28 | `TAP_SNAPSHOT` | Implemented (`cmd/cmd_tap_snapshot.c`) — consume cached tap events from master registry |
|
||||
| 29 | `CACHE_STATUS` | Implemented (`cmd/cmd_cache_status.c`) — combined accel + tap cache in one UART round-trip |
|
||||
|
||||
Regenerate C code:
|
||||
|
||||
@@ -367,6 +368,17 @@ go run . -port /dev/ttyUSB0 tap-notify -client 16
|
||||
|
||||
Read **cached** tap events on the **master** (one pending event per slave). Slaves send `ESPNOW_TAP_EVENT` on tap; the master stores the latest value per client in `client_registry.c` for up to **16 ms** (`CLIENT_REGISTRY_TAP_MAX_AGE_MS`). Each snapshot **consumes** fresh events (cleared after read).
|
||||
|
||||
### CACHE_STATUS command
|
||||
|
||||
Fast combined poll for host tools at **16 ms** or faster: one UART frame, no request body (command id `0x1d` only).
|
||||
|
||||
**Response:** `cache_status_response` with:
|
||||
|
||||
- `accel[]` — same as `ACCEL_SNAPSHOT`, only clients with `accel_stream_enabled`
|
||||
- `taps[]` — same as `TAP_SNAPSHOT`, only clients with any tap notify flag; pending taps are consumed
|
||||
|
||||
The master walks `client_registry` once per request (`cmd/cmd_cache_status.c`). Prefer this over separate `ACCEL_SNAPSHOT` + `TAP_SNAPSHOT` when polling both streams.
|
||||
|
||||
Only slaves with at least one tap-notify flag enabled are included.
|
||||
|
||||
**Request:** framed `1c` (`0x1c`) + optional `tap_snapshot_request` (`client_id`: `0` = all, `>0` = one id).
|
||||
@@ -555,6 +567,7 @@ Target: ESP32-S3. Close serial monitor on the UART adapter port before running `
|
||||
| `cmd/cmd_accel_snapshot.c` | UART `ACCEL_SNAPSHOT` — cached slave accel |
|
||||
| `cmd/cmd_tap_notify.c` | UART `TAP_NOTIFY` — ESP-NOW tap notify config |
|
||||
| `cmd/cmd_tap_snapshot.c` | UART `TAP_SNAPSHOT` — consume cached tap events |
|
||||
| `cmd/cmd_cache_status.c` | UART `CACHE_STATUS` — combined accel + tap cache poll |
|
||||
| `board_input.c/h` | Taster GPIO12, LiPo ADC on GPIO1 / GPIO12 |
|
||||
| `pod_settings.c/h` | NVS persistence (accel deadzone, …) |
|
||||
| `led_ring.c/h` | LED ring (digit display, progress bar) |
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
#include "client_registry.h"
|
||||
#include "cmd_cache_status.h"
|
||||
#include "uart_cmd.h"
|
||||
|
||||
static const char *TAG = "[CACHE_STAT]";
|
||||
|
||||
static bool tap_notify_any(const client_info_t *client) {
|
||||
return client != NULL &&
|
||||
(client->tap_notify_single || client->tap_notify_double ||
|
||||
client->tap_notify_triple);
|
||||
}
|
||||
|
||||
static alox_TapKind tap_kind_from_registry(uint32_t kind) {
|
||||
switch (kind) {
|
||||
case 1:
|
||||
return alox_TapKind_TAP_SINGLE;
|
||||
case 2:
|
||||
return alox_TapKind_TAP_DOUBLE;
|
||||
case 3:
|
||||
return alox_TapKind_TAP_TRIPLE;
|
||||
default:
|
||||
return alox_TapKind_TAP_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_cache_status(alox_CacheStatusResponse *out) {
|
||||
if (out == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
out->accel_count = 0;
|
||||
out->taps_count = 0;
|
||||
|
||||
size_t count = client_registry_count();
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
const client_info_t *client = client_registry_at(i);
|
||||
if (client == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (client->accel_stream_enabled &&
|
||||
out->accel_count < sizeof(out->accel) / sizeof(out->accel[0])) {
|
||||
alox_AccelSample *sample = &out->accel[out->accel_count++];
|
||||
sample->client_id = client->id;
|
||||
sample->valid = client->accel_valid;
|
||||
sample->x = client->accel_x;
|
||||
sample->y = client->accel_y;
|
||||
sample->z = client->accel_z;
|
||||
if (client->accel_valid) {
|
||||
sample->age_ms = client_registry_ms_since(client->accel_updated_at);
|
||||
}
|
||||
}
|
||||
|
||||
if (tap_notify_any(client) &&
|
||||
out->taps_count < sizeof(out->taps) / sizeof(out->taps[0])) {
|
||||
uint32_t kind = 0;
|
||||
uint32_t age_ms = 0;
|
||||
if (!client_registry_take_tap(client->id, &kind, &age_ms)) {
|
||||
continue;
|
||||
}
|
||||
alox_TapEvent *event = &out->taps[out->taps_count++];
|
||||
event->client_id = client->id;
|
||||
event->valid = true;
|
||||
event->kind = tap_kind_from_registry(kind);
|
||||
event->age_ms = age_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_cache_status(const uint8_t *data, size_t len) {
|
||||
(void)data;
|
||||
(void)len;
|
||||
|
||||
alox_UartMessage response;
|
||||
uart_cmd_init_response(&response, alox_MessageType_CACHE_STATUS,
|
||||
alox_UartMessage_cache_status_response_tag);
|
||||
fill_cache_status(&response.payload.cache_status_response);
|
||||
uart_cmd_send(&response, TAG);
|
||||
}
|
||||
|
||||
void cmd_cache_status_register(void) {
|
||||
uart_cmd_register(alox_MessageType_CACHE_STATUS, handle_cache_status);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void cmd_cache_status_register(void);
|
||||
@@ -58,6 +58,8 @@ static const char *message_type_name(uint16_t id) {
|
||||
return "TAP_NOTIFY";
|
||||
case alox_MessageType_TAP_SNAPSHOT:
|
||||
return "TAP_SNAPSHOT";
|
||||
case alox_MessageType_CACHE_STATUS:
|
||||
return "CACHE_STATUS";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "cmd_accel_stream.h"
|
||||
#include "cmd_tap_notify.h"
|
||||
#include "cmd_tap_snapshot.h"
|
||||
#include "cmd_cache_status.h"
|
||||
#include "cmd_espnow_unicast_test.h"
|
||||
#include "cmd_espnow_find_me.h"
|
||||
#include "cmd_restart.h"
|
||||
@@ -186,6 +187,7 @@ void app_main(void) {
|
||||
cmd_accel_stream_register();
|
||||
cmd_tap_notify_register();
|
||||
cmd_tap_snapshot_register();
|
||||
cmd_cache_status_register();
|
||||
cmd_espnow_unicast_test_register();
|
||||
cmd_espnow_find_me_register();
|
||||
cmd_restart_register();
|
||||
|
||||
@@ -78,6 +78,12 @@ PB_BIND(alox_TapEvent, alox_TapEvent, AUTO)
|
||||
PB_BIND(alox_TapSnapshotResponse, alox_TapSnapshotResponse, 2)
|
||||
|
||||
|
||||
PB_BIND(alox_CacheStatusRequest, alox_CacheStatusRequest, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_CacheStatusResponse, alox_CacheStatusResponse, 2)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowUnicastTestRequest, alox_EspNowUnicastTestRequest, AUTO)
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ typedef enum _alox_MessageType {
|
||||
alox_MessageType_ACCEL_STREAM = 25,
|
||||
alox_MessageType_BATTERY_STATUS = 26,
|
||||
alox_MessageType_TAP_NOTIFY = 27,
|
||||
alox_MessageType_TAP_SNAPSHOT = 28
|
||||
alox_MessageType_TAP_SNAPSHOT = 28,
|
||||
/* * Combined cached accel + tap poll (one UART round-trip, ~16 ms cadence). */
|
||||
alox_MessageType_CACHE_STATUS = 29
|
||||
} alox_MessageType;
|
||||
|
||||
typedef enum _alox_TapKind {
|
||||
@@ -209,6 +211,20 @@ typedef struct _alox_TapSnapshotResponse {
|
||||
alox_TapEvent events[16];
|
||||
} alox_TapSnapshotResponse;
|
||||
|
||||
/* * Host → master: one-shot read of subscribed cached slave data (no request body). */
|
||||
typedef struct _alox_CacheStatusRequest {
|
||||
char dummy_field;
|
||||
} alox_CacheStatusRequest;
|
||||
|
||||
typedef struct _alox_CacheStatusResponse {
|
||||
/* * Slaves with accel_stream_enabled. */
|
||||
pb_size_t accel_count;
|
||||
alox_AccelSample accel[16];
|
||||
/* * Slaves with any tap notify flag; pending taps are consumed (like TAP_SNAPSHOT). */
|
||||
pb_size_t taps_count;
|
||||
alox_TapEvent taps[16];
|
||||
} alox_CacheStatusResponse;
|
||||
|
||||
typedef struct _alox_EspNowUnicastTestRequest {
|
||||
uint32_t client_id;
|
||||
uint32_t seq;
|
||||
@@ -357,6 +373,8 @@ typedef struct _alox_UartMessage {
|
||||
alox_TapNotifyResponse tap_notify_response;
|
||||
alox_TapSnapshotRequest tap_snapshot_request;
|
||||
alox_TapSnapshotResponse tap_snapshot_response;
|
||||
alox_CacheStatusRequest cache_status_request;
|
||||
alox_CacheStatusResponse cache_status_response;
|
||||
} payload;
|
||||
} alox_UartMessage;
|
||||
|
||||
@@ -367,8 +385,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_MessageType_MIN alox_MessageType_UNKNOWN
|
||||
#define _alox_MessageType_MAX alox_MessageType_TAP_SNAPSHOT
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_TAP_SNAPSHOT+1))
|
||||
#define _alox_MessageType_MAX alox_MessageType_CACHE_STATUS
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_CACHE_STATUS+1))
|
||||
|
||||
#define _alox_TapKind_MIN alox_TapKind_TAP_NONE
|
||||
#define _alox_TapKind_MAX alox_TapKind_TAP_TRIPLE
|
||||
@@ -416,6 +434,8 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define alox_UartMessage_init_default {_alox_MessageType_MIN, 0, {alox_Ack_init_default}}
|
||||
#define alox_Ack_init_default {0}
|
||||
@@ -441,6 +461,8 @@ extern "C" {
|
||||
#define alox_TapSnapshotRequest_init_default {0}
|
||||
#define alox_TapEvent_init_default {0, 0, _alox_TapKind_MIN, 0}
|
||||
#define alox_TapSnapshotResponse_init_default {0, {alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default}}
|
||||
#define alox_CacheStatusRequest_init_default {0}
|
||||
#define alox_CacheStatusResponse_init_default {0, {alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default, alox_AccelSample_init_default}, 0, {alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default, alox_TapEvent_init_default}}
|
||||
#define alox_EspNowUnicastTestRequest_init_default {0, 0}
|
||||
#define alox_EspNowUnicastTestResponse_init_default {0, 0}
|
||||
#define alox_LedRingProgressRequest_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
@@ -480,6 +502,8 @@ extern "C" {
|
||||
#define alox_TapSnapshotRequest_init_zero {0}
|
||||
#define alox_TapEvent_init_zero {0, 0, _alox_TapKind_MIN, 0}
|
||||
#define alox_TapSnapshotResponse_init_zero {0, {alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero}}
|
||||
#define alox_CacheStatusRequest_init_zero {0}
|
||||
#define alox_CacheStatusResponse_init_zero {0, {alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero, alox_AccelSample_init_zero}, 0, {alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero, alox_TapEvent_init_zero}}
|
||||
#define alox_EspNowUnicastTestRequest_init_zero {0, 0}
|
||||
#define alox_EspNowUnicastTestResponse_init_zero {0, 0}
|
||||
#define alox_LedRingProgressRequest_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
@@ -570,6 +594,8 @@ extern "C" {
|
||||
#define alox_TapEvent_kind_tag 3
|
||||
#define alox_TapEvent_age_ms_tag 4
|
||||
#define alox_TapSnapshotResponse_events_tag 1
|
||||
#define alox_CacheStatusResponse_accel_tag 1
|
||||
#define alox_CacheStatusResponse_taps_tag 2
|
||||
#define alox_EspNowUnicastTestRequest_client_id_tag 1
|
||||
#define alox_EspNowUnicastTestRequest_seq_tag 2
|
||||
#define alox_EspNowUnicastTestResponse_success_tag 1
|
||||
@@ -648,6 +674,8 @@ extern "C" {
|
||||
#define alox_UartMessage_tap_notify_response_tag 30
|
||||
#define alox_UartMessage_tap_snapshot_request_tag 31
|
||||
#define alox_UartMessage_tap_snapshot_response_tag 32
|
||||
#define alox_UartMessage_cache_status_request_tag 33
|
||||
#define alox_UartMessage_cache_status_response_tag 34
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_UartMessage_FIELDLIST(X, a) \
|
||||
@@ -682,7 +710,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,battery_status_response,payload.batt
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_notify_request,payload.tap_notify_request), 29) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_notify_response,payload.tap_notify_response), 30) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_snapshot_request,payload.tap_snapshot_request), 31) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_snapshot_response,payload.tap_snapshot_response), 32)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_snapshot_response,payload.tap_snapshot_response), 32) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,cache_status_request,payload.cache_status_request), 33) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,cache_status_response,payload.cache_status_response), 34)
|
||||
#define alox_UartMessage_CALLBACK NULL
|
||||
#define alox_UartMessage_DEFAULT NULL
|
||||
#define alox_UartMessage_payload_ack_payload_MSGTYPE alox_Ack
|
||||
@@ -716,6 +746,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,tap_snapshot_response,payload.tap_sn
|
||||
#define alox_UartMessage_payload_tap_notify_response_MSGTYPE alox_TapNotifyResponse
|
||||
#define alox_UartMessage_payload_tap_snapshot_request_MSGTYPE alox_TapSnapshotRequest
|
||||
#define alox_UartMessage_payload_tap_snapshot_response_MSGTYPE alox_TapSnapshotResponse
|
||||
#define alox_UartMessage_payload_cache_status_request_MSGTYPE alox_CacheStatusRequest
|
||||
#define alox_UartMessage_payload_cache_status_response_MSGTYPE alox_CacheStatusResponse
|
||||
|
||||
#define alox_Ack_FIELDLIST(X, a) \
|
||||
|
||||
@@ -890,6 +922,19 @@ X(a, STATIC, REPEATED, MESSAGE, events, 1)
|
||||
#define alox_TapSnapshotResponse_DEFAULT NULL
|
||||
#define alox_TapSnapshotResponse_events_MSGTYPE alox_TapEvent
|
||||
|
||||
#define alox_CacheStatusRequest_FIELDLIST(X, a) \
|
||||
|
||||
#define alox_CacheStatusRequest_CALLBACK NULL
|
||||
#define alox_CacheStatusRequest_DEFAULT NULL
|
||||
|
||||
#define alox_CacheStatusResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, REPEATED, MESSAGE, accel, 1) \
|
||||
X(a, STATIC, REPEATED, MESSAGE, taps, 2)
|
||||
#define alox_CacheStatusResponse_CALLBACK NULL
|
||||
#define alox_CacheStatusResponse_DEFAULT NULL
|
||||
#define alox_CacheStatusResponse_accel_MSGTYPE alox_AccelSample
|
||||
#define alox_CacheStatusResponse_taps_MSGTYPE alox_TapEvent
|
||||
|
||||
#define alox_EspNowUnicastTestRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, seq, 2)
|
||||
@@ -1022,6 +1067,8 @@ extern const pb_msgdesc_t alox_TapNotifyResponse_msg;
|
||||
extern const pb_msgdesc_t alox_TapSnapshotRequest_msg;
|
||||
extern const pb_msgdesc_t alox_TapEvent_msg;
|
||||
extern const pb_msgdesc_t alox_TapSnapshotResponse_msg;
|
||||
extern const pb_msgdesc_t alox_CacheStatusRequest_msg;
|
||||
extern const pb_msgdesc_t alox_CacheStatusResponse_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowUnicastTestRequest_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowUnicastTestResponse_msg;
|
||||
extern const pb_msgdesc_t alox_LedRingProgressRequest_msg;
|
||||
@@ -1063,6 +1110,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_TapSnapshotRequest_fields &alox_TapSnapshotRequest_msg
|
||||
#define alox_TapEvent_fields &alox_TapEvent_msg
|
||||
#define alox_TapSnapshotResponse_fields &alox_TapSnapshotResponse_msg
|
||||
#define alox_CacheStatusRequest_fields &alox_CacheStatusRequest_msg
|
||||
#define alox_CacheStatusResponse_fields &alox_CacheStatusResponse_msg
|
||||
#define alox_EspNowUnicastTestRequest_fields &alox_EspNowUnicastTestRequest_msg
|
||||
#define alox_EspNowUnicastTestResponse_fields &alox_EspNowUnicastTestResponse_msg
|
||||
#define alox_LedRingProgressRequest_fields &alox_LedRingProgressRequest_msg
|
||||
@@ -1086,7 +1135,7 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
/* alox_ClientInfo_size depends on runtime parameters */
|
||||
/* alox_ClientInfoResponse_size depends on runtime parameters */
|
||||
/* alox_ClientInputResponse_size depends on runtime parameters */
|
||||
#define ALOX_UART_MESSAGES_PB_H_MAX_SIZE alox_BatteryStatusResponse_size
|
||||
#define ALOX_UART_MESSAGES_PB_H_MAX_SIZE alox_CacheStatusResponse_size
|
||||
#define alox_AccelDeadzoneRequest_size 16
|
||||
#define alox_AccelDeadzoneResponse_size 20
|
||||
#define alox_AccelSample_size 32
|
||||
@@ -1098,6 +1147,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_BatterySample_size 32
|
||||
#define alox_BatteryStatusRequest_size 8
|
||||
#define alox_BatteryStatusResponse_size 580
|
||||
#define alox_CacheStatusRequest_size 0
|
||||
#define alox_CacheStatusResponse_size 832
|
||||
#define alox_ClientInput_size 22
|
||||
#define alox_EspNowFindMeRequest_size 6
|
||||
#define alox_EspNowFindMeResponse_size 8
|
||||
|
||||
@@ -27,6 +27,8 @@ enum MessageType {
|
||||
BATTERY_STATUS = 26;
|
||||
TAP_NOTIFY = 27;
|
||||
TAP_SNAPSHOT = 28;
|
||||
/** Combined cached accel + tap poll (one UART round-trip, ~16 ms cadence). */
|
||||
CACHE_STATUS = 29;
|
||||
}
|
||||
|
||||
message UartMessage {
|
||||
@@ -63,6 +65,8 @@ message UartMessage {
|
||||
TapNotifyResponse tap_notify_response = 30;
|
||||
TapSnapshotRequest tap_snapshot_request = 31;
|
||||
TapSnapshotResponse tap_snapshot_response = 32;
|
||||
CacheStatusRequest cache_status_request = 33;
|
||||
CacheStatusResponse cache_status_response = 34;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,6 +236,16 @@ message TapSnapshotResponse {
|
||||
repeated TapEvent events = 1 [(nanopb).max_count = 16];
|
||||
}
|
||||
|
||||
/** Host → master: one-shot read of subscribed cached slave data (no request body). */
|
||||
message CacheStatusRequest {}
|
||||
|
||||
message CacheStatusResponse {
|
||||
/** Slaves with accel_stream_enabled. */
|
||||
repeated AccelSample accel = 1 [(nanopb).max_count = 16];
|
||||
/** Slaves with any tap notify flag; pending taps are consumed (like TAP_SNAPSHOT). */
|
||||
repeated TapEvent taps = 2 [(nanopb).max_count = 16];
|
||||
}
|
||||
|
||||
message EspNowUnicastTestRequest {
|
||||
uint32 client_id = 1;
|
||||
uint32 seq = 2;
|
||||
|
||||
Reference in New Issue
Block a user