Scan networks with a Wi-EM module

Hello, I have the Digi Connect Wi-EM development kit, and I would like to scan all the networks that the module can detect and print the matching SSIDs. Consequently I saw in the API reference the wln_scan() function. It’s declaration is int wln_scan(uint8 * ssid, int ssid_len, int channel).
So if I understand well the function I have to execute it with the following arguments: wln_scan(NULL,0,WLN_CHAN_SCAN) , in order to scan for all the available wireless networks in all possible channels.
But If I don’t already maid a mistake, I don’t really understand how to get back the networks infomation that the module scanned, because I created a wln_scan_data struct but there is nothing in the structure after that the scan function has been executed. I saw that the scan function is returned with a WLN_EVT_SCAN_RESULTS, but I don’t know how to use it.
I hope that somebody could help me.

Sincerely

You need to declare your own callback function with wln_set_event_cb and in that function watch for the WLN_EVT_SCAN_RESULTS event.