This commit is contained in:
cbb
2025-12-25 12:07:06 +08:00
commit 26e73f451e
899 changed files with 42812 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef __OTA_H
#define __OTA_H
#include "Can.h"
#include "config.h"
#include "gd32c10x.h"
class OTAHandler {
public:
bool ota_active;
uint32_t received_size;
uint32_t expected_size;
OTAHandler();
void init();
void process();
bool isActive() const { return ota_active; }
void handleOTAMessage(uint32_t id, uint8_t *data, uint8_t len);
void jumpToApplication();
private:
bool validateApplication();
void eraseApplicationArea();
void writeApplicationData(uint32_t offset, uint8_t *data, uint32_t size);
void sendACK(uint32_t packet_num);
};
#endif