WiFi Scan

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BeDe_2507241
Level 4
Level 4
First like received

Is there any API in WICED studio to check if the device is currently scanning for wifi networks?

There is a function to suppress the scan, but I could not find any function to check if there is an ongoing scan.

0 Likes
1 Solution

The third parameter of the following function

static void scan_results_handler( wiced_scan_result_t** result_ptr, void* user_data, wiced_scan_status_t status )

is the current status of the scan process:

typedef enum

{

    WICED_SCAN_INCOMPLETE,

    WICED_SCAN_COMPLETED_SUCCESSFULLY,

    WICED_SCAN_ABORTED,

} wiced_scan_status_t;

this variable can be used to check if the scan has completed!

View solution in original post

5 Replies
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

please have a check in snip.scan,  we have a handle which will be triggered when scan is finished.

you can add semaphore to judge if scan is complete.

pastedImage_0.png

I am using the following function, which does not have any semaphore input:

wwd_result_t wwd_wifi_scan( wiced_scan_type_t                              scan_type,

                            wiced_bss_type_t                               bss_type,

                            /*@null@*/ const wiced_ssid_t*                 optional_ssid,

                            /*@null@*/ const wiced_mac_t*                  optional_mac,

                            /*@null@*/ /*@unique@*/ const uint16_t*        optional_channel_list,

                            /*@null@*/ const wiced_scan_extended_params_t* optional_extended_params,

                            wiced_scan_result_callback_t                   callback,

                            wiced_scan_result_t**                          result_ptr,

                            /*@null@*/ void*                               user_data,

                            wwd_interface_t                                interface

                          )

0 Likes

hello:

  I think the wiced_scan_result_callback_t callback and wiced_scan_result_t can give you the scan status as you wanted,  need your help to have a check .

wiced_scan_result_t does not have any semaphore fields.

wiced_scan_result_callback_t is called as soon as a result is available. So it is usually called several times during the scan process.

0 Likes

The third parameter of the following function

static void scan_results_handler( wiced_scan_result_t** result_ptr, void* user_data, wiced_scan_status_t status )

is the current status of the scan process:

typedef enum

{

    WICED_SCAN_INCOMPLETE,

    WICED_SCAN_COMPLETED_SUCCESSFULLY,

    WICED_SCAN_ABORTED,

} wiced_scan_status_t;

this variable can be used to check if the scan has completed!