WiFi Access Point Service
This WiFi Service API provides Wifi Access Point setup. Please note that if there is only one wifi hardware the WiFi Access Point cannot be used at the same time as the WiFi Client service.
IPC interfaces binding
Here's a code sample binding to WiFi service:
bindings: { clientExe.clientComponent.le_wifiAp -> wifiService.le_wifiAp }
Setting parameters for the Access Point
Note that these parameters must be set before the access point is started. See each function for its default value.
To set the SSID for the Access Point use the following function:
To set the pass phrase prior for the Access Point use the function: Also see le_wifiAp_SetPreSharedKey().
Instead of setting the pass phrase, the Pre Shared Key (PSK), can be set explicitly. To set the Pre Shared Key prior for the Access Point start use the function:
Sets the security protocol to use.
Sets is the Access Point should show up in network scans or not.
Sets which channel to use.
Sets what country code to use.
Sets which IEEE standard to use.
Gets which IEEE standard was set.
//--------------------------------------------------------------------------------------------------/*** Sets the credentials*///--------------------------------------------------------------------------------------------------static void Testle_setCredentials(void){}
Starting the WiFi Access Point
The WiFi Access Point is started with the function le_wifiAp_Start(). Unless values have been changed, default values will be used:
To subscribe to wifi events le_wifiAp_AddNewEventHandler() is to be called.
//--------------------------------------------------------------------------------------------------/*** Handler for WiFi client changes**///--------------------------------------------------------------------------------------------------static void myMsgHandler(le_wifiAp_Event_t event,///< [IN]///< WiFi event to processvoid *contextPtr///< [IN]///< Associated event context){LE_INFO("WiFi access point event received");switch(event){{// Client connected to APLE_INFO("LE_WIFIAP_EVENT_CLIENT_CONNECTED");}break;{// Client disconnected from APLE_INFO("LE_WIFICLIENT_EVENT_DISCONNECTED");}break;default:LE_ERROR("ERROR Unknown event %d", event);break;}}//--------------------------------------------------------------------------------------------------/*** Tests the WiFi access point.**///--------------------------------------------------------------------------------------------------void Testle_wifiApStart(void){LE_INFO("Start Test WiFi access point");// Add an handler function to handle message receptionHdlrRef=le_wifiAp_AddNewEventHandler(myMsgHandler, NULL);LE_ASSERT(HdlrRef != NULL);Testle_setCredentials();{LE_INFO("Start OK");Testle_startDhcpServerAndbridgeConnection();}else{LE_ERROR("Start ERROR");}}
Copyright (C) Sierra Wireless Inc.