Hi,
in my application (using a msp430) I cannot wait 6 seconds for wlan_connect(), so I'm trying to make it non-blocking.
At the end of wlan_connect (in CC3000HostDriver/wlan.c), I replaced
SimpleLinkWaitEvent(HCI_CMND_WLAN_CONNECT, &ret);
errno = ret;
return(ret);
with
tSLInformation.usRxEventOpcode = HCI_CMND_WLAN_CONNECT;
return(1);
And in the main loop of my application, I did something like this:
void main(void)
{
long retValue;
// ...
wlan_connect(/*...*/);
while(1) {
if( tSLInformation.usEventOrDataReceived == 0 ) {
// Do some other stuff
} else {
hci_event_handler( (void*)(&retValue), 0, 0 );
break;
}
}
// here wlan_connect() should have been processed
}
It is safe to proceed in this way, or there is any pitfalls that I did not notice?