Komut
scanNetworks()
Açıklama
Mevcut WiFi ağlarını tarar ve keşfedilen numarayı döndürür
Sözdizimi
WiFi .scanNetworks ();
Parametreler
Yok
İadeler
bayt: keşfedilen ağların sayısı
Misal
#include <SPI.h>
#include <WiFi.h>
char ssid[] = "yourNetwork"; // the name of your network
void setup() {
Serial.begin(9600);
int status = WiFi.begin(ssid);
if (status != WL_CONNECTED) {
Serial.println("Couldn't get a WiFi connection");
while (true);
}
else {
// if you are connected, scan for available WiFi networks and print the number discovered:
Serial.println("** Scan Networks **");
byte numSsid = WiFi.scanNetworks();
Serial.print("Number of available WiFi networks discovered:");
Serial.println(numSsid);
}
}
void loop() {}
#include <WiFi.h>
char ssid[] = "yourNetwork"; // the name of your network
void setup() {
Serial.begin(9600);
int status = WiFi.begin(ssid);
if (status != WL_CONNECTED) {
Serial.println("Couldn't get a WiFi connection");
while (true);
}
else {
// if you are connected, scan for available WiFi networks and print the number discovered:
Serial.println("** Scan Networks **");
byte numSsid = WiFi.scanNetworks();
Serial.print("Number of available WiFi networks discovered:");
Serial.println(numSsid);
}
}
void loop() {}