浏览代码

Fixed timeout for gsm and gps overflow uint16

tags/v1.2.0
Bertrand Lemasle 7 年前
父节点
当前提交
dfae1a9a34
共有 6 个文件被更改,包括 11 次插入9 次删除
  1. +1
    -1
      GpsTracker/Config.h
  2. +1
    -1
      GpsTracker/Gps.cpp
  3. +1
    -1
      GpsTracker/Gps.h
  4. +1
    -1
      GpsTracker/Network.cpp
  5. +1
    -1
      GpsTracker/Network.h
  6. +6
    -4
      GpsTracker/NetworkPositionsBackup.cpp

+ 1
- 1
GpsTracker/Config.h 查看文件

@@ -22,7 +22,7 @@
#define GPS_DEFAULT_TOTAL_TIMEOUT_MS 180000

#define NETWORK_DEFAULT_INTERMEDIATE_TIMEOUT_MS 6000
#define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 1800000
#define NETWORK_DEFAULT_TOTAL_TIMEOUT_MS 180000

struct sleepTimings_t {
uint8_t speed;


+ 1
- 1
GpsTracker/Gps.cpp 查看文件

@@ -25,7 +25,7 @@ namespace gps {
char lastPosition[GPS_POSITION_SIZE];
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;

do {


+ 1
- 1
GpsTracker/Gps.h 查看文件

@@ -15,7 +15,7 @@ namespace gps {
inline void powerOn() { hardware::sim808::gpsPowerOn(); }
inline void powerOff() { hardware::sim808::gpsPowerOff(); }

SIM808_GPS_STATUS acquireCurrentPosition(uint16_t timeout);
SIM808_GPS_STATUS acquireCurrentPosition(uint32_t timeout);

uint8_t getVelocity();
void getTime(tmElements_t &time);

+ 1
- 1
GpsTracker/Network.cpp 查看文件

@@ -8,7 +8,7 @@

namespace network {

SIM808RegistrationStatus waitForRegistered(uint16_t timeout) {
SIM808RegistrationStatus waitForRegistered(uint32_t timeout) {
SIM808RegistrationStatus currentStatus;

do {


+ 1
- 1
GpsTracker/Network.h 查看文件

@@ -7,7 +7,7 @@ namespace network {
inline void powerOn() { hardware::sim808::networkPowerOn(); }
inline void powerOff() { hardware::sim808::networkPowerOff(); }

SIM808RegistrationStatus waitForRegistered(uint16_t timeout);
SIM808RegistrationStatus waitForRegistered(uint32_t timeout);
bool isAvailable(SIM808_NETWORK_REGISTRATION_STATE state);
bool enableGprs();
}

+ 6
- 4
GpsTracker/NetworkPositionsBackup.cpp 查看文件

@@ -24,7 +24,9 @@ namespace positions {
}

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"),
entry.metadata.batteryLevel,
entry.metadata.batteryVoltage,
@@ -38,7 +40,7 @@ namespace positions {
buffer,
buffer,
BUFFER_SIZE
) == POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE;
) == POSITIONS_CONFIG_NET_DEFAULT_EXPECTED_RESPONSE;*/
}

void appendPositions(config_t &config) {
@@ -54,7 +56,7 @@ namespace positions {
if (!network::isAvailable(networkStatus.stat)) VERBOSE_MSG("appendPositions", "network unavailable");
else if (!network::enableGprs()) VERBOSE_MSG("appendPositions", "gprs unavailable");
else {
/*hardware::i2c::powerOn();
hardware::i2c::powerOn();
do {
if (!positions::get(currentEntryIndex, currentEntry)) break;
if (!appendPosition(config, currentEntry)) break;
@@ -63,7 +65,7 @@ namespace positions {
config::main::set(config);

} while (positions::moveNext(currentEntryIndex));
hardware::i2c::powerOff(); */
hardware::i2c::powerOff();
}

network::powerOff();


正在加载...
取消
保存