Skip to content

Compiling in Energia for launchpad boards #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions ESP8266wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const char NO_CHANGE[] PROGMEM = "no change";
const char SEND_OK[] PROGMEM = "SEND OK";
const char LINK_IS_NOT[] PROGMEM = "link is not";
const char PROMPT[] PROGMEM = ">";
const char BUSY[] PROGMEM = "busy";
const char BUSYC[] PROGMEM = "busy";
const char LINKED[] PROGMEM = "Linked";
const char ALREADY[] PROGMEM = "ALREAY";//yes typo in firmware..
const char ALREADY[] PROGMEM = "ALREAY"; //yes typo in firmware..
const char READY[] PROGMEM = "ready";
const char NO_IP[] PROGMEM = "0.0.0.0";

Expand Down Expand Up @@ -142,6 +142,7 @@ bool ESP8266wifi::begin() {
if(statusOk)
break;
}

if (!statusOk)
return false;

Expand Down Expand Up @@ -180,7 +181,7 @@ bool ESP8266wifi::connectToAP(String& ssid, String& password) {
return connectToAP(ssid.c_str(), password.c_str());
}

bool ESP8266wifi::connectToAP(const char* ssid, const char* password){//TODO make timeout config or parameter??
bool ESP8266wifi::connectToAP(const char* ssid, const char* password) { //TODO make timeout config or parameter??
strncpy(_ssid, ssid, sizeof _ssid);
strncpy(_password, password, sizeof _password);
flags.apConfigured = true;
Expand Down Expand Up @@ -394,7 +395,7 @@ bool ESP8266wifi::send(char channel, String& message, bool sendNow) {
return send(channel, message.c_str(), sendNow);
}

bool ESP8266wifi::send(char channel, const char * message, bool sendNow){
bool ESP8266wifi::send(char channel, const char * message, bool sendNow) {
watchdog();
byte avail = sizeof(msgOut) - strlen(msgOut) - 1;
strncat(msgOut, message, avail);
Expand All @@ -415,7 +416,7 @@ bool ESP8266wifi::send(char channel, const char * message, bool sendNow){
_serialOut -> println(msgOut);
else
_serialOut -> print(msgOut);
byte sendStatus = readCommand(5000, SEND_OK, BUSY);
byte sendStatus = readCommand(5000, SEND_OK, BUSYC);
if (sendStatus == 1) {
msgOut[0] = '\0';
if(channel == SERVER)
Expand Down