/* Automatically generated nanopb header */ /* Generated by nanopb-1.0.0-dev */ #ifndef PB_ALOX_ESP_NOW_MESSAGES_PB_H_INCLUDED #define PB_ALOX_ESP_NOW_MESSAGES_PB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif /* Enum definitions */ typedef enum _alox_EspNowMessageType { alox_EspNowMessageType_ESPNOW_UNKNOWN = 0, alox_EspNowMessageType_ESPNOW_DISCOVER = 1, alox_EspNowMessageType_ESPNOW_SLAVE_INFO = 2, alox_EspNowMessageType_ESPNOW_HEARTBEAT = 3, alox_EspNowMessageType_ESPNOW_SET_ACCEL_DEADZONE = 4, alox_EspNowMessageType_ESPNOW_UNICAST_TEST = 5, alox_EspNowMessageType_ESPNOW_OTA_START = 6, alox_EspNowMessageType_ESPNOW_OTA_PAYLOAD = 7, alox_EspNowMessageType_ESPNOW_OTA_END = 8, alox_EspNowMessageType_ESPNOW_OTA_STATUS = 9, alox_EspNowMessageType_ESPNOW_FIND_ME = 10, alox_EspNowMessageType_ESPNOW_RESTART = 11, alox_EspNowMessageType_ESPNOW_ACCEL_SAMPLE = 12, alox_EspNowMessageType_ESPNOW_SET_ACCEL_STREAM = 13 } alox_EspNowMessageType; /* Struct definitions */ typedef struct _alox_EspNowUnicastTest { uint32_t seq; } alox_EspNowUnicastTest; /* * 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 */ uint32_t client_id; } alox_EspNowFindMe; /* * Master → slave: reboot after short delay. */ typedef struct _alox_EspNowRestart { uint32_t client_id; } alox_EspNowRestart; typedef struct _alox_EspNowDiscover { uint32_t network; } alox_EspNowDiscover; typedef struct _alox_EspNowSlavePresence { uint32_t network; pb_callback_t mac; uint32_t version; uint32_t slave_id; bool available; bool used; } alox_EspNowSlavePresence; typedef struct _alox_EspNowAccelDeadzone { uint32_t deadzone; uint32_t client_id; /* 0 = all slaves; otherwise only matching slave_id applies */ } alox_EspNowAccelDeadzone; /* * Master → slave: enable/disable periodic accel ESP-NOW stream (~16 ms). */ typedef struct _alox_EspNowAccelStream { bool enable; uint32_t client_id; } alox_EspNowAccelStream; /* * Slave → master: latest BMA456 sample (sent ~every 16 ms). */ typedef struct _alox_EspNowAccelSample { uint32_t slave_id; int32_t x; int32_t y; int32_t z; } alox_EspNowAccelSample; /* Master → slave: begin OTA (erase inactive slot; slave replies ESPNOW_OTA_STATUS). */ typedef struct _alox_EspNowOtaStart { uint32_t total_size; } alox_EspNowOtaStart; typedef PB_BYTES_ARRAY_T(200) alox_EspNowOtaPayload_data_t; /* Master → slave: firmware chunk (up to 200 bytes); slave buffers 4 KiB before flash write. */ typedef struct _alox_EspNowOtaPayload { uint32_t seq; alox_EspNowOtaPayload_data_t data; } alox_EspNowOtaPayload; /* Master → slave: finalize OTA (flush, esp_ota_end, set boot partition). */ typedef struct _alox_EspNowOtaEnd { char dummy_field; } alox_EspNowOtaEnd; /* Slave → master: status / block ACK (same status codes as UART OtaStatusPayload). */ typedef struct _alox_EspNowOtaStatus { uint32_t status; uint32_t bytes_written; uint32_t error; } alox_EspNowOtaStatus; typedef struct _alox_EspNowMessage { alox_EspNowMessageType type; pb_size_t which_payload; union _alox_EspNowMessage_payload { alox_EspNowDiscover discover; alox_EspNowSlavePresence slave_info; alox_EspNowSlavePresence heartbeat; alox_EspNowAccelDeadzone accel_deadzone; alox_EspNowUnicastTest unicast_test; alox_EspNowOtaStart ota_start; alox_EspNowOtaPayload ota_payload; alox_EspNowOtaEnd ota_end; alox_EspNowOtaStatus ota_status; alox_EspNowFindMe find_me; alox_EspNowRestart restart; alox_EspNowAccelSample accel_sample; alox_EspNowAccelStream accel_stream; } payload; } alox_EspNowMessage; #ifdef __cplusplus extern "C" { #endif /* Helper constants for enums */ #define _alox_EspNowMessageType_MIN alox_EspNowMessageType_ESPNOW_UNKNOWN #define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_SET_ACCEL_STREAM #define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_SET_ACCEL_STREAM+1)) #define alox_EspNowMessage_type_ENUMTYPE alox_EspNowMessageType /* Initializer values for message structs */ #define alox_EspNowUnicastTest_init_default {0} #define alox_EspNowFindMe_init_default {0} #define alox_EspNowRestart_init_default {0} #define alox_EspNowDiscover_init_default {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} #define alox_EspNowAccelSample_init_default {0, 0, 0, 0} #define alox_EspNowOtaStart_init_default {0} #define alox_EspNowOtaPayload_init_default {0, {0, {0}}} #define alox_EspNowOtaEnd_init_default {0} #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_EspNowFindMe_init_zero {0} #define alox_EspNowRestart_init_zero {0} #define alox_EspNowDiscover_init_zero {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} #define alox_EspNowAccelSample_init_zero {0, 0, 0, 0} #define alox_EspNowOtaStart_init_zero {0} #define alox_EspNowOtaPayload_init_zero {0, {0, {0}}} #define alox_EspNowOtaEnd_init_zero {0} #define alox_EspNowOtaStatus_init_zero {0, 0, 0} #define alox_EspNowMessage_init_zero {_alox_EspNowMessageType_MIN, 0, {alox_EspNowDiscover_init_zero}} /* Field tags (for use in manual encoding/decoding) */ #define alox_EspNowUnicastTest_seq_tag 1 #define alox_EspNowFindMe_client_id_tag 1 #define alox_EspNowRestart_client_id_tag 1 #define alox_EspNowDiscover_network_tag 1 #define alox_EspNowSlavePresence_network_tag 1 #define alox_EspNowSlavePresence_mac_tag 2 #define alox_EspNowSlavePresence_version_tag 3 #define alox_EspNowSlavePresence_slave_id_tag 4 #define alox_EspNowSlavePresence_available_tag 5 #define alox_EspNowSlavePresence_used_tag 6 #define alox_EspNowAccelDeadzone_deadzone_tag 1 #define alox_EspNowAccelDeadzone_client_id_tag 2 #define alox_EspNowAccelStream_enable_tag 1 #define alox_EspNowAccelStream_client_id_tag 2 #define alox_EspNowAccelSample_slave_id_tag 1 #define alox_EspNowAccelSample_x_tag 2 #define alox_EspNowAccelSample_y_tag 3 #define alox_EspNowAccelSample_z_tag 4 #define alox_EspNowOtaStart_total_size_tag 1 #define alox_EspNowOtaPayload_seq_tag 1 #define alox_EspNowOtaPayload_data_tag 2 #define alox_EspNowOtaStatus_status_tag 1 #define alox_EspNowOtaStatus_bytes_written_tag 2 #define alox_EspNowOtaStatus_error_tag 3 #define alox_EspNowMessage_type_tag 1 #define alox_EspNowMessage_discover_tag 2 #define alox_EspNowMessage_slave_info_tag 3 #define alox_EspNowMessage_heartbeat_tag 4 #define alox_EspNowMessage_accel_deadzone_tag 5 #define alox_EspNowMessage_unicast_test_tag 6 #define alox_EspNowMessage_ota_start_tag 7 #define alox_EspNowMessage_ota_payload_tag 8 #define alox_EspNowMessage_ota_end_tag 9 #define alox_EspNowMessage_ota_status_tag 10 #define alox_EspNowMessage_find_me_tag 11 #define alox_EspNowMessage_restart_tag 12 #define alox_EspNowMessage_accel_sample_tag 13 #define alox_EspNowMessage_accel_stream_tag 14 /* Struct field encoding specification for nanopb */ #define alox_EspNowUnicastTest_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, seq, 1) #define alox_EspNowUnicastTest_CALLBACK NULL #define alox_EspNowUnicastTest_DEFAULT NULL #define alox_EspNowFindMe_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, client_id, 1) #define alox_EspNowFindMe_CALLBACK NULL #define alox_EspNowFindMe_DEFAULT NULL #define alox_EspNowRestart_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, client_id, 1) #define alox_EspNowRestart_CALLBACK NULL #define alox_EspNowRestart_DEFAULT NULL #define alox_EspNowDiscover_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, network, 1) #define alox_EspNowDiscover_CALLBACK NULL #define alox_EspNowDiscover_DEFAULT NULL #define alox_EspNowSlavePresence_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, network, 1) \ X(a, CALLBACK, SINGULAR, BYTES, mac, 2) \ X(a, STATIC, SINGULAR, UINT32, version, 3) \ X(a, STATIC, SINGULAR, UINT32, slave_id, 4) \ X(a, STATIC, SINGULAR, BOOL, available, 5) \ X(a, STATIC, SINGULAR, BOOL, used, 6) #define alox_EspNowSlavePresence_CALLBACK pb_default_field_callback #define alox_EspNowSlavePresence_DEFAULT NULL #define alox_EspNowAccelDeadzone_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, deadzone, 1) \ X(a, STATIC, SINGULAR, UINT32, client_id, 2) #define alox_EspNowAccelDeadzone_CALLBACK NULL #define alox_EspNowAccelDeadzone_DEFAULT NULL #define alox_EspNowAccelStream_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enable, 1) \ X(a, STATIC, SINGULAR, UINT32, client_id, 2) #define alox_EspNowAccelStream_CALLBACK NULL #define alox_EspNowAccelStream_DEFAULT NULL #define alox_EspNowAccelSample_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, slave_id, 1) \ X(a, STATIC, SINGULAR, SINT32, x, 2) \ X(a, STATIC, SINGULAR, SINT32, y, 3) \ X(a, STATIC, SINGULAR, SINT32, z, 4) #define alox_EspNowAccelSample_CALLBACK NULL #define alox_EspNowAccelSample_DEFAULT NULL #define alox_EspNowOtaStart_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, total_size, 1) #define alox_EspNowOtaStart_CALLBACK NULL #define alox_EspNowOtaStart_DEFAULT NULL #define alox_EspNowOtaPayload_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, seq, 1) \ X(a, STATIC, SINGULAR, BYTES, data, 2) #define alox_EspNowOtaPayload_CALLBACK NULL #define alox_EspNowOtaPayload_DEFAULT NULL #define alox_EspNowOtaEnd_FIELDLIST(X, a) \ #define alox_EspNowOtaEnd_CALLBACK NULL #define alox_EspNowOtaEnd_DEFAULT NULL #define alox_EspNowOtaStatus_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, status, 1) \ X(a, STATIC, SINGULAR, UINT32, bytes_written, 2) \ X(a, STATIC, SINGULAR, UINT32, error, 3) #define alox_EspNowOtaStatus_CALLBACK NULL #define alox_EspNowOtaStatus_DEFAULT NULL #define alox_EspNowMessage_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, type, 1) \ X(a, STATIC, ONEOF, MESSAGE, (payload,discover,payload.discover), 2) \ X(a, STATIC, ONEOF, MESSAGE, (payload,slave_info,payload.slave_info), 3) \ X(a, STATIC, ONEOF, MESSAGE, (payload,heartbeat,payload.heartbeat), 4) \ X(a, STATIC, ONEOF, MESSAGE, (payload,accel_deadzone,payload.accel_deadzone), 5) \ X(a, STATIC, ONEOF, MESSAGE, (payload,unicast_test,payload.unicast_test), 6) \ X(a, STATIC, ONEOF, MESSAGE, (payload,ota_start,payload.ota_start), 7) \ X(a, STATIC, ONEOF, MESSAGE, (payload,ota_payload,payload.ota_payload), 8) \ X(a, STATIC, ONEOF, MESSAGE, (payload,ota_end,payload.ota_end), 9) \ X(a, STATIC, ONEOF, MESSAGE, (payload,ota_status,payload.ota_status), 10) \ X(a, STATIC, ONEOF, MESSAGE, (payload,find_me,payload.find_me), 11) \ X(a, STATIC, ONEOF, MESSAGE, (payload,restart,payload.restart), 12) \ X(a, STATIC, ONEOF, MESSAGE, (payload,accel_sample,payload.accel_sample), 13) \ X(a, STATIC, ONEOF, MESSAGE, (payload,accel_stream,payload.accel_stream), 14) #define alox_EspNowMessage_CALLBACK NULL #define alox_EspNowMessage_DEFAULT NULL #define alox_EspNowMessage_payload_discover_MSGTYPE alox_EspNowDiscover #define alox_EspNowMessage_payload_slave_info_MSGTYPE alox_EspNowSlavePresence #define alox_EspNowMessage_payload_heartbeat_MSGTYPE alox_EspNowSlavePresence #define alox_EspNowMessage_payload_accel_deadzone_MSGTYPE alox_EspNowAccelDeadzone #define alox_EspNowMessage_payload_unicast_test_MSGTYPE alox_EspNowUnicastTest #define alox_EspNowMessage_payload_ota_start_MSGTYPE alox_EspNowOtaStart #define alox_EspNowMessage_payload_ota_payload_MSGTYPE alox_EspNowOtaPayload #define alox_EspNowMessage_payload_ota_end_MSGTYPE alox_EspNowOtaEnd #define alox_EspNowMessage_payload_ota_status_MSGTYPE alox_EspNowOtaStatus #define alox_EspNowMessage_payload_find_me_MSGTYPE alox_EspNowFindMe #define alox_EspNowMessage_payload_restart_MSGTYPE alox_EspNowRestart #define alox_EspNowMessage_payload_accel_sample_MSGTYPE alox_EspNowAccelSample #define alox_EspNowMessage_payload_accel_stream_MSGTYPE alox_EspNowAccelStream extern const pb_msgdesc_t alox_EspNowUnicastTest_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; extern const pb_msgdesc_t alox_EspNowSlavePresence_msg; extern const pb_msgdesc_t alox_EspNowAccelDeadzone_msg; extern const pb_msgdesc_t alox_EspNowAccelStream_msg; extern const pb_msgdesc_t alox_EspNowAccelSample_msg; extern const pb_msgdesc_t alox_EspNowOtaStart_msg; extern const pb_msgdesc_t alox_EspNowOtaPayload_msg; extern const pb_msgdesc_t alox_EspNowOtaEnd_msg; extern const pb_msgdesc_t alox_EspNowOtaStatus_msg; 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_EspNowFindMe_fields &alox_EspNowFindMe_msg #define alox_EspNowRestart_fields &alox_EspNowRestart_msg #define alox_EspNowDiscover_fields &alox_EspNowDiscover_msg #define alox_EspNowSlavePresence_fields &alox_EspNowSlavePresence_msg #define alox_EspNowAccelDeadzone_fields &alox_EspNowAccelDeadzone_msg #define alox_EspNowAccelStream_fields &alox_EspNowAccelStream_msg #define alox_EspNowAccelSample_fields &alox_EspNowAccelSample_msg #define alox_EspNowOtaStart_fields &alox_EspNowOtaStart_msg #define alox_EspNowOtaPayload_fields &alox_EspNowOtaPayload_msg #define alox_EspNowOtaEnd_fields &alox_EspNowOtaEnd_msg #define alox_EspNowOtaStatus_fields &alox_EspNowOtaStatus_msg #define alox_EspNowMessage_fields &alox_EspNowMessage_msg /* Maximum encoded size of messages (where known) */ /* alox_EspNowSlavePresence_size depends on runtime parameters */ /* alox_EspNowMessage_size depends on runtime parameters */ #define ALOX_ESP_NOW_MESSAGES_PB_H_MAX_SIZE alox_EspNowOtaPayload_size #define alox_EspNowAccelDeadzone_size 12 #define alox_EspNowAccelSample_size 24 #define alox_EspNowAccelStream_size 8 #define alox_EspNowDiscover_size 6 #define alox_EspNowFindMe_size 6 #define alox_EspNowOtaEnd_size 0 #define alox_EspNowOtaPayload_size 209 #define alox_EspNowOtaStart_size 6 #define alox_EspNowOtaStatus_size 18 #define alox_EspNowRestart_size 6 #define alox_EspNowUnicastTest_size 6 #ifdef __cplusplus } /* extern "C" */ #endif #endif