Komut
SSID()
Açıklama
Geçerli ağın SSID'sini alır
Sözdizimi
WiFi .SSID ();
WiFi .SSID (wifiAccessPoint)
Parametreler
wifiAccessPoint : hangi ağdan bilgi alınacağını belirtir
İadeler
WiFi'nin şu anda bağlı olduğu SSID'yi içeren bir dize .
İstenen ağın adını içeren bir dize .
Misal
#include <SPI.h>
#include <WiFiNINA.h>
//SSID of your network
char ssid[] = "yourNetwork";
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup()
{
// initialize serial:
Serial.begin(9600);
// scan for existing networks:
Serial.println("Scanning available networks...");
scanNetworks();
// attempt to connect using WEP encryption:
Serial.println("Attempting to connect to open network...");
status = WiFi.begin(ssid);
Serial.print("SSID: ");
Serial.println(ssid);
}
void loop () {}
void scanNetworks() {
// scan for nearby networks:
Serial.println("** Scan Networks **");
byte numSsid = WiFi.scanNetworks();
// print the list of networks seen:
Serial.print("SSID List:");
Serial.println(numSsid);
// print the network number and name for each network found:
for (int thisNet = 0; thisNet<numSsid; thisNet++) {
Serial.print(thisNet);
Serial.print(") Network: ");
Serial.println(WiFi.SSID(thisNet));
}
}
#include <WiFiNINA.h>
//SSID of your network
char ssid[] = "yourNetwork";
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup()
{
// initialize serial:
Serial.begin(9600);
// scan for existing networks:
Serial.println("Scanning available networks...");
scanNetworks();
// attempt to connect using WEP encryption:
Serial.println("Attempting to connect to open network...");
status = WiFi.begin(ssid);
Serial.print("SSID: ");
Serial.println(ssid);
}
void loop () {}
void scanNetworks() {
// scan for nearby networks:
Serial.println("** Scan Networks **");
byte numSsid = WiFi.scanNetworks();
// print the list of networks seen:
Serial.print("SSID List:");
Serial.println(numSsid);
// print the network number and name for each network found:
for (int thisNet = 0; thisNet<numSsid; thisNet++) {
Serial.print(thisNet);
Serial.print(") Network: ");
Serial.println(WiFi.SSID(thisNet));
}
}
See Also
- begin()
- end()
- beginAP()
- beginEnterprise()
- disconnect()
- config()
- setDNS()
- setHostname()
- setTimeout()
- BSSID()
- RSSI()
- channel()
- encryptionType()
- scanNetworks()
- ping()
- status()
- macAddress()
- firmwareVersion()
- lowPowerMode()
- noLowPowerMode()
- reasonCode()
- hostByName()
- localIP()
- subnetMask()
- gatewayIP()