This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3220MOD: sl_WlanConnect() does not fail if you use it to connect to a non-existent wifi network

Part Number: CC3220MOD

Hi,

To mimic trying to connect to a wifi network that does not exist ie has failed for some reason, I called sl_WlanConnect() using a non-existent wifi network.

It returned '0' - success and an event 'SL_NETAPP_EVENT_IPV4_ACQUIRED'.

From this I assume it is saying the call was successful not the actual connection to the wifi network and the event seems to be a generic one - I got it when a station connected to a AP as well.

So how do you detect a connection attempt to a non-existent wifi network?  is there an event for 'successful connection'?

Following on from this, is there an event that I could subscribe to for 'wifi network failed'?

Regards,

  • Hi,

    The sl_WlanConnect() will return '0' if the host successfully sends the command to the network processor and the network processor acknowledges it. The connect operation will continue to run until a connection is successful or the disconnect command is issued. See section 4.3.3.3 of the CC3220 Network Processor Programmer's Guide.

    You should wait for the SL_WLAN_EVENT_CONNECT event and SL_NETAPP_EVENT_IPV4_ACQUIRED event to both happen before assuming the connection is complete. Generally, you application should wait up to some predefined amount of time before aborting the connection attempt. That is the only way to determine the AP is not there or not responsive. There is no built-in "connect attempt failed" event.

    After a timeout, the system can wait some longer amount of time before retrying the connection or can try to force a connection to a different AP. 

    Best Regards,

    Ben M