diff --git a/gex/gex_settings.c b/gex/gex_settings.c index bbb879e..4f1dfb3 100644 --- a/gex/gex_settings.c +++ b/gex/gex_settings.c @@ -8,7 +8,7 @@ #include "gex_internal.h" #include "gex_message_types.h" -uint32_t GEX_SettingsIniRead(GexClient *gex, char *buffer, uint32_t maxlen) +uint32_t GEX_IniRead(GexClient *gex, char *buffer, uint32_t maxlen) { GexBulk br = (GexBulk){ .buffer = (uint8_t *) buffer, @@ -21,7 +21,7 @@ uint32_t GEX_SettingsIniRead(GexClient *gex, char *buffer, uint32_t maxlen) return actuallyRead; } -bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer) +bool GEX_IniWrite(GexClient *gex, const char *buffer) { GexBulk bw = (GexBulk){ .buffer = (uint8_t *) buffer, @@ -32,7 +32,7 @@ bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer) return GEX_BulkWrite(GEX_SysUnit(gex), &bw); } -bool GEX_SettingsPersist(GexClient *gex) +bool GEX_IniPersist(GexClient *gex) { return TF_SendSimple(gex->tf, MSG_PERSIST_SETTINGS, NULL, 0); } diff --git a/gex/gex_settings.h b/gex/gex_settings.h index 3c3dd47..a38da88 100644 --- a/gex/gex_settings.h +++ b/gex/gex_settings.h @@ -22,7 +22,7 @@ * @param maxlen - buffer size * @return number of bytes read, 0 on error */ -uint32_t GEX_SettingsIniRead(GexClient *gex, char *buffer, uint32_t maxlen); +uint32_t GEX_IniRead(GexClient *gex, char *buffer, uint32_t maxlen); /** * Write settings INI file via TinyFrame @@ -31,7 +31,7 @@ uint32_t GEX_SettingsIniRead(GexClient *gex, char *buffer, uint32_t maxlen); * @param buffer - buffer with the settings file * @return success */ -bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer); +bool GEX_IniWrite(GexClient *gex, const char *buffer); /** * Persiste the settings loaded via GEX_SettingsIniWrite() to Flash @@ -41,6 +41,6 @@ bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer); * @param gex - client * @return send success */ -bool GEX_SettingsPersist(GexClient *gex); +bool GEX_IniPersist(GexClient *gex); #endif //GEX_CLIENT_GEX_SETTINGS_H diff --git a/main.c b/main.c index 8c4e1a5..95767f5 100644 --- a/main.c +++ b/main.c @@ -99,7 +99,7 @@ int main(void) fprintf(stderr, "Cmd \"PING\" OK\n"); #endif -#if 0 +#if 1 // Load settings to a buffer as INI uint8_t inifile[10000]; br = (GexBulk){ @@ -122,18 +122,18 @@ int main(void) #if 1 // Load settings to a buffer as INI char inifile[10000]; - uint32_t len = GEX_SettingsIniRead(gex, inifile, 10000); + uint32_t len = GEX_IniRead(gex, inifile, 10000); assert(len > 0); fprintf(stderr, "Read %d bytes of INI:\n", len); fprintf(stderr, "%.*s", len, inifile); // And send it back... - bool suc = GEX_SettingsIniWrite(gex, inifile); + bool suc = GEX_IniWrite(gex, inifile); assert(suc); #endif -#if 0 +#if 1 // Test a echo command that returns back what was sent to it as useful payload const char *s = "I am \r\nreturning this otherwise good typing paper to you because someone " "has printed gibberish all over it and put your name at the top. Read the communist manifesto via bulk transfer. Read the communist manifesto via bulk transfer. Technology is a constand battle between manufacturers producing bigger and " @@ -143,7 +143,7 @@ int main(void) assert(0==strncmp((char*)msg.payload, s, strlen(s))); #endif -#if 0 +#if 1 // Read the communist manifesto via bulk transfer uint8_t buffr[10000]; br = (GexBulk){ @@ -158,7 +158,7 @@ int main(void) fprintf(stderr, "%.*s", actuallyRead, buffr); #endif -#if 0 +#if 1 // Read the communist manifesto via bulk transfer br = (GexBulk){ .buffer = (uint8_t *) longtext,