mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Fix #2612 - struct mg_str::ptr -> buf
This commit is contained in:
1 parent
e93d18d200
commit
e0e599ffa1
61 files changed
+684
-686
No files matched your search
@@ -10,7 +10,7 @@ struct mg_str config_read(void) {
|
||||
}
|
||||
|
||||
void config_write(struct mg_str config) {
|
||||
mg_file_write(&mg_fs_posix, FS_ROOT "/config.json", config.ptr, config.len);
|
||||
mg_file_write(&mg_fs_posix, FS_ROOT "/config.json", config.buf, config.len);
|
||||
}
|
||||
|
||||
void app_main(void) {
|
||||
@@ -22,13 +22,13 @@ void app_main(void) {
|
||||
|
||||
// Try to connect to wifi by using saved WiFi credentials
|
||||
struct mg_str json = mg_file_read(&mg_fs_posix, WIFI_FILE);
|
||||
if (json.ptr != NULL) {
|
||||
if (json.buf != NULL) {
|
||||
char *ssid = mg_json_get_str(json, "$.ssid");
|
||||
char *pass = mg_json_get_str(json, "$.pass");
|
||||
while (!wifi_init(ssid, pass)) (void) 0;
|
||||
free(ssid);
|
||||
free(pass);
|
||||
free((void *) json.ptr);
|
||||
free((void *) json.buf);
|
||||
} else {
|
||||
// If WiFi is not configured, run CLI until configured
|
||||
MG_INFO(("WiFi is not configured, running CLI. Press enter"));
|
||||
|
||||
Reference in new issue
Block a user