Table C-9 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.
µC/OS-II ( |
µC/OS-III ( |
Note |
|
|
(1) |
|
|
(2) |
|
|
|
|
|
(3) |
|
|
|
|
|
(4) |
|
|
(4) |
|
|
(5) |
Table C-9 Message Mailbox API
TC-9(1) In µC/OS-III, there is no “accept” API since this feature is built into the OSQPend()
by specifying the OS_OPT_PEND_NON_BLOCKING
option.
TC-9(2) In µC/OS-II, OSMboxCreate()
returns the address of 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 specify 1
for the max_qty
argument.
TC-9(3) µ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.
TC-9(4) In µC/OS-III, OSQPost()
offers a number of options that replaces the two post functions provided in µC/OS-II.
TC-9(5) µC/OS-III does not provide query services, as they were rarely used in µC/OS-II.