Everything

snd_mbx

isnd_mbx

Outline
Send to mailbox.
C format
 ER      snd_mbx (ID mbxid, T_MSG *pk_msg);
 ER      isnd_mbx (ID mbxid, T_MSG *pk_msg);
Parameter(s)
I/O
Parameter
Description
I
 ID      mbxid;
ID number of the mailbox to which the message is sent.
I
 T_MSG   *pk_msg;
Start address of the message packet to be sent to the mailbox.

[Message packet: T_MSG]
 typedef struct  t_msg {
     struct  t_msg   *msgnext;   /*Reserved for future use*/
 } T_MSG;

[Message packet: T_MSG_PRI]
 typedef struct  t_msg_pri {
     struct  t_msg   msgque;     /*Reserved for future use*/
     PRI     msgpri;             /*Message priority*/
 } T_MSG_PRI;

Explanation
This service call transmits the message specified by parameter pk_msg to the mailbox specified by parameter mbxid (queues the message in the wait queue).
If a task is queued to the target mailbox wait queue when this service call is issued, the message is not queued but handed over to the relevant task (first task of the wait queue).
As a result, the relevant task is unlinked from the wait queue and is moved from the WAITING state (receiving WAITING state for a mailbox) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.
Note 1 Messages are queued to the target mailbox wait queue in the order defined by queuing method during configuration (FIFO order or priority order).
Note 2 With the RI850V4 mailbox, only the start address of the message is handed over to the receiving processing program, but the message contents are not copied to a separate area. The message contents can therefore be rewritten even after this service call is issued.
Note 3 For details about the message packet, refer to "15.2.6 Message packet".
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
Parameter error.
- msgpri < 0x0
- msgpri > Maximum message priority
E_ID
-18
Invalid ID number.
- mbxid < 0x0
- mbxid > Maximum ID number
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
E_NOEXS
-42
Non-existent object.
- Specified mailbox is not registered.