I want the CC3000 to attempt to connect to an IP on port 9000. If that connect fails, try 9001, then 9002, etc. However, the time out for connect() is about 1 minute. Since the connect() timeout cannot be reduced via setsockopts(), I would like to implement a timed interrupt to stop the connection attempt, and try the next port.
However, since the execution enters SimpleLinkWaitEvent(), it will not exit until it receives an event. So, in an interrupt, I could toggle the PW_EN on the tiwi, to reboot it, and then start over, but execution will still be in SimpleLinkWaitEvent(). Is there any way I can trick the library into thinking that the TiWi timed out? Can I then issue another connect() to the TiWi, or will it ignore it because it is still dealing with the previous attempt?
The best option would be to set a timeout on the connect, but that doesn't seem supported.
Thanks,
Nathan