Damien Frost / WiflyInterface

Dependents:   IoT_Ex BatteryModelTester BatteryModelTester

Fork of WiflyInterface by Components

Files at this revision

API Documentation at this revision

Comitter:
defrost
Date:
Thu May 12 16:01:50 2016 +0000
Parent:
31:2846355deb7e
Child:
33:26a14bc6d90e
Commit message:
- Added sleep function to put the wifi module to sleep

Changed in this revision

Wifly/Wifly.cpp Show annotated file Show diff for this revision Revisions of this file
Wifly/Wifly.h Show annotated file Show diff for this revision Revisions of this file
--- a/Wifly/Wifly.cpp	Mon May 09 11:39:08 2016 +0000
+++ b/Wifly/Wifly.cpp	Thu May 12 16:01:50 2016 +0000
@@ -613,4 +613,11 @@
     }
     
     return status;
+}
+
+void Wifly::sleep(void){
+    // This function puts the module to sleep:
+    sendCommand("sleep\r", NULL);
+    // It will wake up from sleep if any characters are sent to it.
+    return;
 }
\ No newline at end of file
--- a/Wifly/Wifly.h	Mon May 09 11:39:08 2016 +0000
+++ b/Wifly/Wifly.h	Thu May 12 16:01:50 2016 +0000
@@ -222,6 +222,12 @@
         return state.dhcp;
     }
 
+    /**
+    * Puts the module to sleep
+    *
+    */
+    void sleep(void);
+
     bool gethostbyname(const char * host, char * ip);
 
     static Wifly * getInstance() {