Changed a filename Dvecie.cpp > SBDevice.cpp.

Increased the version number.
This commit is contained in:
Marcel Schulz 2017-12-15 13:58:18 +01:00
parent a0cb35706c
commit 9c7ad75225
2 changed files with 1 additions and 33 deletions

View File

@ -1,5 +1,5 @@
name=SBNetwork
version=1.0.4
version=1.1.0
author=Schullebernd,schullebernd@googlemail.com
maintainer=Schullebernd,schullebernd@googlemail.com
sentence=Build simple master/client networks with nRF24L01 transmitter.

View File

@ -1,32 +0,0 @@
#include "SBDevice.h"
SBMasterStorage SBMasterStorage::initialize() {
SBMasterStorage storage;
#if defined(ESP8266)
EEPROM.begin(SB_NETWORK_FLASH_SIZE);
#endif
EEPROM.get(0 + sizeof(SBNetworkDevice), storage);
if (storage.ID[0] != 'M' || storage.ID[1] != 'S') {
// We have to create a new one
storage.ID[0] = 'M';
storage.ID[1] = 'S';
Serial.println("Creating new Master Storage");
EEPROM.put(0 + sizeof(SBNetworkDevice), storage);
#if defined(ESP8266)
EEPROM.commit();
EEPROM.end();
#endif
}
return storage;
}
void SBMasterStorage::save() {
#if defined(ESP8266)
EEPROM.begin(SB_NETWORK_FLASH_SIZE);
#endif
EEPROM.put(sizeof(SBNetworkDevice), *this);
#if defined(ESP8266)
EEPROM.commit();
EEPROM.end();
#endif
}