le_wifiClient_interface.h
Go to the documentation of this file.
41 * To subscribe to wifi events le_wifiClient_AddConnectionEventHandler() is to be called. The event43 * - le_wifiClient_AddConnectionEventHandler(): returns the handler reference if the call went ok.230 * So, the SSID of this Access Point must be known in advance. Then, use the following function to234 * Finally and when the Access Point parameters have been configured, use the following function to269 * encrypted and can only be accessed by the wifiClient component. But to allow easy cross-checking270 * and debugging of non-confidential Wifi configurations, an SSID's configured security protocol is272 * "dataConnectionService:/wifi/channel/<ssid>/secProtocol" as in the following example. Note that273 * an application doesn't need to explicitly set this onto the config tree itself, but can use the274 * APIs to be explained in the upcoming subsections for configuring security to complete this step.288 * The le_wifiClient_RemoveSsidSecurityConfigs() function can be used for the following purposes:344 * are provided, pass-phrase has precedence and will be used. But it fails to authenticate during378 * The following is an example of how to use this API. Both the user name and password inputs have413 * security protocol type and its involved user credentials, e.g. WEP key for WEP, pass phrase or415 * - Load other pre-configured Wifi configuration: So far there is only the Wifi hidden attribute417 * - Create an AP object reference: This reference is created for this given and configured SSID.446 * During the time when this AP reference is set for use, there comes the need to be able to query447 * le_wifiClient for it back. This is what this le_wifiClient_GetCurrentConnection() API seeks to494 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------504 * Connect the current client thread to the service providing this API. Block until the service is507 * For each thread that wants to use this API, either ConnectService or TryConnectService must be508 * called before any other functions in this API. Normally, ConnectService is automatically called513 //--------------------------------------------------------------------------------------------------519 //--------------------------------------------------------------------------------------------------522 * Try to connect the current client thread to the service providing this API. Return with an error525 * For each thread that wants to use this API, either ConnectService or TryConnectService must be526 * called before any other functions in this API. Normally, ConnectService is automatically called535 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).538 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------548 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants551 //--------------------------------------------------------------------------------------------------558 //--------------------------------------------------------------------------------------------------564 * longer a connection to the service, and the functions in this API can't be used. For details, see569 //--------------------------------------------------------------------------------------------------576 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------583 //--------------------------------------------------------------------------------------------------587 //--------------------------------------------------------------------------------------------------590 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------597 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------604 //--------------------------------------------------------------------------------------------------610 //--------------------------------------------------------------------------------------------------613 //--------------------------------------------------------------------------------------------------617 //--------------------------------------------------------------------------------------------------620 //--------------------------------------------------------------------------------------------------622 * WiFi event indication structure. The disconnectionCause only applies to event EVENT_DISCONNECTED.624 //--------------------------------------------------------------------------------------------------627 //--------------------------------------------------------------------------------------------------631 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------641 //--------------------------------------------------------------------------------------------------649 //--------------------------------------------------------------------------------------------------658 //--------------------------------------------------------------------------------------------------662 //--------------------------------------------------------------------------------------------------669 //--------------------------------------------------------------------------------------------------676 //--------------------------------------------------------------------------------------------------685 //--------------------------------------------------------------------------------------------------689 //--------------------------------------------------------------------------------------------------696 //--------------------------------------------------------------------------------------------------705 //--------------------------------------------------------------------------------------------------711 //--------------------------------------------------------------------------------------------------720 //--------------------------------------------------------------------------------------------------726 //--------------------------------------------------------------------------------------------------736 //--------------------------------------------------------------------------------------------------742 //--------------------------------------------------------------------------------------------------750 //--------------------------------------------------------------------------------------------------756 //--------------------------------------------------------------------------------------------------766 //--------------------------------------------------------------------------------------------------772 //--------------------------------------------------------------------------------------------------782 //--------------------------------------------------------------------------------------------------789 //--------------------------------------------------------------------------------------------------799 //--------------------------------------------------------------------------------------------------810 //--------------------------------------------------------------------------------------------------822 //--------------------------------------------------------------------------------------------------833 //--------------------------------------------------------------------------------------------------841 //--------------------------------------------------------------------------------------------------848 //--------------------------------------------------------------------------------------------------859 //--------------------------------------------------------------------------------------------------868 //--------------------------------------------------------------------------------------------------877 * @note This is one way to authenticate against the access point. The other one is provided by the878 * le_wifiClient_SetPassPhrase() function. Both ways are exclusive and are effective only when used881 //--------------------------------------------------------------------------------------------------891 //--------------------------------------------------------------------------------------------------900 //--------------------------------------------------------------------------------------------------909 //--------------------------------------------------------------------------------------------------919 //--------------------------------------------------------------------------------------------------930 //--------------------------------------------------------------------------------------------------938 //--------------------------------------------------------------------------------------------------947 //--------------------------------------------------------------------------------------------------949 * This function specifies whether the target Access Point is hiding its presence from clients or956 * @note By default, this attribute is not set which means that the client is unable to connect to960 //--------------------------------------------------------------------------------------------------969 //--------------------------------------------------------------------------------------------------980 //--------------------------------------------------------------------------------------------------989 //--------------------------------------------------------------------------------------------------1000 //--------------------------------------------------------------------------------------------------1007 //--------------------------------------------------------------------------------------------------1016 * @note For PSK credentials see le_wifiClient_SetPassphrase() or le_wifiClient_SetPreSharedKey() .1019 //--------------------------------------------------------------------------------------------------1026 //--------------------------------------------------------------------------------------------------1034 //--------------------------------------------------------------------------------------------------1040 //--------------------------------------------------------------------------------------------------1050 //--------------------------------------------------------------------------------------------------1061 //--------------------------------------------------------------------------------------------------1071 //--------------------------------------------------------------------------------------------------1084 //--------------------------------------------------------------------------------------------------1089 * Besides, it's mandatory to have at least one of the pass-phrase and pre-shared key supplied. If1099 //--------------------------------------------------------------------------------------------------1118 //--------------------------------------------------------------------------------------------------1120 * Configure the given SSID to use EAP and the given EAP username and password in the respective1123 * LE_WIFICLIENT_SECURITY_WPA2_EAP_PEAP0_ENTERPRISE. Besides, both the username and password inputs1132 //--------------------------------------------------------------------------------------------------1151 //--------------------------------------------------------------------------------------------------1153 * Remove and clear Wifi's security configurations to use with the given SSID from the config tree1155 * passphrase, pre-shared key, key, etc., previously configured via le_wifiClient_Configure APIs for1162 //--------------------------------------------------------------------------------------------------le_result_t le_wifiClient_RemoveSsidSecurityConfigs(const uint8_t *ssidPtr, size_t ssidSize)le_result_t le_wifiClient_ConfigureWep(const uint8_t *ssidPtr, size_t ssidSize, const uint8_t *wepKeyPtr, size_t wepKeySize)le_wifiClient_AccessPointRef_t le_wifiClient_GetNextAccessPoint(void)void(* le_wifiClient_DisconnectHandler_t)(void *)Definition: le_wifiClient_interface.h:499void le_wifiClient_ConnectService(void)le_result_t le_wifiClient_GetBssid(le_wifiClient_AccessPointRef_t accessPointRef, char *bssid, size_t bssidSize)le_result_t le_wifiClient_SetUserCredentials(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL userName, const char *LE_NONNULL password)le_result_t le_wifiClient_GetSsid(le_wifiClient_AccessPointRef_t accessPointRef, uint8_t *ssidPtr, size_t *ssidSizePtr)le_result_t le_wifiClient_ConfigureEap(const uint8_t *ssidPtr, size_t ssidSize, le_wifiClient_SecurityProtocol_t protocol, const uint8_t *usernamePtr, size_t usernameSize, const uint8_t *passwordPtr, size_t passwordSize)le_result_t le_wifiClient_LoadSsid(const uint8_t *ssidPtr, size_t ssidSize, le_wifiClient_AccessPointRef_t *apRefPtr)le_result_t le_wifiClient_Start(void)void le_wifiClient_RemoveConnectionEventHandler(le_wifiClient_ConnectionEventHandlerRef_t handlerRef)le_result_t le_wifiClient_Stop(void)int16_t le_wifiClient_GetSignalStrength(le_wifiClient_AccessPointRef_t accessPointRef)le_result_t le_wifiClient_SetSecurityProtocol(le_wifiClient_AccessPointRef_t accessPointRef, le_wifiClient_SecurityProtocol_t securityProtocol)le_result_t le_wifiClient_SetWepKey(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL wepKey)le_result_t le_wifiClient_SetHiddenNetworkAttribute(le_wifiClient_AccessPointRef_t accessPointRef, bool hidden)le_result_t le_wifiClient_Delete(le_wifiClient_AccessPointRef_t accessPointRef)le_result_t le_wifiClient_SetPreSharedKey(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL PreSharedKey)le_result_t le_wifiClient_Disconnect(void)void le_wifiClient_RemoveNewEventHandler(le_wifiClient_NewEventHandlerRef_t handlerRef)LE_FULL_API void le_wifiClient_SetServerDisconnectHandler(le_wifiClient_DisconnectHandler_t disconnectHandler, void *contextPtr)le_wifiClient_AccessPointRef_t le_wifiClient_Create(const uint8_t *SsidPtr, size_t SsidSize)void le_wifiClient_GetCurrentConnection(le_wifiClient_AccessPointRef_t *apRefPtr)le_result_t le_wifiClient_TryConnectService(void)le_result_t le_wifiClient_ConfigurePsk(const uint8_t *ssidPtr, size_t ssidSize, le_wifiClient_SecurityProtocol_t protocol, const uint8_t *passPhrasePtr, size_t passPhraseSize, const uint8_t *pskPtr, size_t pskSize)le_result_t le_wifiClient_Scan(void)le_wifiClient_ConnectionEventHandlerRef_t le_wifiClient_AddConnectionEventHandler(le_wifiClient_ConnectionEventHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_wifiClient_Connect(le_wifiClient_AccessPointRef_t accessPointRef)void le_wifiClient_DisconnectService(void)le_wifiClient_AccessPointRef_t le_wifiClient_GetFirstAccessPoint(void)le_wifiClient_NewEventHandlerRef_t le_wifiClient_AddNewEventHandler(le_wifiClient_NewEventHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_wifiClient_SetPassphrase(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL PassPhrase)