Просмотр исходного кода

Moved contact phone number inside sendSms (since there is one number, no need for core to know it)

tags/v1.2.0
Bertrand Lemasle 6 лет назад
Родитель
Сommit
6ec9d19094
3 измененных файлов: 5 добавлений и 4 удалений
  1. +1
    -2
      GpsTracker/Core.cpp
  2. +3
    -1
      GpsTracker/Network.cpp
  3. +1
    -1
      GpsTracker/Network.h

+ 1
- 2
GpsTracker/Core.cpp Просмотреть файл

@@ -77,8 +77,7 @@ namespace core {
details::appendToSmsBuffer(buffer, PSTR("- Temperature is %dC. %S"), static_cast<uint16_t>(metadata.temperature * 100), backupFailureString);
}

config_t* config = &config::main::value;
bool notified = network::sendSms(config->contactPhone, buffer);
bool notified = network::sendSms(buffer);
if (!notified) NOTICE_MSG("notifyFailure", "SMS not sent !");

network::powerOff();


+ 3
- 1
GpsTracker/Network.cpp Просмотреть файл

@@ -64,7 +64,9 @@ namespace network {
return hardware::sim808::device.enableGprs(config::main::value.network.apn);
}

bool sendSms(const char * phoneNumber, const char * msg) {
bool sendSms(const char * msg) {
const char * phoneNumber = config::main::value.contactPhone;

NOTICE_FORMAT("sendSms", "%s, %s", phoneNumber, msg);
return hardware::sim808::device.sendSms(phoneNumber, msg);
}

+ 1
- 1
GpsTracker/Network.h Просмотреть файл

@@ -11,5 +11,5 @@ namespace network {
bool isAvailable(SIM808_NETWORK_REGISTRATION_STATE state);
bool enableGprs();

bool sendSms(const char * phoneNumber, const char * msg);
bool sendSms(const char * msg);
}

Загрузка…
Отмена
Сохранить