From d0ef217f75ced7886a197122018c88a3eb66f20d Mon Sep 17 00:00:00 2001 From: Bertrand Lemasle Date: Fri, 3 Aug 2018 22:01:13 +1200 Subject: [PATCH] Reworked code to fix missing network::powerOff in notifyFailures --- GpsTracker/Core.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/GpsTracker/Core.cpp b/GpsTracker/Core.cpp index 49f5231..6b25e46 100644 --- a/GpsTracker/Core.cpp +++ b/GpsTracker/Core.cpp @@ -61,13 +61,11 @@ namespace core { } config_t* config = &config::main::value; - if (!network::sendSms(config->contactPhone, buffer)) { - NOTICE_MSG("notifyFailure", "SMS not sent !"); - return 0; - } + bool sent = network::sendSms(config->contactPhone, buffer); + if (!sent) NOTICE_MSG("notifyFailure", "SMS not sent !"); network::powerOff(); - return triggered; + return sent ? triggered : 0; } void updateRtcTime() {