Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Added second battery checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Jun 2, 2016
1 parent d7fc716 commit a0633c7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion openstratos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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()) +
Expand Down

0 comments on commit a0633c7

Please sign in to comment.