Funzione WifiConfig_SetNetworkEnabledWifiConfig_SetNetworkEnabled Function
Intestazione: #include <applibs/wificonfig.h>Header: #include <applibs/wificonfig.h>
Abilita o disabilita una configurazione di rete Wi-Fi.Enables or disables a Wi-Fi network configuration.
L'impostazione viene applicata immediatamente, ma non viene mantenuta da un riavvio all'altro del dispositivo, a meno che non venga chiamata la funzione WifiConfig_PersistConfig dopo questa funzione.The setting is effective immediately but won't persist across device reboots unless the WifiConfig_PersistConfig function is called after this function.
static int WifiConfig_SetNetworkEnabled(int networkId, bool enabled);
ParametriParameters
networkId
ID della rete da configurare.networkId
The ID of the network to configure. WifiConfig_AddNetwork restituisce l'ID di rete.WifiConfig_AddNetwork returns the network ID.enabled
true
per abilitare la rete; in caso contrario,false
.enabled
true
to enable the network; otherwise,false
.
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 doesn't include the WifiConfig capability.
EAGAIN: il dispositivo Wi-Fi non è pronto.EAGAIN: the Wi-Fi device isn't ready.
ENETDOWN: l'interfaccia di rete Wi-Fi non è disponibile.ENETDOWN: the Wi-Fi network interface is unavailable.
EINVAL: il parametro
networkId
non è valido.EINVAL: thenetworkId
parameter is invalid.ENODEV: il parametro
networkId
non corrisponde a nessuno degli ID delle reti archiviate.ENODEV: thenetworkId
parameter doesn't match any of the IDs of the stored networks.
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 0 per l'esito positivo o-1 per l'esito negativo, nel qual caso errno
viene impostato sul valore di errore.Returns 0 for success, 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.