|
ngscopeclient v0.2.2
|
Wrapper class for a serial port. More...
#include <UART.h>

Public Member Functions | |
| UART () | |
| Constructor. | |
| UART (const std::string &devfile, int baud) | |
| Connects to a serial port. | |
| bool | Connect (const std::string &devfile, int baud, bool dtrEnable=false, unsigned int txUs=1000 *50, unsigned int rxUs=1000 *500) |
| bool | SetTimeouts (unsigned int txUs=1000 *50, unsigned int rxUs=1000 *500) |
| 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) |
| void | FlushRxBuffer () |
| FILE_DESCRIPTOR | GetHandle () |
| bool | IsValid () const |
Static Public Member Functions | |
| static std::vector< UartDescriptor > | EnumerateUarts () |
Protected Attributes | |
| bool | m_networked |
| FILE_DESCRIPTOR | m_fd |
| Socket | m_socket |
Wrapper class for a serial port.
Connects to a serial port.
| JtagException | on failure |
| devfile | The device file |
| baud | Baud rate to use (in bits per second) |
| bool UART::Connect | ( | const std::string & | devfile, |
| int | baud, | ||
| bool | dtrEnable = false, |
||
| unsigned int | txUs = 1000*50, |
||
| unsigned int | rxUs = 1000*500 |
||
| ) |
@brief Connects to a serial port @throw JtagException on failure @param devfile The device file @param baud Baud rate to use (in bits per second) @param dtrEnable True if DTR line should be enabled (needed by some devices like the NanoVNA to communicate) @param txUs Transmit timeout in microseconds (default 50,000 = 50 milliseconds) @param rxUs Recieve timeout in microseconds (default 500,000 = 500 milliseconds)
TODO timeouts only implemented for WIN32
@brief Sets timeouts on a UART that is open @param txUs Transmit timeout in microseconds (default 50,000 = 50 milliseconds) @param rxUs Recieve timeout in microseconds (default 500,000 = 500 milliseconds)
TODO timeouts only implemented for WIN32