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 to498 //--------------------------------------------------------------------------------------------------502 //--------------------------------------------------------------------------------------------------505 //--------------------------------------------------------------------------------------------------508 * Connect the current client thread to the service providing this API. Block until the service is511 * For each thread that wants to use this API, either ConnectService or TryConnectService must be512 * called before any other functions in this API. Normally, ConnectService is automatically called517 //--------------------------------------------------------------------------------------------------523 //--------------------------------------------------------------------------------------------------526 * Try to connect the current client thread to the service providing this API. Return with an error529 * For each thread that wants to use this API, either ConnectService or TryConnectService must be530 * called before any other functions in this API. Normally, ConnectService is automatically called539 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).542 //--------------------------------------------------------------------------------------------------548 //--------------------------------------------------------------------------------------------------552 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants555 //--------------------------------------------------------------------------------------------------562 //--------------------------------------------------------------------------------------------------568 * longer a connection to the service, and the functions in this API can't be used. For details, see573 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------584 //--------------------------------------------------------------------------------------------------587 //--------------------------------------------------------------------------------------------------591 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------605 //--------------------------------------------------------------------------------------------------608 //--------------------------------------------------------------------------------------------------614 //--------------------------------------------------------------------------------------------------617 //--------------------------------------------------------------------------------------------------621 //--------------------------------------------------------------------------------------------------624 //--------------------------------------------------------------------------------------------------626 * WiFi event indication structure. The disconnectionCause only applies to event EVENT_DISCONNECTED.628 //--------------------------------------------------------------------------------------------------631 //--------------------------------------------------------------------------------------------------635 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------642 //--------------------------------------------------------------------------------------------------645 //--------------------------------------------------------------------------------------------------653 //--------------------------------------------------------------------------------------------------662 //--------------------------------------------------------------------------------------------------666 //--------------------------------------------------------------------------------------------------673 //--------------------------------------------------------------------------------------------------680 //--------------------------------------------------------------------------------------------------689 //--------------------------------------------------------------------------------------------------693 //--------------------------------------------------------------------------------------------------700 //--------------------------------------------------------------------------------------------------709 //--------------------------------------------------------------------------------------------------715 //--------------------------------------------------------------------------------------------------724 //--------------------------------------------------------------------------------------------------730 //--------------------------------------------------------------------------------------------------740 //--------------------------------------------------------------------------------------------------746 //--------------------------------------------------------------------------------------------------754 //--------------------------------------------------------------------------------------------------760 //--------------------------------------------------------------------------------------------------770 //--------------------------------------------------------------------------------------------------776 //--------------------------------------------------------------------------------------------------786 //--------------------------------------------------------------------------------------------------793 //--------------------------------------------------------------------------------------------------803 //--------------------------------------------------------------------------------------------------814 //--------------------------------------------------------------------------------------------------826 //--------------------------------------------------------------------------------------------------837 //--------------------------------------------------------------------------------------------------845 //--------------------------------------------------------------------------------------------------852 //--------------------------------------------------------------------------------------------------863 //--------------------------------------------------------------------------------------------------872 //--------------------------------------------------------------------------------------------------881 * @note This is one way to authenticate against the access point. The other one is provided by the882 * le_wifiClient_SetPassPhrase() function. Both ways are exclusive and are effective only when used885 //--------------------------------------------------------------------------------------------------895 //--------------------------------------------------------------------------------------------------904 //--------------------------------------------------------------------------------------------------913 //--------------------------------------------------------------------------------------------------923 //--------------------------------------------------------------------------------------------------934 //--------------------------------------------------------------------------------------------------942 //--------------------------------------------------------------------------------------------------951 //--------------------------------------------------------------------------------------------------953 * This function specifies whether the target Access Point is hiding its presence from clients or960 * @note By default, this attribute is not set which means that the client is unable to connect to964 //--------------------------------------------------------------------------------------------------973 //--------------------------------------------------------------------------------------------------984 //--------------------------------------------------------------------------------------------------993 //--------------------------------------------------------------------------------------------------1004 //--------------------------------------------------------------------------------------------------1011 //--------------------------------------------------------------------------------------------------1020 * @note For PSK credentials see le_wifiClient_SetPassphrase() or le_wifiClient_SetPreSharedKey() .1023 //--------------------------------------------------------------------------------------------------1030 //--------------------------------------------------------------------------------------------------1038 //--------------------------------------------------------------------------------------------------1044 //--------------------------------------------------------------------------------------------------1054 //--------------------------------------------------------------------------------------------------1065 //--------------------------------------------------------------------------------------------------1075 //--------------------------------------------------------------------------------------------------1088 //--------------------------------------------------------------------------------------------------1093 * Besides, it's mandatory to have at least one of the pass-phrase and pre-shared key supplied. If1103 //--------------------------------------------------------------------------------------------------1122 //--------------------------------------------------------------------------------------------------1124 * Configure the given SSID to use EAP and the given EAP username and password in the respective1127 * LE_WIFICLIENT_SECURITY_WPA2_EAP_PEAP0_ENTERPRISE. Besides, both the username and password inputs1136 //--------------------------------------------------------------------------------------------------1155 //--------------------------------------------------------------------------------------------------1157 * Remove and clear Wifi's security configurations to use with the given SSID from the config tree1159 * passphrase, pre-shared key, key, etc., previously configured via le_wifiClient_Configure APIs for1166 //--------------------------------------------------------------------------------------------------1175 //--------------------------------------------------------------------------------------------------1187 //--------------------------------------------------------------------------------------------------1194 //--------------------------------------------------------------------------------------------------1204 //--------------------------------------------------------------------------------------------------1211 //--------------------------------------------------------------------------------------------------1221 //--------------------------------------------------------------------------------------------------le_result_t le_wifiClient_Stop(void)le_result_t le_wifiClient_RemoveSsidSecurityConfigs(const uint8_t *ssidPtr, size_t ssidSize)void le_wifiClient_GetCurrentConnection(le_wifiClient_AccessPointRef_t *apRefPtr)void(* le_wifiClient_ConnectionEventHandlerFunc_t)(const le_wifiClient_EventInd_t *LE_NONNULL wifiEventIndPtr, void *contextPtr)Definition: le_wifiClient_common.h:163le_result_t le_wifiClient_SetUserCredentials(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL userName, const char *LE_NONNULL password)void le_wifiClient_ConnectService(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_GetTxData(uint64_t *txDataPtr)le_result_t le_wifiClient_GetBssid(le_wifiClient_AccessPointRef_t accessPointRef, char *bssid, size_t bssidSize)le_result_t le_wifiClient_Scan(void)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)struct le_wifiClient_ConnectionEventHandler * le_wifiClient_ConnectionEventHandlerRef_tDefinition: le_wifiClient_common.h:139void(* le_wifiClient_NewEventHandlerFunc_t)(le_wifiClient_Event_t event, void *contextPtr)Definition: le_wifiClient_common.h:150void le_wifiClient_DisconnectService(void)le_result_t le_wifiClient_Start(void)void(* le_wifiClient_DisconnectHandler_t)(void *)Definition: le_wifiClient_interface.h:503le_result_t le_wifiClient_ConfigureWep(const uint8_t *ssidPtr, size_t ssidSize, const uint8_t *wepKeyPtr, size_t wepKeySize)le_result_t le_wifiClient_SetPreSharedKey(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL PreSharedKey)le_result_t le_wifiClient_Connect(le_wifiClient_AccessPointRef_t accessPointRef)struct le_wifiClient_NewEventHandler * le_wifiClient_NewEventHandlerRef_tDefinition: le_wifiClient_common.h:116le_result_t le_wifiClient_LoadSsid(const uint8_t *ssidPtr, size_t ssidSize, le_wifiClient_AccessPointRef_t *apRefPtr)struct le_wifiClient_AccessPoint * le_wifiClient_AccessPointRef_tDefinition: le_wifiClient_common.h:43void le_wifiClient_RemoveConnectionEventHandler(le_wifiClient_ConnectionEventHandlerRef_t handlerRef)le_wifiClient_SecurityProtocol_tDefinition: le_wifiClient_common.h:93le_result_t le_wifiClient_Disconnect(void)LE_FULL_API void le_wifiClient_SetServerDisconnectHandler(le_wifiClient_DisconnectHandler_t disconnectHandler, void *contextPtr)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)le_wifiClient_AccessPointRef_t le_wifiClient_GetNextAccessPoint(void)le_wifiClient_ConnectionEventHandlerRef_t le_wifiClient_AddConnectionEventHandler(le_wifiClient_ConnectionEventHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_wifiClient_TryConnectService(void)le_result_t le_wifiClient_GetSsid(le_wifiClient_AccessPointRef_t accessPointRef, uint8_t *ssidPtr, size_t *ssidSizePtr)int16_t le_wifiClient_GetSignalStrength(le_wifiClient_AccessPointRef_t accessPointRef)le_result_t le_wifiClient_SetWepKey(le_wifiClient_AccessPointRef_t accessPointRef, const char *LE_NONNULL wepKey)le_wifiClient_AccessPointRef_t le_wifiClient_GetFirstAccessPoint(void)le_result_t le_wifiClient_GetRxData(uint64_t *rxDataPtr)void le_wifiClient_RemoveNewEventHandler(le_wifiClient_NewEventHandlerRef_t handlerRef)le_result_t le_wifiClient_Delete(le_wifiClient_AccessPointRef_t accessPointRef)le_result_t le_wifiClient_GetCurrentSignalStrength(int16_t *signalStrengthPtr)le_wifiClient_AccessPointRef_t le_wifiClient_Create(const uint8_t *SsidPtr, size_t SsidSize)le_result_t le_wifiClient_SetSecurityProtocol(le_wifiClient_AccessPointRef_t accessPointRef, le_wifiClient_SecurityProtocol_t securityProtocol)le_result_t le_wifiClient_SetHiddenNetworkAttribute(le_wifiClient_AccessPointRef_t accessPointRef, bool hidden)