LibDMRConf  0.5.0
A library to program DMR radios.
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
USBSerial Class Reference

Implements a serial connection to a radio via USB. More...

#include <usbserial.hh>

Inheritance diagram for USBSerial:
RadioInterface AnytoneInterface OpenGD77Interface

Public Member Functions

virtual ~USBSerial ()
 Destrutor.
 
bool isOpen () const
 If true, the device has been found and is open.
 
void close ()
 Closes the interface to the device.
 
const QString & errorMessage () const
 Returns the last error message.
 
- Public Member Functions inherited from RadioInterface
virtual ~RadioInterface ()
 Destructor.
 
virtual QString identifier ()=0
 Returns a device identifier.
 
virtual bool write_start (uint32_t bank, uint32_t addr)=0
 Starts the write process into the specified bank and at the given address. More...
 
virtual bool write (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes)=0
 Writes a chunk of data at the address addr. More...
 
virtual bool write_finish ()=0
 This function ends a series of write operations. More...
 
virtual bool read_start (uint32_t bank, uint32_t addr)=0
 Starts the read process from the specified bank and at the given address. More...
 
virtual bool read (uint32_t bank, uint32_t addr, uint8_t *data, int nbytes)=0
 Reads a chunk of data from the block-address bno (block number). More...
 
virtual bool read_finish ()=0
 This function ends a series of read operations. More...
 
virtual bool reboot ()
 Some radios need to be rebooted after being read or programmed. More...
 

Protected Slots

void onError (QSerialPort::SerialPortError error_t)
 Callback for serial interface errors.
 
void onClose ()
 Callback when closing interface.
 

Protected Member Functions

 USBSerial (unsigned vid, unsigned pid, QObject *parent=nullptr)
 Constructs an opens new serial interface to the devices identified by the given vendor and product IDs. More...
 
- Protected Member Functions inherited from RadioInterface
 RadioInterface ()
 Hidden constructor.
 

Protected Attributes

QString _errorMessage
 Holds the last error message.
 

Detailed Description

Implements a serial connection to a radio via USB.

The correct serial port is selected by the given VID and PID to the constructor.

Constructor & Destructor Documentation

◆ USBSerial()

USBSerial::USBSerial ( unsigned  vid,
unsigned  pid,
QObject *  parent = nullptr 
)
explicitprotected

Constructs an opens new serial interface to the devices identified by the given vendor and product IDs.

Parameters
vidVendor ID of device.
pidProduct ID of device.
parentSpecifies the parent object.

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