Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SerialPort

🟨 Synchronous serial-port configuration and byte I/O (see SerialPort for more details) More...

Classes

struct  SC::SerialSettings
 Serial port settings. More...
 
struct  SC::SerialOpenOptions
 Open options for a serial descriptor. More...
 
struct  SC::SerialDescriptor
 Native serial port descriptor with configuration support. More...
 
struct  SC::ResultSerialPort
 SerialPort result retaining optional lower-level and native error details. More...
 

Enumerations

enum class  SC::SerialPortError : uint32_t {
  InvalidBaudRate = 1 ,
  InvalidDataBits ,
  InvalidParity ,
  InvalidStopBits ,
  InvalidFlowControl ,
  InvalidHandle ,
  UnsupportedPathEncoding ,
  InvalidPath ,
  PathMustBeAbsolute ,
  OpenFailed ,
  ReadSettingsFailed ,
  SetSettingsFailed ,
  UnsupportedHardwareFlowControl ,
  UnsupportedBaudRate ,
  UnsupportedDataBits ,
  UnsupportedParity ,
  UnsupportedStopBits ,
  PathTooLong
}
 Stable error codes returned by the SerialPort library. More...
 
enum class  SC::SerialPortErrorDetail : uint32_t {
  None = 0 ,
  PosixOpen ,
  PosixReadDescriptorFlags ,
  PosixSetDescriptorFlags ,
  PosixReadSettings ,
  PosixSetInputBaudRate ,
  PosixSetOutputBaudRate ,
  PosixSetSettings ,
  WindowsCreateFile ,
  WindowsSetTimeouts ,
  WindowsReadSettings ,
  WindowsSetSettings
}
 Stable lower-level and backend-specific context for a SerialPort error. More...
 

Functions

ResultErrorFormat SC::formatSerialPortError (SerialPortError error, Span< char > output)
 Formats a canonical English SerialPort diagnostic into caller-owned storage.
 
ResultErrorFormat SC::formatSerialPortError (Result result, Span< char > output)
 Formats a plain Result when it contains a SerialPort error.
 
ResultErrorFormat SC::formatSerialPortError (ResultSerialPort result, Span< char > output)
 Formats a SerialPort result, including its native error value when available.
 

Detailed Description

🟨 Synchronous serial-port configuration and byte I/O (see SerialPort for more details)

Enumeration Type Documentation

◆ SerialPortError

enum class SC::SerialPortError : uint32_t
strong

#include <SerialPortError.h>

Stable error codes returned by the SerialPort library.

◆ SerialPortErrorDetail

enum class SC::SerialPortErrorDetail : uint32_t
strong

#include <SerialPortError.h>

Stable lower-level and backend-specific context for a SerialPort error.

The platform is part of every OS-specific value so callers can use this context without relying on platform headers. Detail values are diagnostic context and are deliberately not encoded in Result.

Function Documentation

◆ formatSerialPortError() [1/3]

ResultErrorFormat SC::formatSerialPortError ( Result result,
Span< char > output )
inline

#include <SerialPortErrorFormatter.h>

Formats a plain Result when it contains a SerialPort error.

◆ formatSerialPortError() [2/3]

ResultErrorFormat SC::formatSerialPortError ( ResultSerialPort result,
Span< char > output )
inline

#include <SerialPortErrorFormatter.h>

Formats a SerialPort result, including its native error value when available.

◆ formatSerialPortError() [3/3]

ResultErrorFormat SC::formatSerialPortError ( SerialPortError error,
Span< char > output )
inline

#include <SerialPortErrorFormatter.h>

Formats a canonical English SerialPort diagnostic into caller-owned storage.

This opt-in header owns the canonical strings. Applications can instead switch on SerialPortError and use ResultErrorFormatter with their own translated text.