SERIAL_SendData

Synopsis
#include <serial.h>  
int SERIAL_SendData(int port, 
    unsigned char *buf,
         int bufLen,
    long timeout);

Description

Sends a character array over a serial port.

Parameters

port Serial port number (0 based). Specify port 0 to redirect the output to the HSM trace log
buf Pointer to an array of bytes to be sent
bufLen length of the buffer, in bytes
timeout

Number of milliseconds to wait for a character to be sent. A timeout of -1 will use the default timeout.

Default timeout is 2000 ms.

NOTE   The timeout value refers to the total time taken to send the data. For example, a 2 millisecond timeout for sending 10 characters in 9600 baud setting will always fail – the timeout must be at least 10 milliseconds.

Return Code
Function Code Qualification
0 The characters were sent successfully.
-1 There was an error in operation.