Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
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

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.

native_type

(Deprecated: Use 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_io_service

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

(Deprecated: Use native_handle().) Get the native serial port representation.

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.

Protected Data Members

Name

Description

implementation

(Deprecated: Use get_implementation().) The underlying implementation of the I/O object.

service

(Deprecated: Use get_service().) 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: boost/asio/basic_serial_port.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext