some renames

master
Ondřej Hruška 6 years ago
parent 20c70c128f
commit ca8535e664
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      gex/gex_settings.c
  2. 6
      gex/gex_settings.h
  3. 12
      main.c

@ -8,7 +8,7 @@
#include "gex_internal.h" #include "gex_internal.h"
#include "gex_message_types.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){ GexBulk br = (GexBulk){
.buffer = (uint8_t *) buffer, .buffer = (uint8_t *) buffer,
@ -21,7 +21,7 @@ uint32_t GEX_SettingsIniRead(GexClient *gex, char *buffer, uint32_t maxlen)
return actuallyRead; return actuallyRead;
} }
bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer) bool GEX_IniWrite(GexClient *gex, const char *buffer)
{ {
GexBulk bw = (GexBulk){ GexBulk bw = (GexBulk){
.buffer = (uint8_t *) buffer, .buffer = (uint8_t *) buffer,
@ -32,7 +32,7 @@ bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer)
return GEX_BulkWrite(GEX_SysUnit(gex), &bw); 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); return TF_SendSimple(gex->tf, MSG_PERSIST_SETTINGS, NULL, 0);
} }

@ -22,7 +22,7 @@
* @param maxlen - buffer size * @param maxlen - buffer size
* @return number of bytes read, 0 on error * @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 * 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 * @param buffer - buffer with the settings file
* @return success * @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 * Persiste the settings loaded via GEX_SettingsIniWrite() to Flash
@ -41,6 +41,6 @@ bool GEX_SettingsIniWrite(GexClient *gex, const char *buffer);
* @param gex - client * @param gex - client
* @return send success * @return send success
*/ */
bool GEX_SettingsPersist(GexClient *gex); bool GEX_IniPersist(GexClient *gex);
#endif //GEX_CLIENT_GEX_SETTINGS_H #endif //GEX_CLIENT_GEX_SETTINGS_H

@ -99,7 +99,7 @@ int main(void)
fprintf(stderr, "Cmd \"PING\" OK\n"); fprintf(stderr, "Cmd \"PING\" OK\n");
#endif #endif
#if 0 #if 1
// Load settings to a buffer as INI // Load settings to a buffer as INI
uint8_t inifile[10000]; uint8_t inifile[10000];
br = (GexBulk){ br = (GexBulk){
@ -122,18 +122,18 @@ int main(void)
#if 1 #if 1
// Load settings to a buffer as INI // Load settings to a buffer as INI
char inifile[10000]; char inifile[10000];
uint32_t len = GEX_SettingsIniRead(gex, inifile, 10000); uint32_t len = GEX_IniRead(gex, inifile, 10000);
assert(len > 0); assert(len > 0);
fprintf(stderr, "Read %d bytes of INI:\n", len); fprintf(stderr, "Read %d bytes of INI:\n", len);
fprintf(stderr, "%.*s", len, inifile); fprintf(stderr, "%.*s", len, inifile);
// And send it back... // And send it back...
bool suc = GEX_SettingsIniWrite(gex, inifile); bool suc = GEX_IniWrite(gex, inifile);
assert(suc); assert(suc);
#endif #endif
#if 0 #if 1
// Test a echo command that returns back what was sent to it as useful payload // 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 " 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 " "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))); assert(0==strncmp((char*)msg.payload, s, strlen(s)));
#endif #endif
#if 0 #if 1
// Read the communist manifesto via bulk transfer // Read the communist manifesto via bulk transfer
uint8_t buffr[10000]; uint8_t buffr[10000];
br = (GexBulk){ br = (GexBulk){
@ -158,7 +158,7 @@ int main(void)
fprintf(stderr, "%.*s", actuallyRead, buffr); fprintf(stderr, "%.*s", actuallyRead, buffr);
#endif #endif
#if 0 #if 1
// Read the communist manifesto via bulk transfer // Read the communist manifesto via bulk transfer
br = (GexBulk){ br = (GexBulk){
.buffer = (uint8_t *) longtext, .buffer = (uint8_t *) longtext,

Loading…
Cancel
Save