mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-21 12:29:23 +01:00
Added Check shield present on wifi examples
This commit is contained in:
parent
910111abc6
commit
bc088b6e84
@ -42,6 +42,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -54,6 +54,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -59,6 +59,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -57,6 +57,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -47,6 +47,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ void setup() {
|
||||
Serial.print("Attempting to connect to SSID: ");
|
||||
Serial.println(ssid);
|
||||
status = WiFi.begin(ssid, pass);
|
||||
if ( status != WL_CONNECTED) {
|
||||
Serial.println("Couldn't get a wifi connection");
|
||||
while(true);
|
||||
}
|
||||
// wait 10 seconds for connection:
|
||||
delay(10000);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ int8_t WiFiDrv::wifiSetNetwork(char* ssid, uint8_t ssid_len)
|
||||
if (!SpiDrv::waitResponseCmd(SET_NET_CMD, PARAM_NUMS_1, &_data, &_dataLen))
|
||||
{
|
||||
WARN("error waitResponse");
|
||||
return WL_FAILURE;
|
||||
_data = WL_FAILURE;
|
||||
}
|
||||
SpiDrv::spiSlaveDeselect();
|
||||
|
||||
@ -99,7 +99,7 @@ int8_t WiFiDrv::wifiSetPassphrase(char* ssid, uint8_t ssid_len, const char *pass
|
||||
if (!SpiDrv::waitResponseCmd(SET_PASSPHRASE_CMD, PARAM_NUMS_1, &_data, &_dataLen))
|
||||
{
|
||||
WARN("error waitResponse");
|
||||
return WL_FAILURE;
|
||||
_data = WL_FAILURE;
|
||||
}
|
||||
SpiDrv::spiSlaveDeselect();
|
||||
return _data;
|
||||
@ -124,7 +124,7 @@ int8_t WiFiDrv::wifiSetKey(char* ssid, uint8_t ssid_len, uint8_t key_idx, const
|
||||
if (!SpiDrv::waitResponseCmd(SET_KEY_CMD, PARAM_NUMS_1, &_data, &_dataLen))
|
||||
{
|
||||
WARN("error waitResponse");
|
||||
return WL_FAILURE;
|
||||
_data = WL_FAILURE;
|
||||
}
|
||||
SpiDrv::spiSlaveDeselect();
|
||||
return _data;
|
||||
@ -319,12 +319,12 @@ int8_t WiFiDrv::startScanNetworks()
|
||||
if (!SpiDrv::waitResponseCmd(START_SCAN_NETWORKS, PARAM_NUMS_1, &_data, &_dataLen))
|
||||
{
|
||||
WARN("error waitResponse");
|
||||
return WL_FAILURE;
|
||||
_data = WL_FAILURE;
|
||||
}
|
||||
|
||||
SpiDrv::spiSlaveDeselect();
|
||||
|
||||
return WL_SUCCESS;
|
||||
return (_data == WL_FAILURE)? _data : WL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user