From 8ef469b9f129496a63f144379b9a69dfcd22ad83 Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Thu, 25 Jan 2024 14:33:40 +0100 Subject: [PATCH] added Wifi-Config to EEPROM Layout --- Software/include/config.h | 10 ++++++++++ Software/include/struct2json.h | 6 +++--- Software/src/config.cpp | 2 +- Software/src/struct2json.cpp | 10 +++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Software/include/config.h b/Software/include/config.h index 8d7c4ee..67d6e4b 100644 --- a/Software/include/config.h +++ b/Software/include/config.h @@ -21,6 +21,8 @@ #include "dtc.h" #include "common.h" +#define EEPROM_STRUCTURE_REVISION 3 // Increment this version when changing EEPROM structures + #if PCB_REV == 1 || PCB_REV == 2 || PCB_REV == 3 #define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64 #elif PCB_REV == 4 @@ -73,6 +75,10 @@ typedef struct bool LED_Mode_Flash; uint8_t LED_Max_Brightness; uint8_t LED_Min_Brightness; + char wifi_ap_ssid[33]; + char wifi_ap_password[64]; + char wifi_client_ssid[33]; + char wifi_client_password[64]; uint32_t checksum; } LubeConfig_t; @@ -84,6 +90,10 @@ const LubeConfig_t LubeConfig_defaults = { false, 255, 5, + "ChainLube", + QUOTE(WIFI_AP_PASSWORD), + QUOTE(WIFI_SSID_CLIENT), + QUOTE(WIFI_PASSWORD_CLIENT), 0}; void InitEEPROM(); diff --git a/Software/include/struct2json.h b/Software/include/struct2json.h index e09dccb..515ba5d 100644 --- a/Software/include/struct2json.h +++ b/Software/include/struct2json.h @@ -3,10 +3,10 @@ * * @brief Header file for converting structs to JSON objects. * - * @note This file is auto-generated by a script on 2024-01-10 18:01:52. + * @note This file is auto-generated by a script on 2024-01-25 14:30:32. * * @author Marcel Peterkau - * @date 10.01.2024 + * @date 25.01.2024 */ #ifndef _STRUCT2JSON_H_ @@ -23,4 +23,4 @@ void generateJsonObject_PersistenceData(JsonObject& data); #endif /* _STRUCT2JSON_H_ */ -// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c \ No newline at end of file +// CODEGENERATOR_CHECKSUM: 4bb0dc037057aafd9688aacedfaae5c97c9de79dbbd0e139d982208053f74fa8 \ No newline at end of file diff --git a/Software/src/config.cpp b/Software/src/config.cpp index 73a641e..f6df9c3 100644 --- a/Software/src/config.cpp +++ b/Software/src/config.cpp @@ -18,7 +18,7 @@ LubeConfig_t LubeConfig; persistenceData_t PersistenceData; // EEPROM version identifier -const uint16_t eeVersion = 2; // Increment this version when changing EEPROM structures +const uint16_t eeVersion = EEPROM_STRUCTURE_REVISION; // Flag indicating whether EEPROM is available boolean eeAvailable = false; diff --git a/Software/src/struct2json.cpp b/Software/src/struct2json.cpp index 0147f50..03d51f7 100644 --- a/Software/src/struct2json.cpp +++ b/Software/src/struct2json.cpp @@ -3,10 +3,10 @@ * * @brief Implementation file for converting structs to JSON objects. * - * @note This file is auto-generated by a script on 2024-01-10 18:01:52. + * @note This file is auto-generated by a script on 2024-01-25 14:30:32. * * @author Marcel Peterkau - * @date 10.01.2024 + * @date 25.01.2024 */ @@ -32,6 +32,10 @@ void generateJsonObject_LubeConfig(JsonObject& data) data["LED_Mode_Flash"] = LubeConfig.LED_Mode_Flash; data["LED_Max_Brightness"] = LubeConfig.LED_Max_Brightness; data["LED_Min_Brightness"] = LubeConfig.LED_Min_Brightness; + data["wifi_ap_ssid"] = LubeConfig.wifi_ap_ssid; + data["wifi_ap_password"] = LubeConfig.wifi_ap_password; + data["wifi_client_ssid"] = LubeConfig.wifi_client_ssid; + data["wifi_client_password"] = LubeConfig.wifi_client_password; data["checksum"] = LubeConfig.checksum; } @@ -47,4 +51,4 @@ void generateJsonObject_PersistenceData(JsonObject& data) -// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c \ No newline at end of file +// CODEGENERATOR_CHECKSUM: 4bb0dc037057aafd9688aacedfaae5c97c9de79dbbd0e139d982208053f74fa8 \ No newline at end of file