Skip to content

Commit

Permalink
Option to disable network scanning (#392, #399). Scan networks from w…
Browse files Browse the repository at this point in the history
…eb UI
  • Loading branch information
xoseperez committed Jan 14, 2018
1 parent a716633 commit a5df00b
Show file tree
Hide file tree
Showing 14 changed files with 3,380 additions and 3,247 deletions.
1 change: 1 addition & 0 deletions code/espurna/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ PROGMEM const char* const custom_reset_string[] = {
#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations
#define WIFI_AP_MODE AP_MODE_ALONE
#define WIFI_SLEEP_ENABLED 1 // Enable WiFi light sleep
#define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting

// Optional hardcoded configuration (up to 2 different networks)
//#define WIFI1_SSID "..."
Expand Down
2 changes: 1 addition & 1 deletion code/espurna/config/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef std::function<void(JsonObject&)> ws_on_send_callback_f;
void wsOnSendRegister(ws_on_send_callback_f callback);
void wsSend(ws_on_send_callback_f sender);

typedef std::function<void(const char *, JsonObject&)> ws_on_action_callback_f;
typedef std::function<void(uint32_t, const char *, JsonObject&)> ws_on_action_callback_f;
void wsOnActionRegister(ws_on_action_callback_f callback);

typedef std::function<void(void)> ws_on_after_parse_callback_f;
Expand Down
Binary file modified code/espurna/data/index.html.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion code/espurna/light.ino
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void _lightWebSocketOnSend(JsonObject& root) {
}
}

void _lightWebSocketOnAction(const char * action, JsonObject& data) {
void _lightWebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) {

if (_light_has_color) {

Expand Down
2 changes: 1 addition & 1 deletion code/espurna/relay.ino
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ void _relayWebSocketOnStart(JsonObject& root) {

}

void _relayWebSocketOnAction(const char * action, JsonObject& data) {
void _relayWebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) {

if (strcmp(action, "relay") != 0) return;

Expand Down
2 changes: 1 addition & 1 deletion code/espurna/rfbridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void _rfbWebSocketOnSend(JsonObject& root) {
}
}

void _rfbWebSocketOnAction(const char * action, JsonObject& data) {
void _rfbWebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) {
if (strcmp(action, "rfblearn") == 0) rfbLearn(data["id"], data["status"]);
if (strcmp(action, "rfbforget") == 0) rfbForget(data["id"], data["status"]);
if (strcmp(action, "rfbsend") == 0) rfbStore(data["id"], data["status"], data["data"].as<const char*>());
Expand Down
9 changes: 4 additions & 5 deletions code/espurna/settings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ void _settingsHelp() {
}

// Output the list
DEBUG_MSG_P(PSTR("\nAvailable commands:\n\n"));
DEBUG_MSG_P(PSTR("Available commands:\n"));
for (unsigned char i=0; i<commands.size(); i++) {
DEBUG_MSG_P(PSTR("* %s\n"), (commands[i]).c_str());
DEBUG_MSG_P(PSTR("> %s\n"), (commands[i]).c_str());
}

}
Expand Down Expand Up @@ -143,12 +143,11 @@ void _settingsKeys() {
}

// Write key-values
DEBUG_MSG_P(PSTR("\n"));
DEBUG_MSG_P(PSTR("Current settings:\n"));
for (unsigned int i=0; i<keys.size(); i++) {
String value = getSetting(keys[i]);
DEBUG_MSG_P(PSTR("+%s => %s\n"), (keys[i]).c_str(), value.c_str());
DEBUG_MSG_P(PSTR("> %s => %s\n"), (keys[i]).c_str(), value.c_str());
}
DEBUG_MSG_P(PSTR("\n"));

unsigned long freeEEPROM = SPI_FLASH_SEC_SIZE - _settingsSize();
DEBUG_MSG_P(PSTR("Number of keys: %d\n"), keys.size());
Expand Down
6,276 changes: 3,158 additions & 3,118 deletions code/espurna/static/index.html.gz.h

Large diffs are not rendered by default.

Loading

0 comments on commit a5df00b

Please sign in to comment.