API Reference Manual
r8267
|
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, void(*channel_cb)(void *ctx, int status), void *ctx) |
Set the channel. Only supported when mode is WLP_MODE_AP. | |
int | wlp_conf_ap (int hidden, int beacon_intvl, int inact_tmo, const char *country) |
Configure parameters for access point mode. |
These functions manage the access point mode.
int wlp_conf_ap | ( | int | hidden, |
int | beacon_intvl, | ||
int | inact_tmo, | ||
const char * | country | ||
) |
Configure parameters for access point mode.
Configure the parameters that will be used when the device is in access point mode, WLP_MODE_AP.
hidden | can be set to non-zero in order to configure the device with hidden SSID. This means that the device will not broadcast its SSID, but it will still respond to clients that already knows the SSID. |
beacon_intvl | specifies interval in which beacons are transmitted by the device. This parameter does not have any effect if hidden is 0 |
inact_tmo | specifies the idle time in minutes before the device will disconnect an inactive client. |
country | specifies the region that should be advertised by the device. Will not be changed if NULL. |
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.
mode | will hold the current mode upon successful return. This will be either WLP_MODE_STA or WLP_MODE_AP. |
int wlp_set_channel | ( | uint8_t | channel, |
void(*)(void *ctx, int status) | channel_cb, | ||
void * | ctx | ||
) |
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.
channel | is the new channel (1-13). |
channel_cb | Callback that will be invoked when the channel has be changed successfully. Status will be 0 on success. |
ctx | is an opaque context pointer that will be passed back to channel_cb. |
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().
mode | is the mode to configure. This must be either WLP_MODE_STA, WLP_MODE_ADHOC or WLP_MODE_AP. |