Table C-9 The table below shows the API for message mailbox management. Note that µC/OS-III does not directly provide services for managing message mailboxes. Given that a message mailbox is a message queue of size one, µC/OS-III can easily emulate message mailboxes.
Panel |
---|
|
µC/OS-II (os_mbox.c ) | µC/OS-III (os_q.c ) | Note |
---|
void * |
|
...
...
OS_EVENT *pevent); |
| (1) | OS_EVENT * |
|
...
...
...
...
...
...
...
...
...
...
INT8U opt,
...
INT8U opt,
INT8U *perr); | OS_OBJ_QTY, |
|
...
...
...
...
...
...
...
INT32U timeout,
...
INT32U timeout,
INT8U *perr); | void * |
|
...
...
...
...
...
...
...
...
...
...
INT8U opt,
...
INT8U opt,
INT8U *perr); | OS_OBJ_QTY |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
OS_MBOX_DATA *p_mbox_data); |
| (5) |
|
...
Table C-9 Message Mailbox API
...
...
In µC/OS-III, there is no “accept” API since this feature is built into |
...
...
...
the OS_OPT_PEND_NON_BLOCKING |
...
...
...
In µC/OS-II, OSMboxCreate() |
...
...
an OS_EVENT , which is used as the “handle” to the message mailbox. In µC/OS-III, the application must allocate storage for |
...
an OS_Q , which serves the same purpose as |
...
the OS_EVENT . The benefit in µC/OS-III is that it is not necessary to predetermine the number of message queues at compile time. Also, to create the equivalent of a message mailbox, you would |
...
...
...
...
...
µC/OS-III returns additional information about the message received. Specifically, the sender specifies the size of the message as a snapshot of the current timestamp is taken and stored as part of the message. The receiver of the message therefore knows when the message was sent. |
...
...
...
offers a number of options that replaces the two post functions provided in µC/OS-II. |
...
...
µC/OS-III does not provide query services, as they were rarely used in µC/OS-II. |