-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to restart in wifimanager mode from config page
- Loading branch information
Showing
8 changed files
with
196 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "SpiffsCookie.h" | ||
#include "FS.h" | ||
#include "SPIFFS.h" | ||
|
||
SpiffsCookie::SpiffsCookie() | ||
{ | ||
if(!SPIFFS.begin(true)) | ||
{ | ||
Serial.println(F("SPIFFS Mount Failed")); | ||
} | ||
} | ||
|
||
void SpiffsCookie::set() | ||
{ | ||
File file = SPIFFS.open("/cookie", FILE_WRITE); | ||
if(!file) | ||
{ | ||
Serial.println(F("- failed to open file for writing")); | ||
return; | ||
} | ||
|
||
if(file.write('#')) | ||
{ | ||
Serial.println(F("- file written")); | ||
} else { | ||
Serial.println(F("- write failed")); | ||
} | ||
file.close(); | ||
} | ||
|
||
void SpiffsCookie::clear() | ||
{ | ||
if(!SPIFFS.remove("/cookie")) | ||
{ | ||
Serial.println(F("Failed to remove file")); | ||
} | ||
|
||
} | ||
|
||
const bool SpiffsCookie::isSet() | ||
{ | ||
return SPIFFS.exists("/cookie"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
class SpiffsCookie | ||
{ | ||
public: | ||
SpiffsCookie(); | ||
virtual ~SpiffsCookie() = default; | ||
|
||
void set(); | ||
void clear(); | ||
const bool isSet(); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#pragma once | ||
|
||
#define blescanner_hub_version "1.0" | ||
#define blescanner_hub_version "1.1" |
Oops, something went wrong.