9
3.4. t815_write()
NAME
t815_write() - - write a message to specified TIP815 device
SYNOPSIS
int t815_write ( PathNr, io_flags, MsgBuf)
int
PathNr;
/* Path number */
int
io_flags;
/* I/O flags : [ T815_NOWAIT ] */
T815_MSG
*MsgBuf;
/* Pointer to the message buffer */
DESCRIPTION
This routine write a message to the specified TIP815 device.
Because more informations as the pure data bytes are required for the write request we have
designed a special I/O data structure (
T815_MSG
).
This data structure contains the Data Packet with source and destination ID, message length and
message data.
typedef struct {
unsigned char SID;
/* Source ID */
unsignedchar DID;
/* Destination ID or 0 for broadcasts */
unsigned short len;
/* Message data length */
unsigned char data[MAX_LONG_MSG];
/* Message data */
/*
253 bytes for short packets */
/*
508 bytes for long packets */
} T815_MSG;
The parameter SID is not used.
The parameter DID specifies the Destination ID (Destination node hardware address).
The parameter
len
specifies the number of data bytes (
data[]
) to be transferred. The number of data
bytes is limited to 253 bytes for short packets and 508 bytes for long packets.
The only valid I/O flag set in
io_flags
is
T815_NOWAIT
. If this flag is set,
t815_write()
returns
immediately after starting transmission, otherwise
t815_write()
wait until the message is transmitted
and acknowledged or an error occur.
If the device is blocked by an other write request, the requesting task will be blocked until the
transmitter become free or the request times out.