Improved firmware upgrade

This commit is contained in:
Gunnar Skjold
2023-04-15 07:44:33 +02:00
parent 9c8788225d
commit be116d5b35
14 changed files with 169 additions and 101 deletions

View File

@@ -11,6 +11,7 @@
#define CONFIG_SYSTEM_START 8
#define CONFIG_METER_START 32
#define CONFIG_UPGRADE_INFO_START 216
#define CONFIG_UI_START 248
#define CONFIG_GPIO_START 266
#define CONFIG_ENTSOE_START 290
@@ -213,6 +214,13 @@ struct TempSensorConfig {
bool common;
};
struct UpgradeInformation {
char fromVersion[8];
char toVersion[8];
int16_t exitCode;
int16_t errorCode;
}; // 20
class AmsConfiguration {
public:
bool hasConfig();
@@ -297,6 +305,10 @@ public:
bool isSensorAddressEqual(uint8_t a[8], uint8_t b[8]);
bool getUpgradeInformation(UpgradeInformation&);
bool setUpgradeInformation(int16_t exitCode, int16_t errorCode, const char* currentVersion, const char* nextVersion);
void clearUpgradeInformation(UpgradeInformation&);
void clear();
protected:

View File

@@ -7,6 +7,6 @@
String toHex(uint8_t* in);
String toHex(uint8_t* in, uint16_t size);
void fromHex(uint8_t *out, String in, uint16_t size);
void stripNonAscii(uint8_t* in, uint16_t size, bool extended = false);
bool stripNonAscii(uint8_t* in, uint16_t size, bool extended = false);
#endif