Funzione WifiConfig_GetStoredNetworksWifiConfig_GetStoredNetworks Function
Intestazione: #include <applibs/wificonfig.h>Header: #include <applibs/wificonfig.h>
Consente di recuperare tutte le reti Wi-Fi archiviate sul dispositivo.Retrieves all stored Wi-Fi networks on the device. Questa funzione non è thread-safe.This function is not thread safe.
Nota
Prima di chiamare WifiConfig_GetStoredNetworks, è necessario chiamare WifiConfig_GetStoredNetworkCount e usare il risultato come dimensioni della matrice WifiConfig_StoredNetwork passata come parametro storedNetworkArray
.Before you call WifiConfig_GetStoredNetworks, you must call WifiConfig_GetStoredNetworkCount and use the result as the array size for the WifiConfig_StoredNetwork array that is passed in as the storedNetworkArray
parameter.
Se
storedNetworkArray
è troppo piccolo per contenere tutte le reti Wi-Fi archiviate, questa funzione riempie la matrice e restituisce il numero di elementi della matrice.IfstoredNetworkArray
is too small to hold all the stored Wi-Fi networks, this function fills the array and returns the number of array elements.Se la funzionalità WiFiConfig non è presente, la funzione restituisce una matrice vuota.If the WiFiConfig capability is not present, the function returns an empty array.
ssize_t WifiConfig_GetStoredNetworks(WifiConfig_StoredNetwork * storedNetworkArray, size_t storedNetworkArrayCount);
ParametriParameters
storedNetworkArray
Un puntatore a una matrice che restituisce le reti Wi-Fi archiviate.storedNetworkArray
A pointer to an array that returns the stored Wi-Fi networks.storedNetworkArrayCount
Il numero di elementistoredNetworkArray
che può contenere.storedNetworkArrayCount
The number of elementsstoredNetworkArray
can hold. La matrice deve avere un elemento per ogni rete Wi-Fi archiviata.The array should have one element for each stored Wi-Fi network.
ErrorsErrors
Restituisce-1 se viene rilevato un errore e imposta sul errno
valore di errore.Returns -1 if an error is encountered and sets errno
to the error value.
EACCES: il manifesto dell'applicazione non include la funzionalità WifiConfig.EACCES: the application manifest does not include the WifiConfig capability.
EFAULT: il parametro
storedNetworkArray
è NULL.EFAULT: thestoredNetworkArray
parameter is NULL.ERANGE: il parametro
storedNetworkArrayCount
è 0.ERANGE: thestoredNetworkArrayCount
parameter is 0.EINVAL: il parametro
storedNetworkArray
o la versione dello struct non è valida.EINVAL: thestoredNetworkArray
parameter or its struct version is invalid.EAGAIN: il dispositivo Wi-Fi non è ancora pronto.EAGAIN: the Wi-Fi device isn't ready yet.
errno
È possibile specificare anche qualsiasi altro tipo di errore. tali errori non sono deterministici e lo stesso comportamento potrebbe non essere mantenuto tramite gli aggiornamenti del sistema.Any other errno
may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.
Valore restituitoReturn value
Restituisce il numero di elementi nella matrice di WifiConfig_StoredNetwork , oppure-1 per l'errore, nel qual caso errno
viene impostato sul valore di errore.Returns the number of elements in the WifiConfig_StoredNetwork array, or -1 for failure, in which case errno
is set to the error value.
Requisiti del manifesto dell'applicazioneApplication manifest requirements
Il manifesto dell'applicazione deve includere la funzionalità WifiConfig.The application manifest must include the WifiConfig capability.