1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Merge pull request #802 from pgollor/SPIFFS-OTA

Flash SPIFFS over the air (OTA)
This commit is contained in:
Ivan Grokhotkov
2015-09-28 18:11:09 +03:00
9 changed files with 525 additions and 46 deletions

View File

@ -145,6 +145,17 @@ int ESP8266WiFiClass::begin(const char* ssid, const char *passphrase, int32_t ch
return status();
}
int ESP8266WiFiClass::begin()
{
ETS_UART_INTR_DISABLE();
wifi_station_connect();
ETS_UART_INTR_ENABLE();
if(!_useStaticIp)
wifi_station_dhcpc_start();
return status();
}
uint8_t ESP8266WiFiClass::waitForConnectResult(){
if ((wifi_get_opmode() & 1) == 0)//1 and 3 have STA enabled
return WL_DISCONNECTED;
@ -366,6 +377,13 @@ char* ESP8266WiFiClass::SSID()
return reinterpret_cast<char*>(conf.ssid);
}
const char* ESP8266WiFiClass::psk()
{
static struct station_config conf;
wifi_station_get_config(&conf);
return reinterpret_cast<const char*>(conf.password);
}
uint8_t* ESP8266WiFiClass::BSSID(void)
{
static struct station_config conf;

View File

@ -58,6 +58,9 @@ public:
int begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, uint8_t bssid[6] = NULL);
int begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, uint8_t bssid[6] = NULL);
// Use sdk config to connect.
int begin();
/* Wait for Wifi connection to reach a result
* returns the status reached or disconnect if STA is off
@ -172,6 +175,13 @@ public:
*/
char* SSID();
/*
* Return the current pre shared key associated with the network
*
* return: psk string
*/
const char* psk();
/*
* Return the current bssid / mac associated with the network if configured
*