asio C++ library

PrevUpHomeNext

basic_serial_port

Provides serial port functionality.

template<
    typename SerialPortService = serial_port_service>
class basic_serial_port :
  public basic_io_object< SerialPortService >,
  public serial_port_base
Types

Name

Description

executor_type

The type of the executor associated with the object.

implementation_type

The underlying implementation type of I/O object.

lowest_layer_type

A basic_serial_port is always the lowest layer.

native_handle_type

The native representation of a serial port.

service_type

The type of the service that will be used to provide I/O operations.

Member Functions

Name

Description

assign

Assign an existing native serial port to the serial port.

async_read_some

Start an asynchronous read.

async_write_some

Start an asynchronous write.

basic_serial_port

Construct a basic_serial_port without opening it.

Construct and open a basic_serial_port.

Construct a basic_serial_port on an existing native serial port.

Move-construct a basic_serial_port from another.

cancel

Cancel all asynchronous operations associated with the serial port.

close

Close the serial port.

get_executor

Get the executor associated with the object.

get_io_service

(Deprecated: Use get_executor().) Get the io_service associated with the object.

get_option

Get an option from the serial port.

is_open

Determine whether the serial port is open.

lowest_layer

Get a reference to the lowest layer.

Get a const reference to the lowest layer.

native_handle

Get the native serial port representation.

open

Open the serial port using the specified device name.

operator=

Move-assign a basic_serial_port from another.

read_some

Read some data from the serial port.

send_break

Send a break sequence to the serial port.

set_option

Set an option on the serial port.

write_some

Write some data to the serial port.

Protected Member Functions

Name

Description

get_implementation

Get the underlying implementation of the I/O object.

get_service

Get the service associated with the I/O object.

The basic_serial_port class template provides functionality that is common to all serial ports.

Thread Safety

Distinct objects: Safe.

Shared objects: Unsafe.

Requirements

Header: asio/basic_serial_port.hpp

Convenience header: asio.hpp


PrevUpHomeNext