AliOS Things API HAL WiFi Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki
- 1 hal_wifi_get_default_module
- 2 hal_wifi_register_module
- 3 hal_wifi_init
- 4 hal_wifi_get_mac_addr
- 5 hal_wifi_start
- 6 hal_wifi_start_adv
- 7 hal_wifi_get_ip_stat
- 8 hal_wifi_get_link_stat
- 9 hal_wifi_start_scan
- 10 hal_wifi_start_scan_adv
- 11 hal_wifi_power_off
- 12 hal_wifi_power_on
- 13 hal_wifi_suspend
- 14 hal_wifi_suspend_station
- 15 hal_wifi_suspend_soft_ap
- 16 hal_wifi_set_channel
- 17 hal_wifi_start_wifi_monitor
- 18 hal_wifi_stop_wifi_monitor
- 19 hal_wifi_register_monitor_cb
- 20 hal_wifi_install_event
hal_wifi_module_t *hal_wifi_get_default_module(void)
-
Description
Get the default wifi instance. The system may have more than one wifi instance, this API returns the default one.
-
Parameters
None.
-
Returns
Instance pointer, or NULL if no instance registered.
void hal_wifi_register_module(hal_wifi_module_t *m)
-
Description
Regster a wifi instance to the HAL framework.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance. -
Returns
None.
int hal_wifi_init(void)
-
Description
Initialize wifi instances.
-
Parameters
None.
-
Returns
0 on success, otherwise failure.
void hal_wifi_get_mac_addr(hal_wifi_module_t *m, uint8_t *mac)
-
Description
Get the MAC address of the specified wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [out] mac the place to hold the result. -
Returns
None.
int hal_wifi_start(hal_wifi_module_t *m, hal_wifi_init_type_t *init_para)
-
Description
Start the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [in] init_para the config used to start the wifi. -
Returns
0 on success, otherwise failure.
int hal_wifi_start_adv(hal_wifi_module_t *m, hal_wifi_init_type_adv_t *init_para_adv)
-
Description
Start the wifi instance in anvanced way (more config specified).
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [in] init_para_adv the advanced config used to start the wifi. -
Returns
0 on success, otherwise failure.
int hal_wifi_get_ip_stat(hal_wifi_module_t *m,
hal_wifi_ip_stat_t *out_net_para, hal_wifi_type_t wifi_type)
-
Description
Get the status of the specified wifi instance, e.g. the IP, mask, dhcp mode, etc.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [out] out_net_para the place to hold the results. [in] wifi_type SOFT_AP or STATION. -
Returns
0 on success, otherwise failure.
int hal_wifi_get_link_stat(hal_wifi_module_t *m, hal_wifi_link_stat_t *out_stat)
-
Description
Get the link status of the wifi instance ,e.g. ssid, bssid, channel, rssi, etc.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [out] out_stat the place to hold the results. -
Returns
0 on success, otherwise failure.
void hal_wifi_start_scan(hal_wifi_module_t *m)
-
Description
Start the scanning of the specified wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
None.
void hal_wifi_start_scan_adv(hal_wifi_module_t *m)
-
Description
Start the scanning of the specified wifi instance in advanced way.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
None.
int hal_wifi_power_off(hal_wifi_module_t *m)
-
Description
Power off the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
int hal_wifi_power_on(hal_wifi_module_t *m)
-
Description
Power on the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
int hal_wifi_suspend(hal_wifi_module_t *m)
-
Description
Suspend the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
int hal_wifi_suspend_station(hal_wifi_module_t *m)
-
Description
Suspend the wifi instance in station mode.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
int hal_wifi_suspend_soft_ap(hal_wifi_module_t *m)
-
Description
Suspend the wifi instance in soft_ap mode.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
int hal_wifi_set_channel(hal_wifi_module_t *m, int ch)
-
Description
Set the channel of the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
0 on success, otherwise failure.
void hal_wifi_start_wifi_monitor(hal_wifi_module_t *m)
-
Description
Start the monitor mode of the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. -
Returns
None.
void hal_wifi_stop_wifi_monitor(hal_wifi_module_t *m)
-
Description
Stop the monitor mode of the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m The wifi instance, NULL if default. -
Returns
None.
void hal_wifi_register_monitor_cb(hal_wifi_module_t *m, monitor_data_cb_t fn)
-
Description
Register the montior callback on the wifi instance.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL if default. [in] fn the callback function. -
Returns
None.
void hal_wifi_install_event(hal_wifi_module_t *m, const hal_wifi_event_cb_t *cb)
-
Description
Set the event callback function array for the wifi. Please don't do time consuming work in these callbacks.
-
Parameters
IN/OUT NAME DESC [in] m the wifi instance, NULL for default. [in] cb the event callback function info. -
Returns
None.