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.

CC3120BOOST: sl_Start with callback vs blocking

Part Number: CC3120BOOST

Using sl_Start without a callback, returns after SL_SET_DEVICE_STARTED.  In this case network operations can be started immediately.

When using sl_Start WITH a callback, the callback is made before SL_SET_DEVICE_STARTED.  In this case network operations can not be started from the callback.  Is there some other callback or notification that I should be using after SL_SET_DEVICE_STARTED is done where I can start network operations?

  • Hi Denis,

    I have not used sl_Start in callback mode but I believe the behavior you're seeing makes sense. In callback mode you will have to wait for the event before you start using network operations. 

    Jesu

  • I am waiting for the callback to try and start network activity.  However, the simplelink driver is not in a state where it will accept network calls at that time.  It is only after the simplelink driver calls the callback that it puts the driver in a state where it will accept network calls.  Thus my question.  To me this seems to be a bug in the simplelink driver.

  • Hi Denis,

    Why does this seem like a bug? You cannot start making network calls until the host driver gets initialized which sl_Start is responsible for. When the callback fro sl_Start gets called that means the host driver is ready for network activity. I don't think there is a bug here.

    Jesu

  • What I'm trying to explain is that when the callback from sl_Start is called the host driver is NOT ready for network activity.  That is the bug.  I agree that the callback should be made after the host driver is ready for network activity.  (SL_SET_DEVICE_STARTED should be called by the driver before doing the callback, not afterwards as it does now).

  • Understood. I may have to test this but why do you think SL_SET_DEVICE_STARTED is getting called before the callback? I took a quick look at the host driver code. I think _SlDeviceHandleAsync_InitComplete is responsible for calling the callback. It looks like the callback is getting called first. Then SL_SET_DEVICE_STARTED after.

    Jesu

  • That is the bug.  SL_SET_DEVICE_STARTED should be called before the callback is made.  So that in the callback the driver is ready for network activity.

  • Hi Denis,

    Understood. Let me review this internally and get back to you. If you are correct I will have to submit a ticket internally to R&D to get this fixed for next SDK release. Is using callback mode urgent for your application? I ask so I can get an idea of timeline.

    Jesu

  • Hi Denis,

    I could reproduce the issue you are talking about. I will submit a ticket to R&D so they can investigate this further. As a workaround maybe add a short delay or use the blocking version instead. We will try to have this issue resolved for next SDK release.

    Thanks for reporting this.

    Jesu