Skip to content

Commit

Permalink
support wifi scan operation for haas python
Browse files Browse the repository at this point in the history
This is to fix the build issue in mainstream.

Signed-off-by: Yilu Mao <[email protected]>
  • Loading branch information
zy20220224 authored and YiluMao committed Aug 22, 2022
1 parent 0ac264d commit f4adcc6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/amp_adapter/include/aos_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ typedef struct aos_sharemode_info {
AOS_NETWORK_SHAREMODE_E share_mode;
} aos_sharemode_info_t;

typedef struct {
char ssid[33]; /**< The SSID of an access point. */
char ap_power; /**< Received Signal Strength Indication, min: -110, max: 0 */
unsigned char bssid[6]; /**< The BSSID of an access point. */
unsigned char channel; /**< The RF frequency, 1-13 */
unsigned char sec_type; /**< details see netmgr_wifi_sec_type */
} aos_wifi_ap_list_t;

int aos_wifi_init(aos_wifi_manager_t *wifi_manager);

int aos_wifi_start(aos_wifi_manager_t *wifi_manager);
Expand All @@ -163,6 +171,8 @@ int aos_net_set_ifconfig(aos_ifconfig_info_t *info);

int aos_net_get_ifconfig(aos_ifconfig_info_t *info);

int aos_wifi_scan(aos_wifi_ap_list_t *ap_list, int ap_list_len);

/**
* @brief file close
*
Expand Down
7 changes: 7 additions & 0 deletions components/amp_adapter/platform/aos/network/aos_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ int aos_wifi_get_info(aos_wifi_info_t *wifi_info)
return 0;
}

int aos_wifi_scan(aos_wifi_ap_list_t *ap_list, int ap_list_len)
{
netmgr_wifi_ap_list_t* wifi_ap_records = (netmgr_wifi_ap_list_t *) ap_list;
int ap_num = netmgr_wifi_scan_result(wifi_ap_records, 16, NETMGR_WIFI_SCAN_TYPE_FULL);
return ap_num;
}

int aos_wifi_disconnect()
{
netmgr_hdl_t hdl;
Expand Down

0 comments on commit f4adcc6

Please sign in to comment.