writers

Navigation:  Programming language SQC > Built-in functions > Serial >

writers

Previous pageReturn to chapter overviewNext page

The writers() function attempts to write nbytes from buffer to the serial port associated with handle.

The function returns the number of bytes written to the serial port.

A return value of -1 indicates an error.

 

int writers(int fd,char *data,int datalen,int timeout_ms)

 

Example:

 

void main() 

{

     int fd = openrs(RS232_1,9600,8,0,1,'>');

     int len = writers(fd,"Hello serial",strlen("Hello serial"), 1000);

     closers(fd);

}