Zigbee Fix loading previous file

This commit is contained in:
Stephan Hadinger 2021-04-22 16:51:11 +02:00
parent 2398056fa5
commit 85f742d903
1 changed files with 8 additions and 0 deletions

View File

@ -290,6 +290,14 @@ bool loadZigbeeDevices(void) {
if (!f.valid() && dfsp) {
file = dfsp->open(TASM_FILE_ZIGBEE, "r");
if (file) {
uint32_t signature = 0x0000;
file.read((uint8_t*)&signature, 4);
if (signature == ZIGB_NAME2) {
// skip another 4 bytes
file.read((uint8_t*)&signature, 4);
} else {
file.seek(0); // seek back to beginning of file
}
f.init(&file);
storage_class = PSTR("File System");
}