113
Serial Methods
Serial_GetSettings ( Port )
Serial_GetSettings ( Port )
Serial_GetSettings ( Port )
Serial_GetSettings ( Port )
Returns the port settings for the specified serial port. Use the WACI DIP switches or Web interface to set these
parameters.
Syntax
HRESULT Serial_GetSettings(
[in] long Port,
[out, retval] BSTR* Settings
);
Parameters
Port
[in] Port number for the serial port. Valid values are 1 and 2.
Settings
[out, retval] Comma separated string representing the current port settings. On error, this
parameter is returned as NULL or ““. The format of the string is: baud-rate, parity, stop-bits,
RS422-flag, flow-control, e.g. “9600,8,NONE,1,0,HARDWARE”.
Remarks
Valid values for the different settings are:
Baud: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200
Parity: ODD, EVEN, NONE
Stop Bits: 1, 2
Flow Control: HARDWARE, SOFTWARE, NONE
Serial_Send ( Port, Msg,
Serial_Send ( Port, Msg,
Serial_Send ( Port, Msg,
Serial_Send ( Port, Msg, MaxWaitMS )
MaxWaitMS )
MaxWaitMS )
MaxWaitMS )
Sends a string to the specified port.
Syntax
HRESULT Serial_Send(
[in] long Port,
[in] BSTR Msg,
[in] long MaxWaitMS,
[out, retval] long* NotSent
);
Parameters
Port
[in] Port number for the serial port. Valid values are 1 and 2.
Msg
[in] URL encoded string to be sent to the port.
MaxWaitMS
[in] The number of milliseconds allowed to complete the sending of the serial data before
timing out.
NotSent
[out, retval] If an error occurred or the timeout expired, then this is the number of bytes not
sent; otherwise, this value is set to 0.