WiFiNINA - WiFi.reasonCode()

Description

Return The deauthentication reason code.

Syntax

WiFi.reasonCode()

Parameters

  • None

Returns

  • The deauthentication reason code

Example

…

  while (status != WL_CONNECTED) {
        Serial.print("Attempting to connect to SSID: ");
        Serial.println(ssid);
        // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
        status = WiFi.begin(ssid, pass);
        if (status != WL_CONNECTED) {

                Serial.print("Reason code: ");
                Serial.println(WiFi.reasonCode());

        }
        // wait 10 seconds for connection:
        delay(10000);
  }

…