
CHAPTER 13 SERVICE CALLS
User’s Manual U14833EJ2V0UM
195
Send Data to Data Queue with Timeout
tsnd_dtq
[Overview]
Transmits data to a data queue (with timeout)
[C format]
#include <kernel.h>
ER tsnd_dtq(ID dtqid, VP_INT data, TMO tmout);
[Parameters]
I/O
Parameter
Description
I
ID
dtqid
ID number of data queue to which data is to be transmitted
I
VP_INT
data
Transmit data
I
TMO
tmout
Timeout time [milliseconds]
[Explanation]
The data specified by data is transmitted to the data queue specified by dtqid.
If tasks are waiting in the target data queue for data reception, the first task in the queue is allowed immediately to
receive the data and is released from the queue. If no waiting task exists, the data is stored in the ring buffer of the
data queue on a FIFO basis.
If the buffer is already filled with the other data, the task waits for data transmission only for the time specified as
tmout, and it is kept waiting until the buffer has a vacancy and data transmission is completed, or until the specified
time has elapsed. At this time, the task is registered to the waiting task queue of the data queue. The task is
registered to the queue according to the priority (TA_TPRI attribute) or on an FIFO basis (TA_TFIFO attribute),
depending on the attribute specified when the data queue was created.
If TMO_POL = 0 is specified as tmout, 0 is specified as the timeout time and tsnd_dtq performs the same operation
as psnd_dtq. If TMO_FEVR =
1 is specified as tmout, the timeout time is specified to be infinite and this service call
performs the same operation as snd_dtq.
Tasks placed in the waiting state due to tsnd_dtq are released from waiting by one of the following occurrences.
1.
(t)rcv_dtq or (i)prcv_dtq is issued and the buffer now has a vacancy (E_OK).
2.
The specified time has elapsed and therefore timeout has occurred (E_TMOUT).
3.
(i)rel_wai is issued and the task is forcibly released from the waiting state (E_RLWAI).
4.
del_dtq is issued and the data queue is deleted (E_DLT).
[Differences from
μ
ITRON3.0]
tsnd_dtq is a newly created service call.