Other Parts Discussed in Thread: CC3220SF
Hi,
I'm trying to get to grips with AP provisioning on the CC3220SF and I'm aware that once provisioning is underway only sl_WlanProvioning() and sl_Stop() can be called otherwise SL_RET_CODE_PROVISIONING_IN_PROGRESS, -2014, is seen. But what hasn't occurred to me is that callbacks from the NWP into the Host back still occur until I saw an aside by a TI engineer on here. Is that the case? In particular, a HTTP(S) request to the NWP's HTTP processor will make it through to the Host to process just as if provisioning isn't in progress?
The app needs to pass the CC3220 more than just the user's AP SSID and PSK. It's doing those with a POST to /api/1/wlan/profile_add. The app would also like to supply details for accessing the cloud server used for confirmation and all further CC3220 chat, and learn a unique ID from the CC3220 so when the app contacts the cloud server it can identify which CC3220 it's confirming. If the HTTP server can handle arbitrary requests separate from those TI define for provisioning then that seems the solution.
Out of interest, is all the functionality available to the Host so sl_WlanProvisioning() needn't be used and instead the Host may drive the NWP through the provisioning process, e.g. sl_WlanProfileAdd(), allowing a tailored interface to obtain these extra details and provide the unique ID, etc? Or is there some magic sauce involved which only the NWP can do which I'm not seeing at the moment?
Lastly, there's seven slots available for storing profiles. Is there any common or recommended policy for what to do when they're all taken and the user tries to provision with a new AP? I can think of getting the list of visible SSIDs with sl_WlanGetNetworkList() and removing one that's not present, assuming there is one. A more certain approach would be to remove the one least-recently-used, but that would mean maintaining a LRU on the Host side. Rather than have the app encounter the all-slots-full problem, it would seem better to have the Host ensure one slot is empty before starting provisioning; auto-provisioning isn't being used, the user explicitly starts the process with a button press on the CC3220.
Cheers, Ralph.