@@ -22,7 +22,7 @@ | |||||
#define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000 | #define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000 | ||||
#define NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS 6000 | #define NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS 6000 | ||||
#define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 1800000 | |||||
#define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 180000 | |||||
struct sleepTimings_t { | struct sleepTimings_t { | ||||
uint8_t speed; | uint8_t speed; | ||||
@@ -25,7 +25,7 @@ namespace gps { | |||||
char lastPosition[GPS_POSITION_SIZE]; | char lastPosition[GPS_POSITION_SIZE]; | ||||
SIM808_GPS_STATUS lastStatus; | SIM808_GPS_STATUS lastStatus; | ||||
SIM808_GPS_STATUS acquireCurrentPosition(uint16_t timeout) { | |||||
SIM808_GPS_STATUS acquireCurrentPosition(uint32_t timeout) { | |||||
SIM808_GPS_STATUS currentStatus = SIM808_GPS_STATUS::OFF; | SIM808_GPS_STATUS currentStatus = SIM808_GPS_STATUS::OFF; | ||||
do { | do { | ||||
@@ -15,7 +15,7 @@ namespace gps { | |||||
inline void powerOn() { hardware::sim808::gpsPowerOn(); } | inline void powerOn() { hardware::sim808::gpsPowerOn(); } | ||||
inline void powerOff() { hardware::sim808::gpsPowerOff(); } | inline void powerOff() { hardware::sim808::gpsPowerOff(); } | ||||
SIM808_GPS_STATUS acquireCurrentPosition(uint16_t timeout); | |||||
SIM808_GPS_STATUS acquireCurrentPosition(uint32_t timeout); | |||||
uint8_t getVelocity(); | uint8_t getVelocity(); | ||||
void getTime(tmElements_t &time); | void getTime(tmElements_t &time); |
@@ -8,7 +8,7 @@ | |||||
namespace network { | namespace network { | ||||
SIM808RegistrationStatus waitForRegistered(uint16_t timeout) { | |||||
SIM808RegistrationStatus waitForRegistered(uint32_t timeout) { | |||||
SIM808RegistrationStatus currentStatus; | SIM808RegistrationStatus currentStatus; | ||||
do { | do { | ||||
@@ -7,7 +7,7 @@ namespace network { | |||||
inline void powerOn() { hardware::sim808::networkPowerOn(); } | inline void powerOn() { hardware::sim808::networkPowerOn(); } | ||||
inline void powerOff() { hardware::sim808::networkPowerOff(); } | inline void powerOff() { hardware::sim808::networkPowerOff(); } | ||||
SIM808RegistrationStatus waitForRegistered(uint16_t timeout); | |||||
SIM808RegistrationStatus waitForRegistered(uint32_t timeout); | |||||
bool isAvailable(SIM808_NETWORK_REGISTRATION_STATE state); | bool isAvailable(SIM808_NETWORK_REGISTRATION_STATE state); | ||||
bool enableGprs(); | bool enableGprs(); | ||||
} | } |
@@ -24,7 +24,9 @@ namespace positions { | |||||
} | } | ||||
bool appendPosition(config_t &config, PositionEntry &entry) { | bool appendPosition(config_t &config, PositionEntry &entry) { | ||||
char buffer[BUFFER_SIZE]; | |||||
debug::displayFreeRam(); | |||||
return false; | |||||
/*char buffer[BUFFER_SIZE]; | |||||
snprintf_P(buffer, BUFFER_SIZE, PSTR("%d,%d,%.2f,%d,%s,%d"), | snprintf_P(buffer, BUFFER_SIZE, PSTR("%d,%d,%.2f,%d,%s,%d"), | ||||
entry.metadata.batteryLevel, | entry.metadata.batteryLevel, | ||||
entry.metadata.batteryVoltage, | entry.metadata.batteryVoltage, | ||||
@@ -38,7 +40,7 @@ namespace positions { | |||||
buffer, | buffer, | ||||
buffer, | buffer, | ||||
BUFFER_SIZE | BUFFER_SIZE | ||||
) == POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE; | |||||
) == POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE;*/ | |||||
} | } | ||||
void appendPositions(config_t &config) { | void appendPositions(config_t &config) { | ||||
@@ -54,7 +56,7 @@ namespace positions { | |||||
if (!network::isAvailable(networkStatus.stat)) VERBOSE_MSG("appendPositions", "network unavailable"); | if (!network::isAvailable(networkStatus.stat)) VERBOSE_MSG("appendPositions", "network unavailable"); | ||||
else if (!network::enableGprs()) VERBOSE_MSG("appendPositions", "gprs unavailable"); | else if (!network::enableGprs()) VERBOSE_MSG("appendPositions", "gprs unavailable"); | ||||
else { | else { | ||||
/*hardware::i2c::powerOn(); | |||||
hardware::i2c::powerOn(); | |||||
do { | do { | ||||
if (!positions::get(currentEntryIndex, currentEntry)) break; | if (!positions::get(currentEntryIndex, currentEntry)) break; | ||||
if (!appendPosition(config, currentEntry)) break; | if (!appendPosition(config, currentEntry)) break; | ||||
@@ -63,7 +65,7 @@ namespace positions { | |||||
config::main::set(config); | config::main::set(config); | ||||
} while (positions::moveNext(currentEntryIndex)); | } while (positions::moveNext(currentEntryIndex)); | ||||
hardware::i2c::powerOff(); */ | |||||
hardware::i2c::powerOff(); | |||||
} | } | ||||
network::powerOff(); | network::powerOff(); | ||||