diff --git a/main/communication_handler.c b/main/communication_handler.c index 5742097..ccf9057 100644 --- a/main/communication_handler.c +++ b/main/communication_handler.c @@ -262,7 +262,10 @@ void client_receive_callback(const esp_now_recv_info_t *esp_now_info, sizeof(BaseMessage))); hasMaster = true; } + break; } + // check if its an update message + break; case RegisterPage: break; diff --git a/main/communication_handler.h b/main/communication_handler.h index b49d472..ce172ba 100644 --- a/main/communication_handler.h +++ b/main/communication_handler.h @@ -28,16 +28,35 @@ static uint8_t broadcast_address[ESP_NOW_ETH_ALEN] = {0xFF, 0xFF, 0xFF, #define MESSAGE_QUEUE_SIZE 10 typedef enum { + OTA_PREP_UPGRADE, + OTA_SEND_PAYLOAD, + OTA_WRITE_UPDATE_BUFFER, + OTA_SEND_MISSING, + OTA_UPDATE_INFO, + OTA_END_UPGRADE, StatusPage, GetStatusPage, ConfigPage, PingPage, BroadCastPage, RegisterPage, - FirmwarePrepPage, - FirmwarePayloadPage, } CommandPages; +typedef struct __attribute__((packed)) { + +} OTA_PREP_UPGRADE_Payload; + +typedef struct __attribute__((packed)) { +} OTA_SEND_PAYLOAD_Payload; +typedef struct __attribute__((packed)) { +} OTA_WRITE_UPDATE_BUFFER_Payload; +typedef struct __attribute__((packed)) { +} OTA_SEND_MISSING_Payload; +typedef struct __attribute__((packed)) { +} OTA_UPDATE_INFO_Payload; +typedef struct __attribute__((packed)) { +} OTA_END_UPGRADE_Payload; + typedef struct __attribute__((packed)) { uint16_t version; // software version uint8_t runningPartition;