Add runtime UV protection toggle and treat near-zero sense as external power.
Per-pod NVS enable (default off) via UART/ESP-NOW/dashboard, and skip UV latch when LiPo ADC reads ~0 mV so USB/external supply still boots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -57,6 +57,9 @@ PB_BIND(alox_EspNowTapEvent, alox_EspNowTapEvent, AUTO)
|
||||
PB_BIND(alox_EspNowInputSendMode, alox_EspNowInputSendMode, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowBatteryUv, alox_EspNowBatteryUv, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_EspNowBatteryReport, alox_EspNowBatteryReport, AUTO)
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ typedef enum _alox_EspNowMessageType {
|
||||
/* * Master → slave: forget persisted master/id binding (debug reset). */
|
||||
alox_EspNowMessageType_ESPNOW_CLEAR_ID_BINDING = 23,
|
||||
/* * Master → slave: accel/tap ESP-NOW send path (best_effort/fast/wait/reliable). */
|
||||
alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE = 24
|
||||
alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE = 24,
|
||||
/* * Master → slave: enable/disable software LiPo UV protection (NVS). */
|
||||
alox_EspNowMessageType_ESPNOW_SET_BATTERY_UV = 25
|
||||
} alox_EspNowMessageType;
|
||||
|
||||
/* Struct definitions */
|
||||
@@ -161,6 +163,12 @@ typedef struct _alox_EspNowInputSendMode {
|
||||
uint32_t mode;
|
||||
} alox_EspNowInputSendMode;
|
||||
|
||||
/* * Master → slave: software LiPo UV protection enable (persisted in NVS). */
|
||||
typedef struct _alox_EspNowBatteryUv {
|
||||
uint32_t client_id; /* 0 = all slaves; otherwise only matching slave_id applies */
|
||||
bool enabled;
|
||||
} alox_EspNowBatteryUv;
|
||||
|
||||
/* * Slave → master: LiPo voltages (periodic ~30 s and on query). */
|
||||
typedef struct _alox_EspNowBatteryReport {
|
||||
uint32_t client_id;
|
||||
@@ -236,6 +244,7 @@ typedef struct _alox_EspNowMessage {
|
||||
alox_EspNowAssignId assign_id;
|
||||
alox_EspNowClearIdBinding clear_id_binding;
|
||||
alox_EspNowInputSendMode input_send_mode;
|
||||
alox_EspNowBatteryUv battery_uv;
|
||||
} payload;
|
||||
} alox_EspNowMessage;
|
||||
|
||||
@@ -246,8 +255,9 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_EspNowMessageType_MIN alox_EspNowMessageType_ESPNOW_UNKNOWN
|
||||
#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE
|
||||
#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE+1))
|
||||
#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_SET_BATTERY_UV
|
||||
#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_SET_BATTERY_UV+1))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -293,6 +303,7 @@ extern "C" {
|
||||
#define alox_EspNowTapConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowTapEvent_init_default {0, 0}
|
||||
#define alox_EspNowInputSendMode_init_default {0, 0}
|
||||
#define alox_EspNowBatteryUv_init_default {0, 0}
|
||||
#define alox_EspNowBatteryReport_init_default {0, 0, 0, 0, 0}
|
||||
#define alox_EspNowLedRing_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowOtaStart_init_default {0}
|
||||
@@ -317,6 +328,7 @@ extern "C" {
|
||||
#define alox_EspNowTapConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowTapEvent_init_zero {0, 0}
|
||||
#define alox_EspNowInputSendMode_init_zero {0, 0}
|
||||
#define alox_EspNowBatteryUv_init_zero {0, 0}
|
||||
#define alox_EspNowBatteryReport_init_zero {0, 0, 0, 0, 0}
|
||||
#define alox_EspNowLedRing_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_EspNowOtaStart_init_zero {0}
|
||||
@@ -370,6 +382,8 @@ extern "C" {
|
||||
#define alox_EspNowTapEvent_kind_tag 2
|
||||
#define alox_EspNowInputSendMode_client_id_tag 1
|
||||
#define alox_EspNowInputSendMode_mode_tag 2
|
||||
#define alox_EspNowBatteryUv_client_id_tag 1
|
||||
#define alox_EspNowBatteryUv_enabled_tag 2
|
||||
#define alox_EspNowBatteryReport_client_id_tag 1
|
||||
#define alox_EspNowBatteryReport_lipo1_valid_tag 2
|
||||
#define alox_EspNowBatteryReport_lipo2_valid_tag 3
|
||||
@@ -416,6 +430,7 @@ extern "C" {
|
||||
#define alox_EspNowMessage_assign_id_tag 23
|
||||
#define alox_EspNowMessage_clear_id_binding_tag 24
|
||||
#define alox_EspNowMessage_input_send_mode_tag 25
|
||||
#define alox_EspNowMessage_battery_uv_tag 26
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_EspNowUnicastTest_FIELDLIST(X, a) \
|
||||
@@ -531,6 +546,12 @@ X(a, STATIC, SINGULAR, UINT32, mode, 2)
|
||||
#define alox_EspNowInputSendMode_CALLBACK NULL
|
||||
#define alox_EspNowInputSendMode_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowBatteryUv_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 2)
|
||||
#define alox_EspNowBatteryUv_CALLBACK NULL
|
||||
#define alox_EspNowBatteryUv_DEFAULT NULL
|
||||
|
||||
#define alox_EspNowBatteryReport_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, lipo1_valid, 2) \
|
||||
@@ -602,7 +623,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,echo_pong,payload.echo_pong), 21) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,tap_config,payload.tap_config), 22) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,assign_id,payload.assign_id), 23) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,clear_id_binding,payload.clear_id_binding), 24) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode,payload.input_send_mode), 25)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode,payload.input_send_mode), 25) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,battery_uv,payload.battery_uv), 26)
|
||||
#define alox_EspNowMessage_CALLBACK NULL
|
||||
#define alox_EspNowMessage_DEFAULT NULL
|
||||
#define alox_EspNowMessage_payload_discover_MSGTYPE alox_EspNowDiscover
|
||||
@@ -629,6 +651,7 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode,payload.input_send_m
|
||||
#define alox_EspNowMessage_payload_assign_id_MSGTYPE alox_EspNowAssignId
|
||||
#define alox_EspNowMessage_payload_clear_id_binding_MSGTYPE alox_EspNowClearIdBinding
|
||||
#define alox_EspNowMessage_payload_input_send_mode_MSGTYPE alox_EspNowInputSendMode
|
||||
#define alox_EspNowMessage_payload_battery_uv_MSGTYPE alox_EspNowBatteryUv
|
||||
|
||||
extern const pb_msgdesc_t alox_EspNowUnicastTest_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowEchoPing_msg;
|
||||
@@ -647,6 +670,7 @@ extern const pb_msgdesc_t alox_EspNowTapNotify_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowTapConfig_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowTapEvent_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowInputSendMode_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowBatteryUv_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowBatteryReport_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowLedRing_msg;
|
||||
extern const pb_msgdesc_t alox_EspNowOtaStart_msg;
|
||||
@@ -673,6 +697,7 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg;
|
||||
#define alox_EspNowTapConfig_fields &alox_EspNowTapConfig_msg
|
||||
#define alox_EspNowTapEvent_fields &alox_EspNowTapEvent_msg
|
||||
#define alox_EspNowInputSendMode_fields &alox_EspNowInputSendMode_msg
|
||||
#define alox_EspNowBatteryUv_fields &alox_EspNowBatteryUv_msg
|
||||
#define alox_EspNowBatteryReport_fields &alox_EspNowBatteryReport_msg
|
||||
#define alox_EspNowLedRing_fields &alox_EspNowLedRing_msg
|
||||
#define alox_EspNowOtaStart_fields &alox_EspNowOtaStart_msg
|
||||
@@ -691,6 +716,7 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg;
|
||||
#define alox_EspNowAssignId_size 6
|
||||
#define alox_EspNowBatteryQuery_size 6
|
||||
#define alox_EspNowBatteryReport_size 22
|
||||
#define alox_EspNowBatteryUv_size 8
|
||||
#define alox_EspNowClearIdBinding_size 0
|
||||
#define alox_EspNowDiscover_size 19
|
||||
#define alox_EspNowEchoPing_size 22
|
||||
|
||||
@@ -33,6 +33,8 @@ enum EspNowMessageType {
|
||||
ESPNOW_CLEAR_ID_BINDING = 23;
|
||||
/** Master → slave: accel/tap ESP-NOW send path (best_effort/fast/wait/reliable). */
|
||||
ESPNOW_SET_INPUT_SEND_MODE = 24;
|
||||
/** Master → slave: enable/disable software LiPo UV protection (NVS). */
|
||||
ESPNOW_SET_BATTERY_UV = 25;
|
||||
}
|
||||
|
||||
message EspNowUnicastTest {
|
||||
@@ -154,6 +156,12 @@ message EspNowInputSendMode {
|
||||
uint32 mode = 2;
|
||||
}
|
||||
|
||||
/** Master → slave: software LiPo UV protection enable (persisted in NVS). */
|
||||
message EspNowBatteryUv {
|
||||
uint32 client_id = 1; // 0 = all slaves; otherwise only matching slave_id applies
|
||||
bool enabled = 2;
|
||||
}
|
||||
|
||||
/** Slave → master: LiPo voltages (periodic ~30 s and on query). */
|
||||
message EspNowBatteryReport {
|
||||
uint32 client_id = 1;
|
||||
@@ -225,5 +233,6 @@ message EspNowMessage {
|
||||
EspNowAssignId assign_id = 23;
|
||||
EspNowClearIdBinding clear_id_binding = 24;
|
||||
EspNowInputSendMode input_send_mode = 25;
|
||||
EspNowBatteryUv battery_uv = 26;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,12 @@ PB_BIND(alox_InputSendModeRequest, alox_InputSendModeRequest, AUTO)
|
||||
PB_BIND(alox_InputSendModeResponse, alox_InputSendModeResponse, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_BatteryUvRequest, alox_BatteryUvRequest, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_BatteryUvResponse, alox_BatteryUvResponse, AUTO)
|
||||
|
||||
|
||||
PB_BIND(alox_BatteryStatusRequest, alox_BatteryStatusRequest, AUTO)
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,11 @@ typedef enum _alox_MessageType {
|
||||
/* *
|
||||
Host → master: get/set slave ESP-NOW send path for accel/tap
|
||||
(best_effort / fast / wait / reliable). */
|
||||
alox_MessageType_INPUT_SEND_MODE = 35
|
||||
alox_MessageType_INPUT_SEND_MODE = 35,
|
||||
/* *
|
||||
Host → master: get/set software LiPo UV protection enable (NVS per pod).
|
||||
client_id 0 = master; >0 = one slave; all_clients = master + every slave. */
|
||||
alox_MessageType_BATTERY_UV = 36
|
||||
} alox_MessageType;
|
||||
|
||||
/* *
|
||||
@@ -98,6 +102,8 @@ typedef struct _alox_ClientInfo {
|
||||
bool tap_notify_single;
|
||||
bool tap_notify_double;
|
||||
bool tap_notify_triple;
|
||||
/* * Master cache: software UV protection enabled on this slave (NVS on device). */
|
||||
bool uv_protection_enabled;
|
||||
} alox_ClientInfo;
|
||||
|
||||
typedef struct _alox_ClientInfoResponse {
|
||||
@@ -167,6 +173,23 @@ typedef struct _alox_InputSendModeResponse {
|
||||
uint32_t slaves_updated;
|
||||
} alox_InputSendModeResponse;
|
||||
|
||||
/* write=false: read UV enable; write=true: persist enable (and clear latch when disabling).
|
||||
client_id 0 = local master; >0 = one slave; all_clients = master + every registered slave. */
|
||||
typedef struct _alox_BatteryUvRequest {
|
||||
bool write;
|
||||
bool enabled;
|
||||
uint32_t client_id;
|
||||
bool all_clients;
|
||||
} alox_BatteryUvRequest;
|
||||
|
||||
typedef struct _alox_BatteryUvResponse {
|
||||
uint32_t client_id;
|
||||
bool success;
|
||||
bool enabled;
|
||||
bool latched;
|
||||
uint32_t slaves_updated;
|
||||
} alox_BatteryUvResponse;
|
||||
|
||||
/* * Host → master: read LiPo ADC voltages (master local and/or slaves via ESP-NOW). */
|
||||
typedef struct _alox_BatteryStatusRequest {
|
||||
/* * 0 = master only; >0 = one slave; ignored when all_clients */
|
||||
@@ -504,6 +527,8 @@ typedef struct _alox_UartMessage {
|
||||
alox_ClientIdMapResetResponse client_id_map_reset_response;
|
||||
alox_InputSendModeRequest input_send_mode_request;
|
||||
alox_InputSendModeResponse input_send_mode_response;
|
||||
alox_BatteryUvRequest battery_uv_request;
|
||||
alox_BatteryUvResponse battery_uv_response;
|
||||
} payload;
|
||||
} alox_UartMessage;
|
||||
|
||||
@@ -514,8 +539,8 @@ extern "C" {
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _alox_MessageType_MIN alox_MessageType_UNKNOWN
|
||||
#define _alox_MessageType_MAX alox_MessageType_INPUT_SEND_MODE
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_INPUT_SEND_MODE+1))
|
||||
#define _alox_MessageType_MAX alox_MessageType_BATTERY_UV
|
||||
#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_BATTERY_UV+1))
|
||||
|
||||
#define _alox_InputSendMode_MIN alox_InputSendMode_INPUT_SEND_BEST_EFFORT
|
||||
#define _alox_InputSendMode_MAX alox_InputSendMode_INPUT_SEND_RELIABLE
|
||||
@@ -549,6 +574,8 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define alox_TapEvent_kind_ENUMTYPE alox_TapKind
|
||||
|
||||
|
||||
@@ -587,7 +614,7 @@ extern "C" {
|
||||
#define alox_Ack_init_default {0}
|
||||
#define alox_EchoPayload_init_default {{{NULL}, NULL}}
|
||||
#define alox_VersionResponse_init_default {0, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define alox_ClientInfo_init_default {0, 0, 0, {{NULL}, NULL}, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_ClientInfo_init_default {0, 0, 0, {{NULL}, NULL}, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_ClientInfoResponse_init_default {{{NULL}, NULL}}
|
||||
#define alox_ClientInput_init_default {0, 0, 0, 0}
|
||||
#define alox_ClientInputResponse_init_default {{{NULL}, NULL}}
|
||||
@@ -597,6 +624,8 @@ extern "C" {
|
||||
#define alox_AccelStreamResponse_init_default {0, 0, 0, 0}
|
||||
#define alox_InputSendModeRequest_init_default {0, _alox_InputSendMode_MIN, 0, 0}
|
||||
#define alox_InputSendModeResponse_init_default {0, _alox_InputSendMode_MIN, 0, 0}
|
||||
#define alox_BatteryUvRequest_init_default {0, 0, 0, 0}
|
||||
#define alox_BatteryUvResponse_init_default {0, 0, 0, 0, 0}
|
||||
#define alox_BatteryStatusRequest_init_default {0, 0}
|
||||
#define alox_LipoReading_init_default {0, 0}
|
||||
#define alox_BatterySample_init_default {0, false, alox_LipoReading_init_default, false, alox_LipoReading_init_default, 0}
|
||||
@@ -638,7 +667,7 @@ extern "C" {
|
||||
#define alox_Ack_init_zero {0}
|
||||
#define alox_EchoPayload_init_zero {{{NULL}, NULL}}
|
||||
#define alox_VersionResponse_init_zero {0, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define alox_ClientInfo_init_zero {0, 0, 0, {{NULL}, NULL}, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_ClientInfo_init_zero {0, 0, 0, {{NULL}, NULL}, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define alox_ClientInfoResponse_init_zero {{{NULL}, NULL}}
|
||||
#define alox_ClientInput_init_zero {0, 0, 0, 0}
|
||||
#define alox_ClientInputResponse_init_zero {{{NULL}, NULL}}
|
||||
@@ -648,6 +677,8 @@ extern "C" {
|
||||
#define alox_AccelStreamResponse_init_zero {0, 0, 0, 0}
|
||||
#define alox_InputSendModeRequest_init_zero {0, _alox_InputSendMode_MIN, 0, 0}
|
||||
#define alox_InputSendModeResponse_init_zero {0, _alox_InputSendMode_MIN, 0, 0}
|
||||
#define alox_BatteryUvRequest_init_zero {0, 0, 0, 0}
|
||||
#define alox_BatteryUvResponse_init_zero {0, 0, 0, 0, 0}
|
||||
#define alox_BatteryStatusRequest_init_zero {0, 0}
|
||||
#define alox_LipoReading_init_zero {0, 0}
|
||||
#define alox_BatterySample_init_zero {0, false, alox_LipoReading_init_zero, false, alox_LipoReading_init_zero, 0}
|
||||
@@ -702,6 +733,7 @@ extern "C" {
|
||||
#define alox_ClientInfo_tap_notify_single_tag 9
|
||||
#define alox_ClientInfo_tap_notify_double_tag 10
|
||||
#define alox_ClientInfo_tap_notify_triple_tag 11
|
||||
#define alox_ClientInfo_uv_protection_enabled_tag 12
|
||||
#define alox_ClientInfoResponse_clients_tag 1
|
||||
#define alox_ClientInput_id_tag 1
|
||||
#define alox_ClientInput_lage_x_tag 2
|
||||
@@ -733,6 +765,15 @@ extern "C" {
|
||||
#define alox_InputSendModeResponse_mode_tag 2
|
||||
#define alox_InputSendModeResponse_client_id_tag 3
|
||||
#define alox_InputSendModeResponse_slaves_updated_tag 4
|
||||
#define alox_BatteryUvRequest_write_tag 1
|
||||
#define alox_BatteryUvRequest_enabled_tag 2
|
||||
#define alox_BatteryUvRequest_client_id_tag 3
|
||||
#define alox_BatteryUvRequest_all_clients_tag 4
|
||||
#define alox_BatteryUvResponse_client_id_tag 1
|
||||
#define alox_BatteryUvResponse_success_tag 2
|
||||
#define alox_BatteryUvResponse_enabled_tag 3
|
||||
#define alox_BatteryUvResponse_latched_tag 4
|
||||
#define alox_BatteryUvResponse_slaves_updated_tag 5
|
||||
#define alox_BatteryStatusRequest_client_id_tag 1
|
||||
#define alox_BatteryStatusRequest_all_clients_tag 2
|
||||
#define alox_LipoReading_valid_tag 1
|
||||
@@ -901,6 +942,8 @@ extern "C" {
|
||||
#define alox_UartMessage_client_id_map_reset_response_tag 43
|
||||
#define alox_UartMessage_input_send_mode_request_tag 44
|
||||
#define alox_UartMessage_input_send_mode_response_tag 45
|
||||
#define alox_UartMessage_battery_uv_request_tag 46
|
||||
#define alox_UartMessage_battery_uv_response_tag 47
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define alox_UartMessage_FIELDLIST(X, a) \
|
||||
@@ -944,7 +987,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,ble_stream_tick,payload.ble_stream_t
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_request,payload.client_id_map_reset_request), 42) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_response,payload.client_id_map_reset_response), 43) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_request,payload.input_send_mode_request), 44) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_response,payload.input_send_mode_response), 45)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_response,payload.input_send_mode_response), 45) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,battery_uv_request,payload.battery_uv_request), 46) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload,battery_uv_response,payload.battery_uv_response), 47)
|
||||
#define alox_UartMessage_CALLBACK NULL
|
||||
#define alox_UartMessage_DEFAULT NULL
|
||||
#define alox_UartMessage_payload_ack_payload_MSGTYPE alox_Ack
|
||||
@@ -987,6 +1032,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_response,payload.inp
|
||||
#define alox_UartMessage_payload_client_id_map_reset_response_MSGTYPE alox_ClientIdMapResetResponse
|
||||
#define alox_UartMessage_payload_input_send_mode_request_MSGTYPE alox_InputSendModeRequest
|
||||
#define alox_UartMessage_payload_input_send_mode_response_MSGTYPE alox_InputSendModeResponse
|
||||
#define alox_UartMessage_payload_battery_uv_request_MSGTYPE alox_BatteryUvRequest
|
||||
#define alox_UartMessage_payload_battery_uv_response_MSGTYPE alox_BatteryUvResponse
|
||||
|
||||
#define alox_Ack_FIELDLIST(X, a) \
|
||||
|
||||
@@ -1016,7 +1063,8 @@ X(a, STATIC, SINGULAR, UINT32, version, 7) \
|
||||
X(a, STATIC, SINGULAR, BOOL, accel_stream_enabled, 8) \
|
||||
X(a, STATIC, SINGULAR, BOOL, tap_notify_single, 9) \
|
||||
X(a, STATIC, SINGULAR, BOOL, tap_notify_double, 10) \
|
||||
X(a, STATIC, SINGULAR, BOOL, tap_notify_triple, 11)
|
||||
X(a, STATIC, SINGULAR, BOOL, tap_notify_triple, 11) \
|
||||
X(a, STATIC, SINGULAR, BOOL, uv_protection_enabled, 12)
|
||||
#define alox_ClientInfo_CALLBACK pb_default_field_callback
|
||||
#define alox_ClientInfo_DEFAULT NULL
|
||||
|
||||
@@ -1089,6 +1137,23 @@ X(a, STATIC, SINGULAR, UINT32, slaves_updated, 4)
|
||||
#define alox_InputSendModeResponse_CALLBACK NULL
|
||||
#define alox_InputSendModeResponse_DEFAULT NULL
|
||||
|
||||
#define alox_BatteryUvRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, write, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 2) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 3) \
|
||||
X(a, STATIC, SINGULAR, BOOL, all_clients, 4)
|
||||
#define alox_BatteryUvRequest_CALLBACK NULL
|
||||
#define alox_BatteryUvRequest_DEFAULT NULL
|
||||
|
||||
#define alox_BatteryUvResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, success, 2) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 3) \
|
||||
X(a, STATIC, SINGULAR, BOOL, latched, 4) \
|
||||
X(a, STATIC, SINGULAR, UINT32, slaves_updated, 5)
|
||||
#define alox_BatteryUvResponse_CALLBACK NULL
|
||||
#define alox_BatteryUvResponse_DEFAULT NULL
|
||||
|
||||
#define alox_BatteryStatusRequest_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, client_id, 1) \
|
||||
X(a, STATIC, SINGULAR, BOOL, all_clients, 2)
|
||||
@@ -1389,6 +1454,8 @@ extern const pb_msgdesc_t alox_AccelStreamRequest_msg;
|
||||
extern const pb_msgdesc_t alox_AccelStreamResponse_msg;
|
||||
extern const pb_msgdesc_t alox_InputSendModeRequest_msg;
|
||||
extern const pb_msgdesc_t alox_InputSendModeResponse_msg;
|
||||
extern const pb_msgdesc_t alox_BatteryUvRequest_msg;
|
||||
extern const pb_msgdesc_t alox_BatteryUvResponse_msg;
|
||||
extern const pb_msgdesc_t alox_BatteryStatusRequest_msg;
|
||||
extern const pb_msgdesc_t alox_LipoReading_msg;
|
||||
extern const pb_msgdesc_t alox_BatterySample_msg;
|
||||
@@ -1442,6 +1509,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg;
|
||||
#define alox_AccelStreamResponse_fields &alox_AccelStreamResponse_msg
|
||||
#define alox_InputSendModeRequest_fields &alox_InputSendModeRequest_msg
|
||||
#define alox_InputSendModeResponse_fields &alox_InputSendModeResponse_msg
|
||||
#define alox_BatteryUvRequest_fields &alox_BatteryUvRequest_msg
|
||||
#define alox_BatteryUvResponse_fields &alox_BatteryUvResponse_msg
|
||||
#define alox_BatteryStatusRequest_fields &alox_BatteryStatusRequest_msg
|
||||
#define alox_LipoReading_fields &alox_LipoReading_msg
|
||||
#define alox_BatterySample_fields &alox_BatterySample_msg
|
||||
@@ -1497,6 +1566,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_BatteryUvRequest_size 12
|
||||
#define alox_BatteryUvResponse_size 18
|
||||
#define alox_BleStreamTick_size 753
|
||||
#define alox_CacheClientAccel_size 26
|
||||
#define alox_CacheClientStatus_size 44
|
||||
|
||||
@@ -47,6 +47,11 @@ enum MessageType {
|
||||
* (best_effort / fast / wait / reliable).
|
||||
*/
|
||||
INPUT_SEND_MODE = 35;
|
||||
/**
|
||||
* Host → master: get/set software LiPo UV protection enable (NVS per pod).
|
||||
* client_id 0 = master; >0 = one slave; all_clients = master + every slave.
|
||||
*/
|
||||
BATTERY_UV = 36;
|
||||
}
|
||||
|
||||
message UartMessage {
|
||||
@@ -92,6 +97,8 @@ message UartMessage {
|
||||
ClientIdMapResetResponse client_id_map_reset_response = 43;
|
||||
InputSendModeRequest input_send_mode_request = 44;
|
||||
InputSendModeResponse input_send_mode_response = 45;
|
||||
BatteryUvRequest battery_uv_request = 46;
|
||||
BatteryUvResponse battery_uv_response = 47;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +129,8 @@ message ClientInfo {
|
||||
bool tap_notify_single = 9;
|
||||
bool tap_notify_double = 10;
|
||||
bool tap_notify_triple = 11;
|
||||
/** Master cache: software UV protection enabled on this slave (NVS on device). */
|
||||
bool uv_protection_enabled = 12;
|
||||
}
|
||||
|
||||
message ClientInfoResponse {
|
||||
@@ -202,6 +211,23 @@ message InputSendModeResponse {
|
||||
uint32 slaves_updated = 4;
|
||||
}
|
||||
|
||||
// write=false: read UV enable; write=true: persist enable (and clear latch when disabling).
|
||||
// client_id 0 = local master; >0 = one slave; all_clients = master + every registered slave.
|
||||
message BatteryUvRequest {
|
||||
bool write = 1;
|
||||
bool enabled = 2;
|
||||
uint32 client_id = 3;
|
||||
bool all_clients = 4;
|
||||
}
|
||||
|
||||
message BatteryUvResponse {
|
||||
uint32 client_id = 1;
|
||||
bool success = 2;
|
||||
bool enabled = 3;
|
||||
bool latched = 4;
|
||||
uint32 slaves_updated = 5;
|
||||
}
|
||||
|
||||
/** Host → master: read LiPo ADC voltages (master local and/or slaves via ESP-NOW). */
|
||||
message BatteryStatusRequest {
|
||||
/** 0 = master only; >0 = one slave; ignored when all_clients */
|
||||
|
||||
Reference in New Issue
Block a user