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

Generic information about a possible radio interface. More...

#include <usbdevice.hh>

Inheritance diagram for USBDeviceInfo:
Inheritance graph
[legend]

Public Types

enum class  Class { None , Serial , DFU , HID }
 Possible interface types. More...
 

Public Member Functions

 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.
 

Protected Attributes

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.
 

Detailed Description

Generic information about a possible radio interface.

This class combines the USB vendor, product ID and some meta information about the interface. In particular if it is save to access the device without user ineraction and if the protocol implements means for identifying the specific radio.

Member Enumeration Documentation

◆ Class

enum USBDeviceInfo::Class
strong

Possible interface types.

Enumerator
None 

Class for invalid interface info.

Serial 

Serial port interface class.

DFU 

DFU interface class.

HID 

HID (human-interface device) interface class.

Member Function Documentation

◆ isSave()

bool USBDeviceInfo::isSave ( ) const

Returns true if it is save to send commands to this device without user approval.

This is true for radios which use somewhat unique VID:PIDs. Radios with generic USB-serial chips are not save, as other devices may use the same chip and sending data to these devices may be harmful.


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