| 385 | } |
| 386 | |
| 387 | static void user_ap_info_callback(int event, struct rt_wlan_buff *buff, void *parameter) |
| 388 | { |
| 389 | struct rt_wlan_info *info = RT_NULL; |
| 390 | int index = 0; |
| 391 | int ret = RT_EOK; |
| 392 | rt_uint32_t last_num = scan_result.num; |
| 393 | |
| 394 | RT_ASSERT(event == RT_WLAN_EVT_SCAN_REPORT); |
| 395 | RT_ASSERT(buff != RT_NULL); |
| 396 | RT_ASSERT(parameter != RT_NULL); |
| 397 | |
| 398 | info = (struct rt_wlan_info *)buff->data; |
| 399 | index = *((int *)(parameter)); |
| 400 | |
| 401 | ret = wifi_scan_result_cache(info); |
| 402 | if(ret == RT_EOK) |
| 403 | { |
| 404 | if(scan_filter == RT_NULL || |
| 405 | (scan_filter != RT_NULL && |
| 406 | scan_filter->ssid.len == info->ssid.len && |
| 407 | rt_memcmp(&scan_filter->ssid.val[0], &info->ssid.val[0], scan_filter->ssid.len) == 0)) |
| 408 | { |
| 409 | /*Check whether a new ap is added*/ |
| 410 | if (last_num < scan_result.num) |
| 411 | { |
| 412 | /*Print the info*/ |
| 413 | print_ap_info(info,index); |
| 414 | } |
| 415 | |
| 416 | index++; |
| 417 | *((int *)(parameter)) = index; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | } |
| 422 | static int wifi_scan(int argc, char *argv[]) |
| 423 | { |
| 424 | struct rt_wlan_info *info = RT_NULL; |
nothing calls this directly
no test coverage detected