OpenCPN Partial API docs
Loading...
Searching...
No Matches
SerialIo Class Referenceabstract

Nmea0183 serial communications wrapper, possibly running a thread. More...

#include <serial_io.h>

Inheritance diagram for SerialIo:
ThreadCtrl AndroidSerialIo StdSerialIo

Public Member Functions

virtual void Start ()=0
 Start IO operations including input, possibly in separate thread.
 
virtual bool SetOutMsg (const wxString &msg)=0
 Send a message to remote peer.
 
virtual void RequestStop () override=0
 Request that thread stops operation.
 
virtual DriverStats GetStats () const =0
 Retrieve updated driver statistics.
 
- Public Member Functions inherited from ThreadCtrl
bool IsRunning () const
 Return true if thread is running.
 
void WaitUntilStopped ()
 Block until thread invokes SignalExit().
 
bool WaitUntilStopped (std::chrono::duration< int > timeout)
 Block until thread invokes SignalExit() or timeout.
 
bool WaitUntilStopped (std::chrono::duration< int > timeout, std::chrono::milliseconds &elapsed)
 Block until thread invokes SignalExit() or timeout.
 

Static Public Member Functions

static std::unique_ptr< SerialIoCreate (SendMsgFunc send_msg_func, const std::string &port, unsigned baud)
 Factory.
 

Protected Member Functions

 SerialIo (SendMsgFunc send_msg_func, const std::string &port, unsigned baud)
 
- Protected Member Functions inherited from ThreadCtrl
bool KeepGoing () const
 If true continue thread operation, else exit and invoke SignalExit()
 
void SignalExit ()
 Signal that thread has exited.
 

Protected Attributes

const wxString m_portname
 
const unsigned m_baud
 
const SendMsgFunc m_send_msg_func
 
DriverStats m_stats
 
std::mutex m_stats_mutex
 
TimedLogFilter m_open_log_filter
 

Detailed Description

Nmea0183 serial communications wrapper, possibly running a thread.

Definition at line 54 of file serial_io.h.

Constructor & Destructor Documentation

◆ SerialIo()

SerialIo::SerialIo ( SendMsgFunc  send_msg_func,
const std::string &  port,
unsigned  baud 
)
inlineprotected

Definition at line 82 of file serial_io.h.

Member Function Documentation

◆ Create()

std::unique_ptr< SerialIo > SerialIo::Create ( SendMsgFunc  send_msg_func,
const std::string &  port,
unsigned  baud 
)
static

Factory.

Definition at line 85 of file android_serial_io.cpp.

◆ GetStats()

virtual DriverStats SerialIo::GetStats ( ) const
pure virtual

Retrieve updated driver statistics.

Implemented in AndroidSerialIo, and StdSerialIo.

◆ RequestStop()

void SerialIo::RequestStop ( )
overridepure virtual

Request that thread stops operation.

Reimplemented from ThreadCtrl.

Implemented in AndroidSerialIo.

Definition at line 213 of file std_serial_io.cpp.

◆ SetOutMsg()

virtual bool SerialIo::SetOutMsg ( const wxString &  msg)
pure virtual

Send a message to remote peer.

Implemented in AndroidSerialIo, and StdSerialIo.

◆ Start()

virtual void SerialIo::Start ( )
pure virtual

Start IO operations including input, possibly in separate thread.

Implemented in AndroidSerialIo, and StdSerialIo.

Member Data Documentation

◆ m_baud

const unsigned SerialIo::m_baud
protected

Definition at line 76 of file serial_io.h.

◆ m_open_log_filter

TimedLogFilter SerialIo::m_open_log_filter
protected

Definition at line 80 of file serial_io.h.

◆ m_portname

const wxString SerialIo::m_portname
protected

Definition at line 75 of file serial_io.h.

◆ m_send_msg_func

const SendMsgFunc SerialIo::m_send_msg_func
protected

Definition at line 77 of file serial_io.h.

◆ m_stats

DriverStats SerialIo::m_stats
protected

Definition at line 78 of file serial_io.h.

◆ m_stats_mutex

std::mutex SerialIo::m_stats_mutex
mutableprotected

Definition at line 79 of file serial_io.h.


The documentation for this class was generated from the following files: