libdrmconf
0.12.0
A library to program DMR radios.
|
Generic information about a possible radio interface. More...
#include <usbdevice.hh>
Public Types | |
enum class | Class { None , Serial , DFU , HID , C7K } |
Possible interface types. More... | |
Public Member Functions | |
USBDeviceInfo () | |
Empty constructor. | |
USBDeviceInfo (Class cls, uint16_t vid, uint16_t pid, bool save=true) | |
Constructor from class, VID and PID. | |
virtual | ~USBDeviceInfo () |
Destructor. | |
USBDeviceInfo (const USBDeviceInfo &other) | |
Copy constructor. | |
USBDeviceInfo & | operator= (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. | |
bool | hasVendorID () const |
Retunrs true , if a vendor ID is set. | |
uint16_t | vendorId () const |
Returns the vendor ID or 0 if not set. | |
bool | hasProductID () const |
Retunrs true , if a product ID is 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... | |
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. | |
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.
|
strong |
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.