2 Replies Latest reply on Jul 17, 2015 11:28 AM by userc_19975

    wiced_wifi_scan_networks does not run

      Using V 3.2.2 SDK on BDM943341WCD1



      I have an app that brings up a soft ap for configuration.  I use the wiced_wifi_scan_networks to get a list of SSIDs in the neighborhood so I can validate the SSID that I collect from the user over a UDP socket  that a client app uses send the configuration info the the soft AP server.


      My scanning code that uses the wiced_wifi_scan_networks api works fine if I run it before I bring the the soft ap (similar in concept to what the snip.scan demo code does.


      But if I bring up the soft AP so I can collect configuration parameters, the wiced_wifi_scan_networks function returns WICED_SUCCESS when  I call it, but does not actually scan, so my callback function never gets executed.


      I tried starting a worker thread to run the wiced_wifi_scan_networks in, but that behaves the same. 

      I also shut down the soft AP prior to running the scan, but that has no effect.


      Looking at the underlying library code, I don't see anything obvious that would cause it to fail if a soft ap were running, or had been running and shut down.


      There must be some shutdown logic that is needed to make this work, but I don't see anything in the documentation that suggests a fix.


      Anyone have a clue what is preventing the scanner from working?

        • 1. Re: wiced_wifi_scan_networks does not run

          After further investigation, what I have found is that it is OK to have the soft ap running, and have the UDP socket open with a callback assigned to pick up messages that come in on the port for the socket.


          I can then scan repeatedly, until a message is sent to the socket.  In my code, I simply deleted the packet that came in to eliminate the possibility that handling of the packet was corrupting memory.  But once a message is received on the socket, the scanning no longer works.  All the functions that set up the scan (wiced_wifi_scan_networks and its calls to support functions)  return WICED_SUCCESS.  But no events happen.


          So I am not sure if this is a bug in the SDK, or if there is some expectation of cleanup (I have tried shutting down the soft ap, removing callbacks and deleting sockets to no avail).

          • 2. Re: wiced_wifi_scan_networks does not run

            Ok, I found the problem.


            The reason that wiced_scan_wifi_networks was not working when I had the soft ap running and the udp server accepting messages was because I was calling it from the udp message received callback function.


            Moving this outside of the callback fixed the problem.