Add find-me LED locate on master and slaves via ESP-NOW.
UART FIND_ME (client_id 0 = local ring, >0 = unicast), ESPNOW_FIND_ME payload, CLI/dashboard buttons per slave. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,7 +25,8 @@ typedef enum _alox_MessageType {
|
||||
alox_MessageType_OTA_END = 18,
|
||||
alox_MessageType_OTA_STATUS = 19,
|
||||
alox_MessageType_OTA_START_ESPNOW = 20,
|
||||
alox_MessageType_OTA_SLAVE_PROGRESS = 21
|
||||
alox_MessageType_OTA_SLAVE_PROGRESS = 21,
|
||||
alox_MessageType_FIND_ME = 22
|
||||
} alox_MessageType;
|
||||
|
||||
/* Struct definitions */
|
||||
@@ -96,8 +97,8 @@ typedef struct _alox_EspNowUnicastTestResponse {
|
||||
uint32_t seq;
|
||||
} alox_EspNowUnicastTestResponse;
|
||||
|
||||
/* Host → device: LED ring display (progress bar, digit, clear, or blink).
|
||||
mode: 0=clear, 1=progress (0–100 %), 2=digit (0–10), 3=blink full ring. */
|
||||
/* Host → device: LED ring display (progress bar, digit, clear, blink, or find-me).
|
||||
mode: 0=clear, 1=progress (0–100 %), 2=digit (0–10), 3=blink full ring, 4=find-me (R/G/B ×3 @ full brightness). */
|
||||
typedef struct _alox_LedRingProgressRequest {
|
||||
uint32_t mode;
|
||||
/* * 0–100: fraction of ring LEDs to light (mode=progress) */
|
||||
@@ -122,6 +123,16 @@ typedef struct _alox_LedRingProgressResponse {
|
||||
uint32_t digit;
|
||||
} alox_LedRingProgressResponse;
|
||||
|
||||
/* * Host → master: find-me on local ring (client_id=0) or ESP-NOW unicast to one slave. */
|
||||
typedef struct _alox_EspNowFindMeRequest {
|
||||
uint32_t client_id;
|
||||
} alox_EspNowFindMeRequest;
|
||||
|
||||
typedef struct _alox_EspNowFindMeResponse {
|
||||
bool success;
|
||||
uint32_t client_id;
|
||||
} alox_EspNowFindMeResponse;
|
||||
|
||||
/* Host → device: begin UART OTA (erase inactive OTA slot; device replies OTA_STATUS). */
|
||||
typedef struct _alox_OtaStartPayload {
|
||||
uint32_t total_size;
|
||||
@@ -192,6 +203,8 @@ typedef struct _alox_UartMessage {
|
||||
alox_OtaSlaveProgressResponse ota_slave_progress_response;
|
||||
alox_LedRingProgressRequest led_ring_progress_request;
|
||||
alox_LedRingProgressResponse led_ring_progress_response;
|
||||
alox_EspNowFindMeRequest espnow_find_me_request;
|
||||
alox_EspNowFindMeResponse espnow_find_me_response;
|
||||
} payload;
|
||||
} alox_UartMessage;
|
||||
|
||||
@@ -202,8 +215,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_MessageType_MIN alox_MessageType_UNKNOWN
|
||||
#define _alox_MessageType_MAX alox_MessageType_OTA_SLAVE_PROGRESS
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_OTA_SLAVE_PROGRESS+1))
|
||||
#define _alox_MessageType_MAX alox_MessageType_FIND_ME
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_FIND_ME+1))
|
||||
|
||||
#define alox_UartMessage_type_ENUMTYPE alox_MessageType
|
||||
|
||||
@@ -225,6 +238,8 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -243,6 +258,8 @@ extern "C" {
|
||||
#define alox_EspNowUnicastTestResponse_init_default {0, 0}
|
||||
#define alox_LedRingProgressRequest_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_LedRingProgressResponse_init_default {0, 0, 0, 0}
|
||||
#define alox_EspNowFindMeRequest_init_default {0}
|
||||
#define alox_EspNowFindMeResponse_init_default {0, 0}
|
||||
#define alox_OtaStartPayload_init_default {0}
|
||||
#define alox_OtaPayload_init_default {0, {0, {0}}}
|
||||
#define alox_OtaEndPayload_init_default {0}
|
||||
@@ -264,6 +281,8 @@ extern "C" {
|
||||
#define alox_EspNowUnicastTestResponse_init_zero {0, 0}
|
||||
#define alox_LedRingProgressRequest_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_LedRingProgressResponse_init_zero {0, 0, 0, 0}
|
||||
#define alox_EspNowFindMeRequest_init_zero {0}
|
||||
#define alox_EspNowFindMeResponse_init_zero {0, 0}
|
||||
#define alox_OtaStartPayload_init_zero {0}
|
||||
#define alox_OtaPayload_init_zero {0, {0, {0}}}
|
||||
#define alox_OtaEndPayload_init_zero {0}
|
||||
@@ -315,6 +334,9 @@ extern "C" {
|
||||
#define alox_LedRingProgressResponse_mode_tag 2
|
||||
#define alox_LedRingProgressResponse_progress_tag 3
|
||||
#define alox_LedRingProgressResponse_digit_tag 4
|
||||
#define alox_EspNowFindMeRequest_client_id_tag 1
|
||||
#define alox_EspNowFindMeResponse_success_tag 1
|
||||
#define alox_EspNowFindMeResponse_client_id_tag 2
|
||||
#define alox_OtaStartPayload_total_size_tag 1
|
||||
#define alox_OtaPayload_seq_tag 1
|
||||
#define alox_OtaPayload_data_tag 2
|
||||
@@ -351,6 +373,8 @@ extern "C" {
|
||||
#define alox_UartMessage_ota_slave_progress_response_tag 16
|
||||
#define alox_UartMessage_led_ring_progress_request_tag 17
|
||||
#define alox_UartMessage_led_ring_progress_response_tag 18
|
||||
#define alox_UartMessage_espnow_find_me_request_tag 19
|
||||
#define alox_UartMessage_espnow_find_me_response_tag 20
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_UartMessage_FIELDLIST(X, a) \
|
||||
@@ -371,7 +395,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,espnow_unicast_test_response,payload
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,ota_slave_progress_request,payload.ota_slave_progress_request), 15) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,ota_slave_progress_response,payload.ota_slave_progress_response), 16) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,led_ring_progress_request,payload.led_ring_progress_request), 17) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,led_ring_progress_response,payload.led_ring_progress_response), 18)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,led_ring_progress_response,payload.led_ring_progress_response), 18) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,espnow_find_me_request,payload.espnow_find_me_request), 19) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,espnow_find_me_response,payload.espnow_find_me_response), 20)
|
||||
#define alox_UartMessage_CALLBACK NULL
|
||||
#define alox_UartMessage_DEFAULT NULL
|
||||
#define alox_UartMessage_payload_ack_payload_MSGTYPE alox_Ack
|
||||
@@ -391,6 +417,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,led_ring_progress_response,payload.l
|
||||
#define alox_UartMessage_payload_ota_slave_progress_response_MSGTYPE alox_OtaSlaveProgressResponse
|
||||
#define alox_UartMessage_payload_led_ring_progress_request_MSGTYPE alox_LedRingProgressRequest
|
||||
#define alox_UartMessage_payload_led_ring_progress_response_MSGTYPE alox_LedRingProgressResponse
|
||||
#define alox_UartMessage_payload_espnow_find_me_request_MSGTYPE alox_EspNowFindMeRequest
|
||||
#define alox_UartMessage_payload_espnow_find_me_response_MSGTYPE alox_EspNowFindMeResponse
|
||||
|
||||
#define alox_Ack_FIELDLIST(X, a) \
|
||||
|
||||
@@ -489,6 +517,17 @@ X(a, STATIC, SINGULAR, UINT32, digit, 4)
|
||||
#define alox_LedRingProgressResponse_CALLBACK NULL
|
||||
#define alox_LedRingProgressResponse_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowFindMeRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1)
|
||||
#define alox_EspNowFindMeRequest_CALLBACK NULL
|
||||
#define alox_EspNowFindMeRequest_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowFindMeResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, success, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 2)
|
||||
#define alox_EspNowFindMeResponse_CALLBACK NULL
|
||||
#define alox_EspNowFindMeResponse_DEFAULT NULL
|
||||
|
||||
#define alox_OtaStartPayload_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, total_size, 1)
|
||||
#define alox_OtaStartPayload_CALLBACK NULL
|
||||
@@ -551,6 +590,8 @@ extern const pb_msgdesc_t alox_EspNowUnicastTestRequest_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowUnicastTestResponse_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;
|
||||
extern const pb_msgdesc_t alox_EspNowFindMeResponse_msg;
|
||||
extern const pb_msgdesc_t alox_OtaStartPayload_msg;
|
||||
extern const pb_msgdesc_t alox_OtaPayload_msg;
|
||||
extern const pb_msgdesc_t alox_OtaEndPayload_msg;
|
||||
@@ -574,6 +615,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_EspNowUnicastTestResponse_fields &alox_EspNowUnicastTestResponse_msg
|
||||
#define alox_LedRingProgressRequest_fields &alox_LedRingProgressRequest_msg
|
||||
#define alox_LedRingProgressResponse_fields &alox_LedRingProgressResponse_msg
|
||||
#define alox_EspNowFindMeRequest_fields &alox_EspNowFindMeRequest_msg
|
||||
#define alox_EspNowFindMeResponse_fields &alox_EspNowFindMeResponse_msg
|
||||
#define alox_OtaStartPayload_fields &alox_OtaStartPayload_msg
|
||||
#define alox_OtaPayload_fields &alox_OtaPayload_msg
|
||||
#define alox_OtaEndPayload_fields &alox_OtaEndPayload_msg
|
||||
@@ -594,6 +637,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_AccelDeadzoneResponse_size 20
|
||||
#define alox_Ack_size 0
|
||||
#define alox_ClientInput_size 22
|
||||
#define alox_EspNowFindMeRequest_size 6
|
||||
#define alox_EspNowFindMeResponse_size 8
|
||||
#define alox_EspNowUnicastTestRequest_size 12
|
||||
#define alox_EspNowUnicastTestResponse_size 8
|
||||
#define alox_LedRingProgressRequest_size 54
|
||||
|
||||
Reference in New Issue
Block a user