Skip to content

Commit 30e4f51

Browse files
zy20220224YiluMao
authored andcommitted
support wifi scan operation for haas python
This is to fix the build issue in mainstream. Signed-off-by: Yilu Mao <[email protected]>
1 parent 354a1c7 commit 30e4f51

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

components/amp_adapter/include/aos_network.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ typedef struct aos_sharemode_info {
143143
AOS_NETWORK_SHAREMODE_E share_mode;
144144
} aos_sharemode_info_t;
145145

146+
typedef struct {
147+
char ssid[33]; /**< The SSID of an access point. */
148+
char ap_power; /**< Received Signal Strength Indication, min: -110, max: 0 */
149+
unsigned char bssid[6]; /**< The BSSID of an access point. */
150+
unsigned char channel; /**< The RF frequency, 1-13 */
151+
unsigned char sec_type; /**< details see netmgr_wifi_sec_type */
152+
} aos_wifi_ap_list_t;
153+
146154
int aos_wifi_init(aos_wifi_manager_t *wifi_manager);
147155

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

164172
int aos_net_get_ifconfig(aos_ifconfig_info_t *info);
165173

174+
int aos_wifi_scan(aos_wifi_ap_list_t *ap_list, int ap_list_len);
175+
166176
/**
167177
* @brief file close
168178
*

components/amp_adapter/platform/aos/network/aos_network.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ int aos_wifi_get_info(aos_wifi_info_t *wifi_info)
281281
return 0;
282282
}
283283

284+
int aos_wifi_scan(aos_wifi_ap_list_t *ap_list, int ap_list_len)
285+
{
286+
netmgr_wifi_ap_list_t* wifi_ap_records = (netmgr_wifi_ap_list_t *) ap_list;
287+
int ap_num = netmgr_wifi_scan_result(wifi_ap_records, 16, NETMGR_WIFI_SCAN_TYPE_FULL);
288+
return ap_num;
289+
}
290+
284291
int aos_wifi_disconnect()
285292
{
286293
netmgr_hdl_t hdl;

0 commit comments

Comments
 (0)