NAP
Public Types | Public Member Functions | Public Attributes | List of all members
SerialPort::Error Struct Reference

#include <serialport.h>

Public Types

enum  EType : int { NoError = 0, IOError = 1, SerialError = 2, PortError = 3 }
 

Public Member Functions

bool failed ()
 
const std::string & getMessage ()
 
EType getType ()
 
void clear ()
 

Public Attributes

EType mType = EType::NoError
 Status associated with this error. More...
 
std::string mMessage = ""
 Message associated with this error. More...
 

Description

Contains the error message when a serial operation fails.

Member Enumeration Documentation

◆ EType

enum EType : int
strong

All the serial error types

Enumerator
NoError 

No serial error.

IOError 

Serial IO (read / write) error.

SerialError 

Generic serial error.

PortError 

Port isn't open.

Member Function Documentation

◆ clear()

void clear ( )

Clears the error message, automatically called by all serial operations.

◆ failed()

bool failed ( )
Returns
true if the previous operation failed and generated an error

◆ getMessage()

const std::string& getMessage ( )
Returns
the message associated with this error

◆ getType()

EType getType ( )
Returns
the status of this error

Member Data Documentation

◆ mMessage

std::string mMessage = ""

Message associated with this error.

◆ mType

Status associated with this error.