The field version of the solarnano grid on the ionQubes

Fork of SolarNanoGridv3 by SONG Project

Revision:
17:dc19b3b39790
Parent:
13:de43f28c0365
Child:
18:be77ad141fac
--- a/Battery/Battery.cpp	Sat Jun 11 19:01:24 2016 +0000
+++ b/Battery/Battery.cpp	Mon Jun 13 09:04:53 2016 +0000
@@ -71,6 +71,7 @@
     flagSendFileDone=0;
     flagGetMaxCharge=0;
     sendingFile=0;
+    startCharge = false;
 
     // Protected interrupts
     button=NULL;
@@ -364,7 +365,7 @@
         nextFileToTx();
         if (fileLength>0){
             INFO("Sending file %s.",txFileName)
-                                                                sendDirName();
+            sendDirName();
         } else {
             sendingFile=0;
             INFO("No more files to send.")
@@ -579,6 +580,7 @@
         sdBuffPnt=0;
         flagSendFileDone=1;
         DBG("Done sending");
+        startCharge = true;
     }else{
         sizeRead -= size;
         nrf->transmitData(&(sdBuffer[sdBuffPnt]), size);
@@ -634,3 +636,18 @@
 
     return logDir;
 }
+
+/**
+ * Returns true if we are authorized to start charging.
+ */
+bool Battery::startCharging(void){
+    return startCharge;
+}
+
+bool Battery::isCheckedIn(void){
+    if(checkedIn == 1){
+        return true;
+    }else{
+        return false;
+    }
+}