Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC.
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC.
- Parameters
-
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
- Precondition
- A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at intalization. Registering the callback is done through passing it to the m2m_wifi_init.
- The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
- See Also
- tpfAppWifiCb tenuM2mSecType m2m_wifi_init tstrM2mWifiStateChanged tstrM2MAPConfig
- Returns
- The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Example
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function
#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(
uint8 u8WiFiEvent,
void * pvMsg)
{
switch(u8WiFiEvent)
{
{
printf("STA has Associated\n");
}
break;
default:
break;
}
}
{
{
strcpy(apConfig.
au8SSID,
"WILC_SSID");
strcpy((char *)cfg.uniAuth.au8PSK, "12345678");
while(1)
{
}
}
}
The WINC IC supports the ability to operate as an access point with the following limitations:
- Only 1 station may be associated at any given time.
- Open system and WEP are the only security suites supported.
- Parameters
-
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
- Returns
- The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
- Precondition
-
- Warning
- This function is not allowed in STA mode.
- See Also
- tpfAppWifiCb tenuM2mSecType m2m_wifi_init M2M_WIFI_REQ_DHCP_CONF tstrM2mWifiStateChanged tstrM2MAPConfig
Example
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(
uint8 u8WiFiEvent,
void * pvMsg)
{
switch(u8WiFiEvent)
{
{
printf("Associated STA has IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
}
break;
default:
break;
}
}
{
{
strcpy(apConfig.
au8SSID,
"WINC_SSID");
while(1)
{
}
}
}
The WINC supports the ability to operate as an access point with the following limitations:
- Only 1 station may be associated at any given time.
- Open system and WEP are the only security suites supported.
- Parameters
-
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
- Returns
- The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
- Warning
- This function is not allowed in P2P or STA modes.
- Precondition
-
- See Also
- tpfAppWifiCb tenuM2mSecType m2m_wifi_init M2M_WIFI_REQ_DHCP_CONF tstrM2mWifiStateChanged tstrM2MAPConfig
Example
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(
uint8 u8WiFiEvent,
void * pvMsg)
{
switch(u8WiFiEvent)
{
{
printf("Associated STA has IP Address \"%u.%u.%u.%u\"\n",pu8IPAddress[0],pu8IPAddress[1],pu8IPAddress[2],pu8IPAddress[3]);
}
break;
default:
break;
}
}
{
{
strcpy(apConfig.
au8SSID,
"WINC_SSID");
while(1)
{
}
}
}