OpenCPN Partial API docs
Loading...
Searching...
No Matches
serial.h File Reference
#include <limits>
#include <vector>
#include <string>
#include <cstring>
#include <sstream>
#include <exception>
#include <stdexcept>
#include <serial/v8stdint.h>

Go to the source code of this file.

Classes

struct  serial::Timeout
 Structure for setting the timeout of the serial port, times are in milliseconds. More...
 
class  serial::Serial
 Class that provides a portable serial port interface. More...
 
class  serial::SerialException
 
class  serial::IOException
 
class  serial::PortNotOpenedException
 
struct  serial::PortInfo
 Structure that describes a serial device. More...
 

Macros

#define THROW(exceptionClass, message)
 

Enumerations

enum  serial::bytesize_t { fivebits = 5 , sixbits = 6 , sevenbits = 7 , eightbits = 8 }
 Enumeration defines the possible bytesizes for the serial port. More...
 
enum  serial::parity_t {
  parity_none = 0 , parity_odd = 1 , parity_even = 2 , parity_mark = 3 ,
  parity_space = 4
}
 Enumeration defines the possible parity types for the serial port. More...
 
enum  serial::stopbits_t { stopbits_one = 1 , stopbits_two = 2 , stopbits_one_point_five }
 Enumeration defines the possible stopbit types for the serial port. More...
 
enum  serial::flowcontrol_t { flowcontrol_none = 0 , flowcontrol_software , flowcontrol_hardware }
 Enumeration defines the possible flowcontrol types for the serial port. More...
 

Functions

std::vector< PortInfoserial::list_ports ()
 Lists the serial ports available on the system.
 

Detailed Description

Author
William Woodall wjwwo.nosp@m.od@g.nosp@m.mail..nosp@m.com
John Harrison ash.g.nosp@m.ti@g.nosp@m.mail..nosp@m.com
Version
0.1

LICENSE

The MIT License

Copyright (c) 2012 William Woodall

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

DESCRIPTION

This provides a cross platform interface for interacting with Serial Ports.

Definition in file serial.h.

Macro Definition Documentation

◆ THROW

#define THROW (   exceptionClass,
  message 
)
Value:
throw exceptionClass(__FILE__, \
__LINE__, (message) )

Definition at line 48 of file serial.h.

Enumeration Type Documentation

◆ bytesize_t

Enumeration defines the possible bytesizes for the serial port.

Definition at line 56 of file serial.h.

◆ flowcontrol_t

Enumeration defines the possible flowcontrol types for the serial port.

Definition at line 86 of file serial.h.

◆ parity_t

Enumeration defines the possible parity types for the serial port.

Definition at line 66 of file serial.h.

◆ stopbits_t

Enumeration defines the possible stopbit types for the serial port.

Definition at line 77 of file serial.h.

Function Documentation

◆ list_ports()

std::vector< PortInfo > serial::list_ports ( )

Lists the serial ports available on the system.

Returns a vector of available serial ports, each represented by a serial::PortInfo data structure:

Returns
vector of serial::PortInfo.