I would not break BC; I would add a different function. Not sure what I would call it but wouldnt it just have a timeout, in ticks, associated with it? For example: os_eventq_wait(&my_evq, timeout_in_os_ticks). What is the purpose of the mask btw? Something to do with returning an error if it times out or some way of selecting particular events?
Will > On Apr 4, 2016, at 8:14 AM, Sterling Hughes <[email protected]> wrote: > > 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); > } > }
