ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Protected Attributes | List of all members
UART Class Reference

Wrapper class for a serial port. More...

#include <UART.h>

Collaboration diagram for UART:
Collaboration graph
[legend]

Public Member Functions

 UART ()
 Constructor.
 
 UART (const std::string &devfile, int baud)
 Connects to a serial port. More...
 
bool Connect (const std::string &devfile, int baud, bool dtrEnable=false)
 Connects to a serial port. More...
 
void Close ()
 Disconnects from the serial port.
 
virtual ~UART ()
 Destructor.
 
bool Read (unsigned char *data, int len)
 
bool Write (const unsigned char *data, int len)
 
FILE_DESCRIPTOR GetHandle ()
 
bool IsValid () const
 

Protected Attributes

bool m_networked
 
FILE_DESCRIPTOR m_fd
 
Socket m_socket
 

Detailed Description

Wrapper class for a serial port.

Constructor & Destructor Documentation

◆ UART()

UART::UART ( const std::string &  devfile,
int  baud 
)

Connects to a serial port.

Exceptions
JtagExceptionon failure
Parameters
devfileThe device file
baudBaud rate to use (in bits per second)

Member Function Documentation

◆ Connect()

bool UART::Connect ( const std::string &  devfile,
int  baud,
bool  dtrEnable = false 
)

Connects to a serial port.

Exceptions
JtagExceptionon failure
Parameters
devfileThe device file
baudBaud rate to use (in bits per second)
dtrEnableTrue if DTR line should be enabled (needed by some devices like the NanoVNA to communicate)

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