Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BufferedSerial
Dependents: esp8266_nodeMCU1 esp8266_2_thingspeak1 Solarator_0-0-2 IoTBurglar_and_Fire_AlarmSystem ... more
Fork of ESP8266Interface by
Diff: WiflyInterface.cpp
- Revision:
- 13:41098c907200
- Parent:
- 12:c5f0eac67a8a
- Child:
- 14:4d1128f72e00
--- a/WiflyInterface.cpp Wed Oct 08 19:57:58 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#include "WiflyInterface.h"
-
-WiflyInterface::WiflyInterface( PinName tx, PinName rx, PinName reset, PinName tcp_status,
- const char * ssid, const char * phrase, Security sec) :
- Wifly(tx, rx, reset, tcp_status, ssid, phrase, sec)
-{
- ip_set = false;
-}
-
-int WiflyInterface::init()
-{
- state.dhcp = true;
- reset();
- return 0;
-}
-
-int WiflyInterface::init(const char* ip, const char* mask, const char* gateway)
-{
- state.dhcp = false;
- this->ip = ip;
- strcpy(ip_string, ip);
- ip_set = true;
- this->netmask = mask;
- this->gateway = gateway;
- reset();
-
- return 0;
-}
-
-int WiflyInterface::connect()
-{
- return join();
-}
-
-int WiflyInterface::disconnect()
-{
- return Wifly::disconnect();
-}
-
-char * WiflyInterface::getIPAddress()
-{
- char * match = 0;
- if (!ip_set) {
- if (!sendCommand("get ip a\r\n", NULL, ip_string))
- return NULL;
- exit();
- flush();
- match = strstr(ip_string, "<");
- if (match != NULL) {
- *match = '\0';
- }
- if (strlen(ip_string) < 6) {
- match = strstr(ip_string, ">");
- if (match != NULL) {
- int len = strlen(match + 1);
- memcpy(ip_string, match + 1, len);
- }
- }
- ip_set = true;
- }
- return ip_string;
-}
\ No newline at end of file

Adafruit Huzzah