get_serial_paramT_get_serial_paramGetSerialParamGetSerialParamget_serial_param (算子)

名称

get_serial_paramT_get_serial_paramGetSerialParamGetSerialParamget_serial_param — 获取串行设备的参数。

签名

get_serial_param( : : SerialHandle : BaudRate, DataBits, FlowControl, Parity, StopBits, TotalTimeOut, InterCharTimeOut)

Herror T_get_serial_param(const Htuple SerialHandle, Htuple* BaudRate, Htuple* DataBits, Htuple* FlowControl, Htuple* Parity, Htuple* StopBits, Htuple* TotalTimeOut, Htuple* InterCharTimeOut)

void GetSerialParam(const HTuple& SerialHandle, HTuple* BaudRate, HTuple* DataBits, HTuple* FlowControl, HTuple* Parity, HTuple* StopBits, HTuple* TotalTimeOut, HTuple* InterCharTimeOut)

Hlong HSerial::GetSerialParam(Hlong* DataBits, HString* FlowControl, HString* Parity, Hlong* StopBits, Hlong* TotalTimeOut, Hlong* InterCharTimeOut) const

static void HOperatorSet.GetSerialParam(HTuple serialHandle, out HTuple baudRate, out HTuple dataBits, out HTuple flowControl, out HTuple parity, out HTuple stopBits, out HTuple totalTimeOut, out HTuple interCharTimeOut)

int HSerial.GetSerialParam(out int dataBits, out string flowControl, out string parity, out int stopBits, out int totalTimeOut, out int interCharTimeOut)

def get_serial_param(serial_handle: HHandle) -> Tuple[int, int, str, str, int, int, int]

描述

get_serial_paramget_serial_paramGetSerialParamGetSerialParamGetSerialParamget_serial_param returns the current parameter settings of the serial device passed in SerialHandleSerialHandleSerialHandleSerialHandleserialHandleserial_handle. For a description of the parameters of a serial device, see set_serial_paramset_serial_paramSetSerialParamSetSerialParamSetSerialParamset_serial_param

执行信息

此算子修改后续输入参数的状态:

在执行此算子时,若该参数值需在多个线程间使用,则必须对其访问进行同步。

参数

SerialHandleSerialHandleSerialHandleSerialHandleserialHandleserial_handle (输入控制,状态被修改)  serial HSerial, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Serial interface handle.

BaudRateBaudRateBaudRateBaudRatebaudRatebaud_rate (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Speed of the serial interface.

DataBitsDataBitsDataBitsDataBitsdataBitsdata_bits (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of data bits of the serial interface.

FlowControlFlowControlFlowControlFlowControlflowControlflow_control (输出控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Type of flow control of the serial interface.

ParityParityParityParityparityparity (输出控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Parity of the serial interface.

StopBitsStopBitsStopBitsStopBitsstopBitsstop_bits (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of stop bits of the serial interface.

TotalTimeOutTotalTimeOutTotalTimeOutTotalTimeOuttotalTimeOuttotal_time_out (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Total timeout of the serial interface in ms.

InterCharTimeOutInterCharTimeOutInterCharTimeOutInterCharTimeOutinterCharTimeOutinter_char_time_out (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Inter-character timeout of the serial interface in ms.

结果

If the parameters are correct and the parameters of the device could be read, the operator get_serial_paramget_serial_paramGetSerialParamGetSerialParamGetSerialParamget_serial_param 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

open_serialopen_serialOpenSerialOpenSerialOpenSerialopen_serial

可能的后继

read_serialread_serialReadSerialReadSerialReadSerialread_serial, write_serialwrite_serialWriteSerialWriteSerialWriteSerialwrite_serial

另见

set_serial_paramset_serial_paramSetSerialParamSetSerialParamSetSerialParamset_serial_param

模块

基础