Add BMA456 tap detection with ESP-NOW notify and host snapshot API.

Slaves forward configured tap kinds to the master; goTool exposes CLI, dashboard, REST, and WebSocket with separate notify vs receive and 2s display cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 20:42:57 +02:00
co-authored by Cursor
parent 3cb0b5bbe9
commit a8d4d42920
34 changed files with 3138 additions and 241 deletions
+52
View File
@@ -25,6 +25,8 @@ enum MessageType {
ACCEL_SNAPSHOT = 24;
ACCEL_STREAM = 25;
BATTERY_STATUS = 26;
TAP_NOTIFY = 27;
TAP_SNAPSHOT = 28;
}
message UartMessage {
@@ -57,6 +59,10 @@ message UartMessage {
AccelStreamResponse accel_stream_response = 26;
BatteryStatusRequest battery_status_request = 27;
BatteryStatusResponse battery_status_response = 28;
TapNotifyRequest tap_notify_request = 29;
TapNotifyResponse tap_notify_response = 30;
TapSnapshotRequest tap_snapshot_request = 31;
TapSnapshotResponse tap_snapshot_response = 32;
}
}
@@ -83,6 +89,10 @@ message ClientInfo {
uint32 version = 7;
/** Master: ESP-NOW accel stream enabled for this slave. */
bool accel_stream_enabled = 8;
/** Master: ESP-NOW tap notify flags for this slave. */
bool tap_notify_single = 9;
bool tap_notify_double = 10;
bool tap_notify_triple = 11;
}
message ClientInfoResponse {
@@ -180,6 +190,48 @@ message AccelSnapshotResponse {
repeated AccelSample samples = 1 [(nanopb).max_count = 16];
}
/** Host → master: enable/disable tap ESP-NOW notify per slave (single/double/triple). */
message TapNotifyRequest {
bool write = 1;
uint32 client_id = 2;
bool all_clients = 3;
bool single = 4;
bool double_tap = 5;
bool triple = 6;
}
message TapNotifyResponse {
uint32 client_id = 1;
bool success = 2;
uint32 slaves_updated = 3;
bool single = 4;
bool double_tap = 5;
bool triple = 6;
}
enum TapKind {
TAP_NONE = 0;
TAP_SINGLE = 1;
TAP_DOUBLE = 2;
TAP_TRIPLE = 3;
}
/** Host → master: read cached tap events (discarded after reply or when age > 16 ms). */
message TapSnapshotRequest {
uint32 client_id = 1;
}
message TapEvent {
uint32 client_id = 1;
bool valid = 2;
TapKind kind = 3;
uint32 age_ms = 4;
}
message TapSnapshotResponse {
repeated TapEvent events = 1 [(nanopb).max_count = 16];
}
message EspNowUnicastTestRequest {
uint32 client_id = 1;
uint32 seq = 2;