tags:

views:

225

answers:

1

Can anyone send me some sample code on how to send and receive more than one event in a single task in vxworks.

A: 

Don't have the API handy, but it is along the lines of...

To Send: eventSend(taskId, VX_EV01 | VX_EV02 | ...)

To Receive: eventReceive(VX_EV01 | VX_EV02 ..., RECEIVE_ANY, ...)

VX_EV01...VX_EV24 are predefined constants in the eventLib.h, representing the 24 possible events for the receiving task; each receiving task could have a totally different meaning for each event.

RECEIVE_ANY specifies that any of the events would unpend the task. RECEIVE_ALL specified that all event must be received to unpend the task.

Benoit