Operator Reference

write_serialT_write_serialWriteSerialWriteSerialwrite_serial (Operator)

write_serialT_write_serialWriteSerialWriteSerialwrite_serial — Write to a serial connection.

Signature

write_serial( : : SerialHandle, Data : )

Herror T_write_serial(const Htuple SerialHandle, const Htuple Data)

void WriteSerial(const HTuple& SerialHandle, const HTuple& Data)

void HSerial::WriteSerial(const HTuple& Data) const

void HSerial::WriteSerial(Hlong Data) const

static void HOperatorSet.WriteSerial(HTuple serialHandle, HTuple data)

void HSerial.WriteSerial(HTuple data)

void HSerial.WriteSerial(int data)

def write_serial(serial_handle: HHandle, data: MaybeSequence[int]) -> None

Description

write_serialwrite_serialWriteSerialWriteSerialwrite_serial writes the characters given in DataDataDatadatadata to the serial device given by SerialHandleSerialHandleSerialHandleserialHandleserial_handle. The data to be written is passed as a tuple of integers. This allows to write NUL characters, which would otherwise be interpreted as the end of a string. write_serialwrite_serialWriteSerialWriteSerialwrite_serial always waits until all data has been transmitted, i.e., a timeout for writing cannot be set.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

SerialHandleSerialHandleSerialHandleserialHandleserial_handle (input_control)  serial HSerial, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Serial interface handle.

DataDataDatadatadata (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Characters to write (as tuple of integers).

Result

If the parameters are correct and the write to the device was successful, the operator write_serialwrite_serialWriteSerialWriteSerialwrite_serial returns the value 2 ( H_MSG_TRUE) . Otherwise an exception is raised.

Possible Predecessors

open_serialopen_serialOpenSerialOpenSerialopen_serial

See also

read_serialread_serialReadSerialReadSerialread_serial

Module

Foundation