Funzione WifiConfig_SetSecurityTypeWifiConfig_SetSecurityType Function
Intestazione: #include <applibs/wificonfig.h>Header: #include <applibs/wificonfig.h>
Imposta il tipo di sicurezza per una rete Wi-Fi.Sets the security type for a Wi-Fi network.
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_SetSecurityType(int networkId, WifiConfig_Security_Type securityType);
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.securityType
Tipo di sicurezza per la rete specificata.securityType
The security type for the specified 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 o EnterpriseWifiConfig.EACCES: the application manifest doesn't include the WifiConfig or EnterpriseWifiConfig capability. La funzionalità EnterpriseWifiConfig è obbligatoria se il valore di
securityType
è WifiConfig_Security_Wpa2_EAP_TLS.The EnterpriseWifiConfig capability is required ifsecurityType
is WifiConfig_Security_Wpa2_EAP_TLS.EINVAL: il parametro
securityType
non è valido.EINVAL: thesecurityType
parameter is invalid.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 oppure, per le reti EAP-TLS, la funzionalità EnterpriseWifiConfig.The application manifest must include the WifiConfig or, for EAP-TLS networks, the EnterpriseWifiConfig capability.