WifiConfig_GetConnectedNetworkId function

Header: #include <applibs/wificonfig.h>

Gets the network ID of the currently connected network.

The network ID may change as network configurations are added and removed. If the device has been rebooted or network configurations have been added or removed, the application should retrieve the current network ID before it changes any stored network configurations.

int WifiConfig_GetConnectedNetworkId();

Parameters

None.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EACCES: the application manifest doesn't include the WifiConfig capability.

  • ENOTCONN: the device is not currently connected to any network.

  • EAGAIN: the Wi-Fi device isn't ready.

  • ENETDOWN: the Wi-Fi network interface is unavailable.

Any other errno may also be specified; such errors aren't deterministic and there's no guarantee that the same behavior will be retained through system updates.

Return value

Returns the network ID of the connected network, or -1 for failure, in which case errno is set to the error value.

Application manifest requirements

The application manifest must include the WifiConfig capability.