![Tews Technologies TIP810-SW-42 User Manual Download Page 18](http://html1.mh-extra.com/html/tews-technologies/tip810-sw-42/tip810-sw-42_user-manual_1093635018.webp)
TIP810-SW-42 - VxWorks Device Driver
Page 18 of 36
4.3 write()
NAME
write() - write a message to specified TIP810 device
SYNOPSIS
int write (
int
fd,
/* device descriptor from opened TIP810 device
*/
char
*buffer,
/* pointer to message buffer (typecast T810_MSG_BUF*)
*/
size_t
nbytes
/* always sizeof(T810_MSG_BUF)
*/
)
DESCRIPTION
The write function writes a CAN message to the device with descriptor
filedes
. A pointer to the callers
message buffer (
T810_MSG_BUF
) and the size of this structure are passed by the parameters
buffer
and
size
to the device.
The
T810_MSG_BUF
structure has the following layout:
typedef struct
{
unsigned long
identifier;
unsigned char
io_flags;
unsigned char
msg_len;
unsigned char
data[8];
unsigned char
status;
int
timeout;
} T810_MSG_BUF, *PT810_MSG_BUF;
identifier
Contains the message identifier of the CAN message to write.
io_flags
Contains a set of bit flags, which define message attributes and controls the write operation. To
set more that one bit flag the predefined macros must be binary ORed.
Value
Description
T810_EXTENDED
Transmit an extended message frame. If this macro
isn't set or the "dummy" macro T810_STANDARD
is set a standard frame will be transmitted.
T810_REMOTE_FRAME
A remote transmission request (RTR bit is set) will
be transmitted.