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.

CC3000: Need to call hci_unsolicited_event_handler() also during blocking send()/recv()/select()?

Hello,

the CC3000 API demands that the hci_unsolicited_event_handler() function needs to be called every 500ms. Does this function also have to be called during a blocking send()/recv() or select() call? Or is it ok not to call it while these functions are blocked and only call it once these functions return? The documentation is not clear about this.

None of the CC3000 examples call hci_unsolicited_event_handler() while in such a blocking function or show how to do it.

Cheers,

Johannes

  • Hi Johannes,

    In general it is not mandatory to handle unsolicited events, you just need to understand that some functionality might be compromised (in example, you might miss a disconnection event).
    You can still call and handle hci_unsolicited_event_handler() during blocking operations from a timer context.

    Thanks,
    Alon.S

  • Hi Alon,

    thanks for your fast response. This makes sense to me and this is what I expected. But as I saw other strange behavior (out-of-order data through back-to-back send() and select() not returning on connections being terminated by the CC3000 through inactivity) I wanted to make sure this is not connected.

    As I understand I will not get any CC3000 callbacks when I do not call hci_unsolicited_event_handler() while being blocked in a function. I can of course use a timer, but I do not have to, when I do not worry about the events. I would expect the blocking calls send(), recv() and select() to return when for example a WLan disconnect happens, and then it is soon enough to handle this event.

    Cheers,

    Johannes