Added ECHO cmd and fixed some timing issues
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
PB_BIND(alox_EspNowUnicastTest, alox_EspNowUnicastTest, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowEchoPing, alox_EspNowEchoPing, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowEchoPong, alox_EspNowEchoPong, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowFindMe, alox_EspNowFindMe, AUTO)
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ typedef enum _alox_EspNowMessageType {
|
||||
alox_EspNowMessageType_ESPNOW_BATTERY_QUERY = 15,
|
||||
alox_EspNowMessageType_ESPNOW_BATTERY_REPORT = 16,
|
||||
alox_EspNowMessageType_ESPNOW_SET_TAP_NOTIFY = 17,
|
||||
alox_EspNowMessageType_ESPNOW_TAP_EVENT = 18
|
||||
alox_EspNowMessageType_ESPNOW_TAP_EVENT = 18,
|
||||
alox_EspNowMessageType_ESPNOW_ECHO_PING = 19,
|
||||
alox_EspNowMessageType_ESPNOW_ECHO_PONG = 20
|
||||
} alox_EspNowMessageType;
|
||||
|
||||
/* Struct definitions */
|
||||
@@ -37,6 +39,19 @@ typedef struct _alox_EspNowUnicastTest {
|
||||
uint32_t seq;
|
||||
} alox_EspNowUnicastTest;
|
||||
|
||||
/* * Master → slave: echo ping (host ts + master monotonic time for RTT). */
|
||||
typedef struct _alox_EspNowEchoPing {
|
||||
uint64_t host_timestamp_us;
|
||||
/* * esp_timer_get_time() (µs since boot) when master forwarded this message. */
|
||||
uint64_t master_time_us;
|
||||
} alox_EspNowEchoPing;
|
||||
|
||||
/* * Slave → master: echo ping payload unchanged. */
|
||||
typedef struct _alox_EspNowEchoPong {
|
||||
uint64_t host_timestamp_us;
|
||||
uint64_t master_time_us;
|
||||
} alox_EspNowEchoPong;
|
||||
|
||||
/* * Master → slave: locate pod (LED ring R/G/B ×3 @ full brightness). */
|
||||
typedef struct _alox_EspNowFindMe {
|
||||
/* * 0 = any slave; otherwise only slave_id must match */
|
||||
@@ -50,6 +65,8 @@ typedef struct _alox_EspNowRestart {
|
||||
|
||||
typedef struct _alox_EspNowDiscover {
|
||||
uint32_t network;
|
||||
/* * Master is in an OTA session (UART upload or ESP-NOW distribution). */
|
||||
bool master_ota_pending;
|
||||
} alox_EspNowDiscover;
|
||||
|
||||
typedef struct _alox_EspNowSlavePresence {
|
||||
@@ -169,6 +186,8 @@ typedef struct _alox_EspNowMessage {
|
||||
alox_EspNowBatteryReport battery_report;
|
||||
alox_EspNowTapNotify tap_notify;
|
||||
alox_EspNowTapEvent tap_event;
|
||||
alox_EspNowEchoPing echo_ping;
|
||||
alox_EspNowEchoPong echo_pong;
|
||||
} payload;
|
||||
} alox_EspNowMessage;
|
||||
|
||||
@@ -179,8 +198,10 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_EspNowMessageType_MIN alox_EspNowMessageType_ESPNOW_UNKNOWN
|
||||
#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_TAP_EVENT
|
||||
#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_TAP_EVENT+1))
|
||||
#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_ECHO_PONG
|
||||
#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_ECHO_PONG+1))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -204,9 +225,11 @@ extern "C" {
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define alox_EspNowUnicastTest_init_default {0}
|
||||
#define alox_EspNowEchoPing_init_default {0, 0}
|
||||
#define alox_EspNowEchoPong_init_default {0, 0}
|
||||
#define alox_EspNowFindMe_init_default {0}
|
||||
#define alox_EspNowRestart_init_default {0}
|
||||
#define alox_EspNowDiscover_init_default {0}
|
||||
#define alox_EspNowDiscover_init_default {0, 0}
|
||||
#define alox_EspNowSlavePresence_init_default {0, {{NULL}, NULL}, 0, 0, 0, 0}
|
||||
#define alox_EspNowAccelDeadzone_init_default {0, 0}
|
||||
#define alox_EspNowAccelStream_init_default {0, 0}
|
||||
@@ -222,9 +245,11 @@ extern "C" {
|
||||
#define alox_EspNowOtaStatus_init_default {0, 0, 0}
|
||||
#define alox_EspNowMessage_init_default {_alox_EspNowMessageType_MIN, 0, {alox_EspNowDiscover_init_default}}
|
||||
#define alox_EspNowUnicastTest_init_zero {0}
|
||||
#define alox_EspNowEchoPing_init_zero {0, 0}
|
||||
#define alox_EspNowEchoPong_init_zero {0, 0}
|
||||
#define alox_EspNowFindMe_init_zero {0}
|
||||
#define alox_EspNowRestart_init_zero {0}
|
||||
#define alox_EspNowDiscover_init_zero {0}
|
||||
#define alox_EspNowDiscover_init_zero {0, 0}
|
||||
#define alox_EspNowSlavePresence_init_zero {0, {{NULL}, NULL}, 0, 0, 0, 0}
|
||||
#define alox_EspNowAccelDeadzone_init_zero {0, 0}
|
||||
#define alox_EspNowAccelStream_init_zero {0, 0}
|
||||
@@ -242,9 +267,14 @@ extern "C" {
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define alox_EspNowUnicastTest_seq_tag 1
|
||||
#define alox_EspNowEchoPing_host_timestamp_us_tag 1
|
||||
#define alox_EspNowEchoPing_master_time_us_tag 2
|
||||
#define alox_EspNowEchoPong_host_timestamp_us_tag 1
|
||||
#define alox_EspNowEchoPong_master_time_us_tag 2
|
||||
#define alox_EspNowFindMe_client_id_tag 1
|
||||
#define alox_EspNowRestart_client_id_tag 1
|
||||
#define alox_EspNowDiscover_network_tag 1
|
||||
#define alox_EspNowDiscover_master_ota_pending_tag 2
|
||||
#define alox_EspNowSlavePresence_network_tag 1
|
||||
#define alox_EspNowSlavePresence_mac_tag 2
|
||||
#define alox_EspNowSlavePresence_version_tag 3
|
||||
@@ -306,6 +336,8 @@ extern "C" {
|
||||
#define alox_EspNowMessage_battery_report_tag 17
|
||||
#define alox_EspNowMessage_tap_notify_tag 18
|
||||
#define alox_EspNowMessage_tap_event_tag 19
|
||||
#define alox_EspNowMessage_echo_ping_tag 20
|
||||
#define alox_EspNowMessage_echo_pong_tag 21
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_EspNowUnicastTest_FIELDLIST(X, a) \
|
||||
@@ -313,6 +345,18 @@ X(a, STATIC, SINGULAR, UINT32, seq, 1)
|
||||
#define alox_EspNowUnicastTest_CALLBACK NULL
|
||||
#define alox_EspNowUnicastTest_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowEchoPing_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT64, host_timestamp_us, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT64, master_time_us, 2)
|
||||
#define alox_EspNowEchoPing_CALLBACK NULL
|
||||
#define alox_EspNowEchoPing_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowEchoPong_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT64, host_timestamp_us, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT64, master_time_us, 2)
|
||||
#define alox_EspNowEchoPong_CALLBACK NULL
|
||||
#define alox_EspNowEchoPong_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowFindMe_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1)
|
||||
#define alox_EspNowFindMe_CALLBACK NULL
|
||||
@@ -324,7 +368,8 @@ X(a, STATIC, SINGULAR, UINT32, client_id, 1)
|
||||
#define alox_EspNowRestart_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowDiscover_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, network, 1)
|
||||
X(a, STATIC, SINGULAR, UINT32, network, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, master_ota_pending, 2)
|
||||
#define alox_EspNowDiscover_CALLBACK NULL
|
||||
#define alox_EspNowDiscover_DEFAULT NULL
|
||||
|
||||
@@ -442,7 +487,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,led_ring,payload.led_ring), 15) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,battery_query,payload.battery_query), 16) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,battery_report,payload.battery_report), 17) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_notify,payload.tap_notify), 18) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_event,payload.tap_event), 19)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_event,payload.tap_event), 19) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,echo_ping,payload.echo_ping), 20) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,echo_pong,payload.echo_pong), 21)
|
||||
#define alox_EspNowMessage_CALLBACK NULL
|
||||
#define alox_EspNowMessage_DEFAULT NULL
|
||||
#define alox_EspNowMessage_payload_discover_MSGTYPE alox_EspNowDiscover
|
||||
@@ -463,8 +510,12 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,tap_event,payload.tap_event), 19)
|
||||
#define alox_EspNowMessage_payload_battery_report_MSGTYPE alox_EspNowBatteryReport
|
||||
#define alox_EspNowMessage_payload_tap_notify_MSGTYPE alox_EspNowTapNotify
|
||||
#define alox_EspNowMessage_payload_tap_event_MSGTYPE alox_EspNowTapEvent
|
||||
#define alox_EspNowMessage_payload_echo_ping_MSGTYPE alox_EspNowEchoPing
|
||||
#define alox_EspNowMessage_payload_echo_pong_MSGTYPE alox_EspNowEchoPong
|
||||
|
||||
extern const pb_msgdesc_t alox_EspNowUnicastTest_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowEchoPing_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowEchoPong_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowFindMe_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowRestart_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowDiscover_msg;
|
||||
@@ -485,6 +536,8 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define alox_EspNowUnicastTest_fields &alox_EspNowUnicastTest_msg
|
||||
#define alox_EspNowEchoPing_fields &alox_EspNowEchoPing_msg
|
||||
#define alox_EspNowEchoPong_fields &alox_EspNowEchoPong_msg
|
||||
#define alox_EspNowFindMe_fields &alox_EspNowFindMe_msg
|
||||
#define alox_EspNowRestart_fields &alox_EspNowRestart_msg
|
||||
#define alox_EspNowDiscover_fields &alox_EspNowDiscover_msg
|
||||
@@ -512,7 +565,9 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg;
|
||||
#define alox_EspNowAccelStream_size 8
|
||||
#define alox_EspNowBatteryQuery_size 6
|
||||
#define alox_EspNowBatteryReport_size 22
|
||||
#define alox_EspNowDiscover_size 6
|
||||
#define alox_EspNowDiscover_size 8
|
||||
#define alox_EspNowEchoPing_size 22
|
||||
#define alox_EspNowEchoPong_size 22
|
||||
#define alox_EspNowFindMe_size 6
|
||||
#define alox_EspNowLedRing_size 60
|
||||
#define alox_EspNowOtaEnd_size 0
|
||||
|
||||
@@ -24,12 +24,27 @@ enum EspNowMessageType {
|
||||
ESPNOW_BATTERY_REPORT = 16;
|
||||
ESPNOW_SET_TAP_NOTIFY = 17;
|
||||
ESPNOW_TAP_EVENT = 18;
|
||||
ESPNOW_ECHO_PING = 19;
|
||||
ESPNOW_ECHO_PONG = 20;
|
||||
}
|
||||
|
||||
message EspNowUnicastTest {
|
||||
uint32 seq = 1;
|
||||
}
|
||||
|
||||
/** Master → slave: echo ping (host ts + master monotonic time for RTT). */
|
||||
message EspNowEchoPing {
|
||||
uint64 host_timestamp_us = 1;
|
||||
/** esp_timer_get_time() (µs since boot) when master forwarded this message. */
|
||||
uint64 master_time_us = 2;
|
||||
}
|
||||
|
||||
/** Slave → master: echo ping payload unchanged. */
|
||||
message EspNowEchoPong {
|
||||
uint64 host_timestamp_us = 1;
|
||||
uint64 master_time_us = 2;
|
||||
}
|
||||
|
||||
/** Master → slave: locate pod (LED ring R/G/B ×3 @ full brightness). */
|
||||
message EspNowFindMe {
|
||||
/** 0 = any slave; otherwise only slave_id must match */
|
||||
@@ -43,6 +58,8 @@ message EspNowRestart {
|
||||
|
||||
message EspNowDiscover {
|
||||
uint32 network = 1;
|
||||
/** Master is in an OTA session (UART upload or ESP-NOW distribution). */
|
||||
bool master_ota_pending = 2;
|
||||
}
|
||||
|
||||
message EspNowSlavePresence {
|
||||
@@ -158,5 +175,7 @@ message EspNowMessage {
|
||||
EspNowBatteryReport battery_report = 17;
|
||||
EspNowTapNotify tap_notify = 18;
|
||||
EspNowTapEvent tap_event = 19;
|
||||
EspNowEchoPing echo_ping = 20;
|
||||
EspNowEchoPong echo_pong = 21;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,12 @@ PB_BIND(alox_EspNowUnicastTestRequest, alox_EspNowUnicastTestRequest, AUTO)
|
||||
PB_BIND(alox_EspNowUnicastTestResponse, alox_EspNowUnicastTestResponse, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowEchoPingRequest, alox_EspNowEchoPingRequest, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowEchoPingResponse, alox_EspNowEchoPingResponse, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_LedRingProgressRequest, alox_LedRingProgressRequest, AUTO)
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ typedef enum _alox_MessageType {
|
||||
alox_MessageType_BATTERY_STATUS = 26,
|
||||
alox_MessageType_TAP_NOTIFY = 27,
|
||||
/* * Combined cached accel + tap poll (one UART round-trip, ~16 ms cadence). */
|
||||
alox_MessageType_CACHE_STATUS = 29
|
||||
alox_MessageType_CACHE_STATUS = 29,
|
||||
/* * Host → master → slave → master: timestamp echo round-trip (latency test). */
|
||||
alox_MessageType_ESPNOW_ECHO_PING = 30
|
||||
} alox_MessageType;
|
||||
|
||||
typedef enum _alox_TapKind {
|
||||
@@ -235,6 +237,22 @@ typedef struct _alox_EspNowUnicastTestResponse {
|
||||
uint32_t seq;
|
||||
} alox_EspNowUnicastTestResponse;
|
||||
|
||||
/* * Host → master: ESP-NOW echo ping to one slave (timestamp echoed back). */
|
||||
typedef struct _alox_EspNowEchoPingRequest {
|
||||
uint32_t client_id;
|
||||
/* * Microseconds since Unix epoch (host clock). */
|
||||
uint64_t timestamp_us;
|
||||
} alox_EspNowEchoPingRequest;
|
||||
|
||||
typedef struct _alox_EspNowEchoPingResponse {
|
||||
bool success;
|
||||
uint32_t client_id;
|
||||
/* * Echoed host timestamp from goTool request. */
|
||||
uint64_t timestamp_us;
|
||||
/* * esp_timer_get_time() delta from ping send to pong recv (master→slave→master). */
|
||||
uint32_t esp_rtt_us;
|
||||
} alox_EspNowEchoPingResponse;
|
||||
|
||||
/* Host → master: LED ring on master (client_id=0) and/or slaves via ESP-NOW.
|
||||
mode: 0=clear, 1=progress (0–100 %), 2=digit (0–10), 3=blink, 4=find-me, 5=all LEDs solid color. */
|
||||
typedef struct _alox_LedRingProgressRequest {
|
||||
@@ -371,6 +389,8 @@ typedef struct _alox_UartMessage {
|
||||
alox_TapNotifyResponse tap_notify_response;
|
||||
alox_CacheStatusRequest cache_status_request;
|
||||
alox_CacheStatusResponse cache_status_response;
|
||||
alox_EspNowEchoPingRequest espnow_echo_ping_request;
|
||||
alox_EspNowEchoPingResponse espnow_echo_ping_response;
|
||||
} payload;
|
||||
} alox_UartMessage;
|
||||
|
||||
@@ -381,8 +401,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_MessageType_MIN alox_MessageType_UNKNOWN
|
||||
#define _alox_MessageType_MAX alox_MessageType_CACHE_STATUS
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_CACHE_STATUS+1))
|
||||
#define _alox_MessageType_MAX alox_MessageType_ESPNOW_ECHO_PING
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_ESPNOW_ECHO_PING+1))
|
||||
|
||||
#define _alox_TapKind_MIN alox_TapKind_TAP_NONE
|
||||
#define _alox_TapKind_MAX alox_TapKind_TAP_TRIPLE
|
||||
@@ -431,6 +451,8 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define alox_UartMessage_init_default {_alox_MessageType_MIN, 0, {alox_Ack_init_default}}
|
||||
@@ -460,6 +482,8 @@ extern "C" {
|
||||
#define alox_CacheStatusResponse_init_default {0, {alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default, alox_CacheClientStatus_init_default}}
|
||||
#define alox_EspNowUnicastTestRequest_init_default {0, 0}
|
||||
#define alox_EspNowUnicastTestResponse_init_default {0, 0}
|
||||
#define alox_EspNowEchoPingRequest_init_default {0, 0}
|
||||
#define alox_EspNowEchoPingResponse_init_default {0, 0, 0, 0}
|
||||
#define alox_LedRingProgressRequest_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_LedRingProgressResponse_init_default {0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowFindMeRequest_init_default {0}
|
||||
@@ -500,6 +524,8 @@ extern "C" {
|
||||
#define alox_CacheStatusResponse_init_zero {0, {alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero, alox_CacheClientStatus_init_zero}}
|
||||
#define alox_EspNowUnicastTestRequest_init_zero {0, 0}
|
||||
#define alox_EspNowUnicastTestResponse_init_zero {0, 0}
|
||||
#define alox_EspNowEchoPingRequest_init_zero {0, 0}
|
||||
#define alox_EspNowEchoPingResponse_init_zero {0, 0, 0, 0}
|
||||
#define alox_LedRingProgressRequest_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_LedRingProgressResponse_init_zero {0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowFindMeRequest_init_zero {0}
|
||||
@@ -599,6 +625,12 @@ extern "C" {
|
||||
#define alox_EspNowUnicastTestRequest_seq_tag 2
|
||||
#define alox_EspNowUnicastTestResponse_success_tag 1
|
||||
#define alox_EspNowUnicastTestResponse_seq_tag 2
|
||||
#define alox_EspNowEchoPingRequest_client_id_tag 1
|
||||
#define alox_EspNowEchoPingRequest_timestamp_us_tag 2
|
||||
#define alox_EspNowEchoPingResponse_success_tag 1
|
||||
#define alox_EspNowEchoPingResponse_client_id_tag 2
|
||||
#define alox_EspNowEchoPingResponse_timestamp_us_tag 3
|
||||
#define alox_EspNowEchoPingResponse_esp_rtt_us_tag 4
|
||||
#define alox_LedRingProgressRequest_mode_tag 1
|
||||
#define alox_LedRingProgressRequest_progress_tag 2
|
||||
#define alox_LedRingProgressRequest_digit_tag 3
|
||||
@@ -671,6 +703,8 @@ extern "C" {
|
||||
#define alox_UartMessage_tap_notify_response_tag 30
|
||||
#define alox_UartMessage_cache_status_request_tag 33
|
||||
#define alox_UartMessage_cache_status_response_tag 34
|
||||
#define alox_UartMessage_espnow_echo_ping_request_tag 35
|
||||
#define alox_UartMessage_espnow_echo_ping_response_tag 36
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_UartMessage_FIELDLIST(X, a) \
|
||||
@@ -703,7 +737,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,cache_status_request,payload.cache_status_request), 33) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,cache_status_response,payload.cache_status_response), 34)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,cache_status_response,payload.cache_status_response), 34) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,espnow_echo_ping_request,payload.espnow_echo_ping_request), 35) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,espnow_echo_ping_response,payload.espnow_echo_ping_response), 36)
|
||||
#define alox_UartMessage_CALLBACK NULL
|
||||
#define alox_UartMessage_DEFAULT NULL
|
||||
#define alox_UartMessage_payload_ack_payload_MSGTYPE alox_Ack
|
||||
@@ -735,6 +771,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,cache_status_response,payload.cache_
|
||||
#define alox_UartMessage_payload_tap_notify_response_MSGTYPE alox_TapNotifyResponse
|
||||
#define alox_UartMessage_payload_cache_status_request_MSGTYPE alox_CacheStatusRequest
|
||||
#define alox_UartMessage_payload_cache_status_response_MSGTYPE alox_CacheStatusResponse
|
||||
#define alox_UartMessage_payload_espnow_echo_ping_request_MSGTYPE alox_EspNowEchoPingRequest
|
||||
#define alox_UartMessage_payload_espnow_echo_ping_response_MSGTYPE alox_EspNowEchoPingResponse
|
||||
|
||||
#define alox_Ack_FIELDLIST(X, a) \
|
||||
|
||||
@@ -934,6 +972,20 @@ X(a, STATIC, SINGULAR, UINT32, seq, 2)
|
||||
#define alox_EspNowUnicastTestResponse_CALLBACK NULL
|
||||
#define alox_EspNowUnicastTestResponse_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowEchoPingRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT64, timestamp_us, 2)
|
||||
#define alox_EspNowEchoPingRequest_CALLBACK NULL
|
||||
#define alox_EspNowEchoPingRequest_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowEchoPingResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, success, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 2) \
|
||||
X(a, STATIC, SINGULAR, UINT64, timestamp_us, 3) \
|
||||
X(a, STATIC, SINGULAR, UINT32, esp_rtt_us, 4)
|
||||
#define alox_EspNowEchoPingResponse_CALLBACK NULL
|
||||
#define alox_EspNowEchoPingResponse_DEFAULT NULL
|
||||
|
||||
#define alox_LedRingProgressRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, mode, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, progress, 2) \
|
||||
@@ -1057,6 +1109,8 @@ extern const pb_msgdesc_t alox_CacheClientStatus_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_EspNowEchoPingRequest_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowEchoPingResponse_msg;
|
||||
extern const pb_msgdesc_t alox_LedRingProgressRequest_msg;
|
||||
extern const pb_msgdesc_t alox_LedRingProgressResponse_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowFindMeRequest_msg;
|
||||
@@ -1099,6 +1153,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_CacheStatusResponse_fields &alox_CacheStatusResponse_msg
|
||||
#define alox_EspNowUnicastTestRequest_fields &alox_EspNowUnicastTestRequest_msg
|
||||
#define alox_EspNowUnicastTestResponse_fields &alox_EspNowUnicastTestResponse_msg
|
||||
#define alox_EspNowEchoPingRequest_fields &alox_EspNowEchoPingRequest_msg
|
||||
#define alox_EspNowEchoPingResponse_fields &alox_EspNowEchoPingResponse_msg
|
||||
#define alox_LedRingProgressRequest_fields &alox_LedRingProgressRequest_msg
|
||||
#define alox_LedRingProgressResponse_fields &alox_LedRingProgressResponse_msg
|
||||
#define alox_EspNowFindMeRequest_fields &alox_EspNowFindMeRequest_msg
|
||||
@@ -1136,6 +1192,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_CacheStatusRequest_size 0
|
||||
#define alox_CacheStatusResponse_size 736
|
||||
#define alox_ClientInput_size 22
|
||||
#define alox_EspNowEchoPingRequest_size 17
|
||||
#define alox_EspNowEchoPingResponse_size 25
|
||||
#define alox_EspNowFindMeRequest_size 6
|
||||
#define alox_EspNowFindMeResponse_size 8
|
||||
#define alox_EspNowUnicastTestRequest_size 12
|
||||
|
||||
@@ -29,6 +29,8 @@ enum MessageType {
|
||||
reserved 28;
|
||||
/** Combined cached accel + tap poll (one UART round-trip, ~16 ms cadence). */
|
||||
CACHE_STATUS = 29;
|
||||
/** Host → master → slave → master: timestamp echo round-trip (latency test). */
|
||||
ESPNOW_ECHO_PING = 30;
|
||||
}
|
||||
|
||||
message UartMessage {
|
||||
@@ -63,6 +65,8 @@ message UartMessage {
|
||||
TapNotifyResponse tap_notify_response = 30;
|
||||
CacheStatusRequest cache_status_request = 33;
|
||||
CacheStatusResponse cache_status_response = 34;
|
||||
EspNowEchoPingRequest espnow_echo_ping_request = 35;
|
||||
EspNowEchoPingResponse espnow_echo_ping_response = 36;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +259,22 @@ message EspNowUnicastTestResponse {
|
||||
uint32 seq = 2;
|
||||
}
|
||||
|
||||
/** Host → master: ESP-NOW echo ping to one slave (timestamp echoed back). */
|
||||
message EspNowEchoPingRequest {
|
||||
uint32 client_id = 1;
|
||||
/** Microseconds since Unix epoch (host clock). */
|
||||
uint64 timestamp_us = 2;
|
||||
}
|
||||
|
||||
message EspNowEchoPingResponse {
|
||||
bool success = 1;
|
||||
uint32 client_id = 2;
|
||||
/** Echoed host timestamp from goTool request. */
|
||||
uint64 timestamp_us = 3;
|
||||
/** esp_timer_get_time() delta from ping send to pong recv (master→slave→master). */
|
||||
uint32 esp_rtt_us = 4;
|
||||
}
|
||||
|
||||
// Host → master: LED ring on master (client_id=0) and/or slaves via ESP-NOW.
|
||||
// mode: 0=clear, 1=progress (0–100 %), 2=digit (0–10), 3=blink, 4=find-me, 5=all LEDs solid color.
|
||||
message LedRingProgressRequest {
|
||||
|
||||
Reference in New Issue
Block a user