@@ -28,6 +28,7 @@ MENU_ENTRY(EEPROM_GET_CONTENT, "[E] Get EEPROM content"); | |||||
MENU_ENTRY(EEPROM_GET_ENTRIES, "[P] Get EEPROM entries"); | MENU_ENTRY(EEPROM_GET_ENTRIES, "[P] Get EEPROM entries"); | ||||
MENU_ENTRY(EEPROM_GET_LAST_ENTRY, "[p] Get EEPROM last entry"); | MENU_ENTRY(EEPROM_GET_LAST_ENTRY, "[p] Get EEPROM last entry"); | ||||
MENU_ENTRY(EEPROM_ADD_ENTRY, "[a] Add last entry to EEPROM"); | MENU_ENTRY(EEPROM_ADD_ENTRY, "[a] Add last entry to EEPROM"); | ||||
MENU_ENTRY(EEPROM_BACKUP_ENTRIES, "[B] Backup EEPROM entries"); | |||||
MENU_ENTRY(SLEEP, "[S] Sleep for 8s"); | MENU_ENTRY(SLEEP, "[S] Sleep for 8s"); | ||||
MENU_ENTRY(SLEEP_DEEP, "[s] Deep sleep for 10s"); | MENU_ENTRY(SLEEP_DEEP, "[s] Deep sleep for 10s"); | ||||
MENU_ENTRY(QUESTION, "?"); | MENU_ENTRY(QUESTION, "?"); | ||||
@@ -50,6 +51,7 @@ const PROGMEM uint8_t commandIdMapping[] = { | |||||
'P', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_GET_ENTRIES), | 'P', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_GET_ENTRIES), | ||||
'p', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_GET_LAST_ENTRY), | 'p', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_GET_LAST_ENTRY), | ||||
'a', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_ADD_ENTRY), | 'a', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_ADD_ENTRY), | ||||
'B', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_BACKUP_ENTRIES), | |||||
'S', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP), | 'S', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP), | ||||
's', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP_DEEP), | 's', static_cast<uint8_t>(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP_DEEP), | ||||
}; | }; | ||||
@@ -88,7 +90,7 @@ const char * const MENU_ENTRIES[] PROGMEM = { | |||||
MENU_EEPROM_GET_ENTRIES, | MENU_EEPROM_GET_ENTRIES, | ||||
MENU_EEPROM_GET_LAST_ENTRY, | MENU_EEPROM_GET_LAST_ENTRY, | ||||
MENU_EEPROM_ADD_ENTRY, | MENU_EEPROM_ADD_ENTRY, | ||||
MENU_EEPROM_BACKUP_ENTRIES, | |||||
MENU_SEPARATOR, | MENU_SEPARATOR, | ||||
MENU_SLEEP, | MENU_SLEEP, | ||||
@@ -54,8 +54,9 @@ namespace debug { | |||||
EEPROM_GET_LAST_ENTRY = 17, | EEPROM_GET_LAST_ENTRY = 17, | ||||
EEPROM_GET_ENTRIES = 18, | EEPROM_GET_ENTRIES = 18, | ||||
EEPROM_ADD_ENTRY = 19, | EEPROM_ADD_ENTRY = 19, | ||||
SLEEP = 20, | |||||
SLEEP_DEEP = 21 | |||||
EEPROM_BACKUP_ENTRIES = 20, | |||||
SLEEP = 21, | |||||
SLEEP_DEEP = 22 | |||||
}; | }; | ||||
void waitForSerial(); | void waitForSerial(); | ||||
@@ -32,6 +32,7 @@ namespace gps { | |||||
currentStatus = hardware::sim808::device.getGpsStatus(); | currentStatus = hardware::sim808::device.getGpsStatus(); | ||||
if (currentStatus > SIM808_GPS_STATUS::NO_FIX) break; | if (currentStatus > SIM808_GPS_STATUS::NO_FIX) break; | ||||
VERBOSE_FORMAT("acquireCurrentPosition", "%d", currentStatus); | |||||
mainunit::deepSleep(GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS / 1000); | mainunit::deepSleep(GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS / 1000); | ||||
timeout -= GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS; | timeout -= GPS_DEFAULT_INTERMEDIATE_TIMEOUT_MS; | ||||
} while (timeout > 1); | } while (timeout > 1); | ||||
@@ -69,6 +69,8 @@ void loop() { | |||||
break; | break; | ||||
case debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_ADD_ENTRY: | case debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_ADD_ENTRY: | ||||
debug::addLastPositionToEeprom(); | debug::addLastPositionToEeprom(); | ||||
break; | |||||
case debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_BACKUP_ENTRIES: | |||||
positions::doBackup(); | positions::doBackup(); | ||||
break; | break; | ||||
case debug::GPSTRACKER_DEBUG_COMMAND::SLEEP: | case debug::GPSTRACKER_DEBUG_COMMAND::SLEEP: | ||||
@@ -1,4 +1,5 @@ | |||||
#include "Config.h" | #include "Config.h" | ||||
#include "Debug.h" | |||||
#include "Network.h" | #include "Network.h" | ||||
#include "Hardware.h" | #include "Hardware.h" | ||||
#include "MainUnit.h" | #include "MainUnit.h" | ||||
@@ -14,6 +15,7 @@ namespace network { | |||||
currentStatus = hardware::sim808::device.getNetworkRegistrationStatus(); | currentStatus = hardware::sim808::device.getNetworkRegistrationStatus(); | ||||
if (isAvailable(currentStatus.stat)) break; | if (isAvailable(currentStatus.stat)) break; | ||||
VERBOSE_FORMAT("waitForRegistered", "%d", currentStatus.stat); | |||||
mainunit::deepSleep(NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS / 1000); | mainunit::deepSleep(NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS / 1000); | ||||
timeout -= NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS; | timeout -= NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS; | ||||
} while (timeout > 1); | } while (timeout > 1); | ||||