Skip to content

clear_serialClearSerialClearSerialclear_serialT_clear_serial🔗

Short description🔗

clear_serialClearSerialClearSerialclear_serialT_clear_serial — Clear the buffer of a serial connection.

Signature🔗

clear_serial( serial SerialHandle, string Channel )void ClearSerial( const HTuple& SerialHandle, const HTuple& Channel )static void HOperatorSet.ClearSerial( HTuple serialHandle, HTuple channel )def clear_serial( serial_handle: HHandle, channel: str ) -> None

Herror T_clear_serial( const Htuple SerialHandle, const Htuple Channel )

void HSerial::ClearSerial( const HString& Channel ) const

void HSerial::ClearSerial( const char* Channel ) const

void HSerial::ClearSerial( const wchar_t* Channel ) const (Windows only)

void HSerial.ClearSerial( string channel )

Description🔗

clear_serialClearSerial discards data written to the serial device referred to by SerialHandleserialHandleserial_handle, but not transmitted (Channelchannelchannel = 'output'"output"), or data received, but not read (Channelchannelchannel = 'input'"input"), or performs both these operations at once (Channelchannelchannel = 'in_out'"in_out").

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

SerialHandleserialHandleserial_handle (input_control, state is modified) serial → (handle)HTuple (HHandle)HSerial, HTuple (IntPtr)HHandleHtuple (handle)

Serial interface handle.

Channelchannelchannel (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Buffer to be cleared.

Default: 'input'"input"
List of values: 'in_out', 'input', 'output'"in_out", "input", "output"

Result🔗

If the parameters are correct and the buffers of the serial device could be cleared, the operator clear_serialClearSerial returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

open_serialOpenSerial

Possible successors

read_serialReadSerial, write_serialWriteSerial

See also

read_serialReadSerial

Module🔗

Foundation