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.

CC3220SF: Update SlFdSet_t after calling sl_select

Part Number: CC3220SF

Hi,

I want to know if it's possible to update SlFdSet_t *readsds after calling sl_Select.

I'm configuring sl_Select to have an infinite timeout (so I can set my system in sleep mode).

But I'm having problems when my application opens a new socket after I call sl_Select. In this scenario, sl_Select never unblock for this new sockets.

I call SL_SOCKET_FD_SET for this new sockets but without results.

Thank you.

  • Hello,

    Generally you want to update readsds then call sl_Select so it can watch the appropriate sockets. I don't believe there's an issue updating readsds after calling sl_Select but I also don't believe sl_Select is aware of this newly opened socket.

    Jesu
  • Hello Jesu,

    You are right in both quotes. There is no issue in updating readsds. If we call SL_SOCKET_FD_SET, readsds will be updated. But is also true that sl_Select is not aware of this new sockets.

    So can we conclude that is not possible to tell sl_Select that there is new sockets if we use it with infinite timeout? Have we always to poll it to refresh readsds?

    How would be the best solution for a system that has to keep the current consumption lower as possible?

    Thanks

  • Hello Igor,

    I learned today that you can call sl_Select multiple times. For your example you call sl_Select to rx for socket A. Then you create a new socket (socket B) and call sl_Select for socket B. The host driver will notify the NWP of both sockets for select but the host will have two different select calls that are blocked. When you get something on socket A - the first select will return but the second will still be blocked.

    I can confirm this feature is present in SDK v2.2 and later. I do not know if it is supported in older SDKs.

    Jesu
  • Hello Jesu,

    Thank you for the reply.

    The example that you gave cannot be applied in my case. Thank you anyway.