Download pSOSystem Programmer`s Reference

Transcript
pr.book Page 56 Thursday, January 28, 1999 9:18 AM
Interfaces
pSOSystem Programmer’s Reference
Example 2-13 shows a UDataInd function call to send data and status to a task.
EXAMPLE 2-13: UDataInd Function Call
/***************************************************************/
/* This function term_dataind is an example of a UDataInd
*/
/* function. It will get as input:
*/
/*
*/
/*
Uid uid pointer to channels configuration
*/
/*
mblk_t mblk message block containing data
*/
/*
unsigned long b_flags condition code for block */
/*
*/
/* term_dataind will use a message queue to send the mblock
*/
/* and status on to a task that is waiting for data.
*/
/*
*/
/* Assume receive_ques is an array of message queue IDs.
*/
/***************************************************************/
static void term_dataind(Uid uid, mblk_t *mblk, unsigned long
b_flags)
{
/***************************************************************/
/* Set up the message buffer with the pointer to the mblock
*/
/* and status
*/
/***************************************************************/
msg_buf[0] = (unsigned long)mblk;
msg_buf[1] = b_flags;
/***************************************************************/
/* Send message to channels message queue.
*/
/***************************************************************/
q_send(receive_ques[(unsigned long)*uid], msg_buf);
}
2-56
DISIplus (Device Independent Serial Interface)