libdrmconf  0.10.4
A library to program DMR radios.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
USBDeviceDescriptor Class Reference

Base class for all radio interface descriptors representing a unique interface to a connected radio. More...

#include <usbdevice.hh>

Inheritance diagram for USBDeviceDescriptor:
Inheritance graph
[legend]
Collaboration diagram for USBDeviceDescriptor:
Collaboration graph
[legend]

Public Member Functions

 USBDeviceDescriptor ()
 Empty constructor.
 
 USBDeviceDescriptor (const USBDeviceDescriptor &other)
 Copy constructor.
 
USBDeviceDescriptoroperator= (const USBDeviceDescriptor &other)
 Assignment.
 
bool isValid () const
 Returns true if the descriptor is still valid. More...
 
QString description () const
 Returns a human readable description of the device.
 
const QVariant & device () const
 Returns the device information identifying the interface uniquely.
 
QString deviceHandle () const
 Returns a unique string representation of the device information.
 
- Public Member Functions inherited from USBDeviceInfo
 USBDeviceInfo ()
 Empty constructor.
 
 USBDeviceInfo (Class cls, uint16_t vid, uint16_t pid, bool save=true, bool identifiable=true)
 Constructor from class, VID and PID.
 
virtual ~USBDeviceInfo ()
 Destructor.
 
 USBDeviceInfo (const USBDeviceInfo &other)
 Copy constructor.
 
USBDeviceInfooperator= (const USBDeviceInfo &other)
 Assignment.
 
bool operator== (const USBDeviceInfo &other) const
 Comparison.
 
bool operator!= (const USBDeviceInfo &other) const
 Comparison.
 
bool isValid () const
 Returns true if the interface info is valid.
 
Class interfaceClass () const
 Returns the interface class.
 
uint16_t vendorId () const
 Returns the vendor ID or 0 if not set.
 
uint16_t productId () const
 Returns the product ID or 0 if not set.
 
QString description () const
 Returns a brief human readable description of the interface.
 
QString longDescription () const
 Returns a more extensive human readable description of the interface.
 
bool isSave () const
 Returns true if it is save to send commands to this device without user approval. More...
 
bool isIdentifiable () const
 Returns true if the radio is identifiable automatically.
 

Static Public Member Functions

static QList< USBDeviceDescriptordetect ()
 Searches for all connected radios (may contain false positives).
 

Protected Member Functions

 USBDeviceDescriptor (const USBDeviceInfo &info, const QString &device)
 Hidden constructor from info and path string.
 
 USBDeviceDescriptor (const USBDeviceInfo &info, const USBDeviceHandle &device)
 Hidden constructor from info and USB device address.
 
bool validSerial () const
 Checks a serial port.
 
bool validRawUSB () const
 Checks a raw USB device.
 

Protected Attributes

QVariant _device
 Holds some information to identify the radio interface uniquely.
 
- Protected Attributes inherited from USBDeviceInfo
Class _class
 The class of the interface.
 
uint16_t _vid
 The USB vid.
 
uint16_t _pid
 The USB pid.
 
bool _save
 If true, it is save to send commands to the device without user approval.
 
bool _identifiable
 If true, the device may be identified automatically.
 

Additional Inherited Members

- Public Types inherited from USBDeviceInfo
enum class  Class { None , Serial , DFU , HID }
 Possible interface types. More...
 

Detailed Description

Base class for all radio interface descriptors representing a unique interface to a connected radio.

This class extends the USBDeviceInfo by some information to identify a USB uniquely. This is either the bus and device number or the path to the serial port.

Member Function Documentation

◆ isValid()

bool USBDeviceDescriptor::isValid ( ) const

Returns true if the descriptor is still valid.

That is, if the described device is still connected.


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