Functions

Access point functions

Functions

int wlp_set_mode (uint8_t mode)
 Set the Wi-Fi mode to AP or STA.
int wlp_get_mode (uint8_t *mode)
 Check if the device is currently in AP or STA mode.
int wlp_set_channel (uint8_t channel)
 Set the channel. Only supported when mode is WLP_MODE_AP.

Detailed Description

These functions manage the access point mode.


Function Documentation

int wlp_get_mode ( uint8_t *  mode  ) 

Check if the device is currently in AP or STA mode.

wlp_get_mode() will be return the current operation mode of the Wi-Fi device. Since the operation mode is persistent between power-cycles, it is generally a good idea to call this function at startup to ensure the desired operation mode.

Parameters:
mode will hold the current mode upon successful return. This will be either WL_MODE_STA or WL_MODE_AP.
Returns:
  • 0 on success
int wlp_set_channel ( uint8_t  channel  ) 

Set the channel. Only supported when mode is WLP_MODE_AP.

This function is only supported when wlp_get_mode() returns WLP_MODE_AP. wlp_set_channel() must be called before wlp_linkup() to have effect.

Returns:
  • 0 on success
  • WLP_ERR_PARAM if invalid channel
  • WLP_ERR_STATE the operation can not be carried out (e.g. ap already started).
  • WLP_ERR_NOTSUPP if operation is not supported
int wlp_set_mode ( uint8_t  mode  ) 

Set the Wi-Fi mode to AP or STA.

wlp_set_mode() will configure the Wi-Fi device to operate either as a station or as an access point. The current mode can be obtained through wlp_get_mode(). Note that the mode configured through wlp_set_mode() only takes effect after wlp_reset() has been called. The configured mode persists after power-cycling the device.

Parameters:
mode is the mode to configure. This must be either WL_MODE_STA or WL_MODE_AP.
Returns:
  • 0 on success