From a0633c7c248653814a053fe87897ace17b23e8b6 Mon Sep 17 00:00:00 2001 From: Razican Date: Sat, 19 Sep 2015 23:18:13 +0200 Subject: [PATCH] Added second battery checks --- openstratos.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openstratos.cc b/openstratos.cc index 612829d..7be98ce 100644 --- a/openstratos.cc +++ b/openstratos.cc @@ -1138,7 +1138,8 @@ void os::land(Logger* logger) bool bat_status = false; logger->log("Getting battery values..."); - if (bat_status = GSM::get_instance().get_battery_status(main_battery, gsm_battery)) + if (bat_status = (GSM::get_instance().get_battery_status(main_battery, gsm_battery) || + GSM::get_instance().get_battery_status(main_battery, gsm_battery))) logger->log("Battery status received."); else logger->log("Error getting battery status."); @@ -1162,6 +1163,13 @@ void os::land(Logger* logger) this_thread::sleep_for(10min); + logger->log("Getting battery values..."); + if (bat_status = (GSM::get_instance().get_battery_status(main_battery, gsm_battery) || + GSM::get_instance().get_battery_status(main_battery, gsm_battery))) + logger->log("Battery status received."); + else + logger->log("Error getting battery status."); + logger->log("Sending second landed SMS..."); while (( ! GSM::get_instance().send_SMS( "Landed\r\nAlt: "+ to_string((int) GPS::get_instance().get_altitude()) +