Everything

ref_dtq

iref_dtq

Outline
Reference data queue state.
C format
 ER      ref_dtq (ID dtqid, T_RDTQ *pk_rdtq);
 ER      iref_dtq (ID dtqid, T_RDTQ *pk_rdtq);
Parameter(s)
I/O
Parameter
Description
I
 ID      dtqid;
ID number of the data queue.
O
 T_RDTQ  *pk_rdtq;
Pointer to the packet returning the data queue state.

[Data queue state packet: T_RDTQ]
 typedef struct  t_rdtq {
     ID      stskid;         /*Existence of tasks waiting for data transmission*/
     ID      rtskid;         /*Existence of tasks waiting for data reception*/
     UINT    sdtqcnt;        /*Number of data elements in data queue*/
 } T_RDTQ;

Explanation
These service calls store the detailed information of the data queue (existence of waiting tasks, number of data elements in the data queue, etc.) specified by parameter dtqid into the area specified by parameter pk_rdtq.
- stskid
Stores whether a task is queued to the transmission wait queue of the data queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the transmission wait queue
- rtskid
Stores whether a task is queued to the reception wait queue of the data queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the reception wait queue
- sdtqcnt
Stores the number of data elements in data queue.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- dtqid < 0
- dtqid > VTMAX_DTQ
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
Note When the iref_dtq is issued from task or the ref_dtq is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.