Hey,
I'm looking at: https://issues.apache.org/jira/browse/MYNEWT-8
I'm wondering if I should break BC on this one, and add a new parameter,
or add a new function call:
- os_eventq_select()
OS_EVENTQ_MASK(my_mask, EVENT_T_TIMER);
OS_EVENTQ_MASK(my_mask, EVENT_T_DATA);
/* timeout after 200 ticks */
ev = os_eventq_select(&my_evq, &my_mask, 200);
Thoughts?
Sterling
PS: For the uninitiated, os_eventq_get() works as follows.
In your task, you create an eventq with os_eventq_init(), and then you
wait (forever) on os_eventq_get().
If you (currently) want to not wait forever, you can use a callout,
which will post an event to the eventq after a certain time expires.
while (1) {
ev = os_eventq_get(&my_evq);
switch (ev->ev_type) {
case EVENT_T_DATA: /* read data from socket */
recv_data();
case EVENT_T_TIMER: /* timer expired */
os_callout_reset(&my_callout, &my_evq, 20);
}
}