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

Provides some information about a radio model. More...

#include <radioinfo.hh>

Collaboration diagram for RadioInfo:
Collaboration graph
[legend]

Public Types

enum  Radio {
  OpenGD77 , OpenRTX , RD5R , GD73 ,
  GD77 , MD390 , MD380 = MD390 , RT8 = MD390 ,
  UV390 , UV380 = UV390 , RT3S = UV390 , MD2017 ,
  RT82 = MD2017 , D868UVE , D868UV = D868UVE , DMR6X2UV ,
  D878UV , D878UVII , D578UV , DM1701 ,
  RT84 = DM1701 , DR1801UV
}
 Known radios.
 

Public Member Functions

 RadioInfo (Radio radio, const QString &name, const QString manufacturer, const USBDeviceInfo &interface, const QList< RadioInfo > &alias=QList< RadioInfo >())
 Use static methods the access radio info or call Radio::defaultRadioInfo.
 
 RadioInfo (Radio radio, const QString &key, const QString &name, const QString manufacturer, const USBDeviceInfo &interface, const QList< RadioInfo > &alias=QList< RadioInfo >())
 Use static methods the access radio info or call Radio::defaultRadioInfo.
 
 RadioInfo ()
 Empty constructor.
 
bool isValid () const
 Returns true if the info is valid.
 
const QString & key () const
 Returns the radio key (used to identify radios in the command line).
 
const QString & name () const
 Returns the radio name.
 
const QString & manufacturer () const
 Returns the manufacturer name.
 
const USBDeviceInfointerface () const
 Returns some information about the interface to the radio.
 
bool hasAlias () const
 Returns true if the radio has aliases. More...
 
const QList< RadioInfo > & alias () const
 Returns the list of alias radios.
 
Radio id () const
 Returns the unique device ID (alias radios share ID).
 

Static Public Member Functions

static bool hasRadioKey (const QString &key)
 Returns true if the given key is known.
 
static RadioInfo byKey (const QString &key)
 Returns the radio info by key.
 
static RadioInfo byID (Radio radio)
 Returns the radio info by id.
 
static QList< RadioInfoallRadios (bool flat=true)
 Returns the list of all known radios.
 
static QList< RadioInfoallRadios (const USBDeviceInfo &interface, bool flat=true)
 Returns a list of all known radios for the specified interface.
 

Protected Attributes

Radio _radio
 Holds the radio id.
 
QString _key
 Holds the key of the radio.
 
QString _name
 Holds the name of the radio.
 
QString _manufacturer
 Holds the name of the manufacturer.
 
QList< RadioInfo_alias
 Holds possible identical radios from other manufacturers.
 
USBDeviceInfo _interface
 Holds some information about the interface to the radio.
 

Static Protected Attributes

static QHash< QString, Radio_radiosByName
 Key->ID map. More...
 
static QHash< unsigned, RadioInfo_radiosById
 ID->Info map. More...
 

Detailed Description

Provides some information about a radio model.

This class is used to unify radio enumeration and detection.

Since
0.9.0

Member Function Documentation

◆ hasAlias()

bool RadioInfo::hasAlias ( ) const

Returns true if the radio has aliases.

That is other radios that are identical.

Member Data Documentation

◆ _radiosById

QHash< unsigned, RadioInfo > RadioInfo::_radiosById
staticprotected
Initial value:
= QHash<unsigned, RadioInfo>{
{RadioInfo::OpenGD77, OpenGD77::defaultRadioInfo()},
{RadioInfo::OpenRTX, OpenRTX::defaultRadioInfo()},
{RadioInfo::RD5R, RD5R::defaultRadioInfo()},
{RadioInfo::GD73, GD73::defaultRadioInfo()},
{RadioInfo::GD77, GD77::defaultRadioInfo()},
{RadioInfo::MD390, MD390::defaultRadioInfo()},
{RadioInfo::UV390, UV390::defaultRadioInfo()},
{RadioInfo::MD2017, MD2017::defaultRadioInfo()},
{RadioInfo::DM1701, DM1701::defaultRadioInfo()},
{RadioInfo::D868UVE, D868UV::defaultRadioInfo()},
{RadioInfo::D878UV, D878UV::defaultRadioInfo()},
{RadioInfo::D878UVII, D878UV2::defaultRadioInfo()},
{RadioInfo::D578UV, D578UV::defaultRadioInfo()},
{RadioInfo::DMR6X2UV, DMR6X2UV::defaultRadioInfo()},
{RadioInfo::DR1801UV, DR1801UV::defaultRadioInfo()}
}
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: d578uv.cc:154
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: d868uv.cc:121
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: d878uv2.cc:145
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: d878uv.cc:146
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: dm1701.cc:30
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: dmr6x2uv.cc:114
static RadioInfo defaultRadioInfo()
Retunrs the default radio info.
Definition: dr1801uv.cc:19
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: gd73.cc:44
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: gd77.cc:42
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: md2017.cc:50
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: md390.cc:109
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: opengd77.cc:53
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: openrtx.cc:47
static RadioInfo defaultRadioInfo()
Returns the default info about the radio.
Definition: rd5r.cc:44
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: uv390.cc:51

ID->Info map.

◆ _radiosByName

QHash< QString, RadioInfo::Radio > RadioInfo::_radiosByName
staticprotected
Initial value:
= QHash<QString, RadioInfo::Radio>{
{"opengd77", RadioInfo::OpenGD77},
{"openrtx", RadioInfo::OpenRTX},
{"rd5r", RadioInfo::RD5R},
{"gd73", RadioInfo::GD73},
{"gd77", RadioInfo::GD77},
{"md380", RadioInfo::MD380},
{"md390", RadioInfo::MD390},
{"rt8", RadioInfo::RT8},
{"uv380", RadioInfo::UV380},
{"uv390", RadioInfo::UV390},
{"rt3s", RadioInfo::RT3S},
{"md2017", RadioInfo::MD2017},
{"rt82", RadioInfo::RT82},
{"dm1701", RadioInfo::DM1701},
{"rt84", RadioInfo::RT84},
{"d868uv", RadioInfo::D868UV},
{"d868uve", RadioInfo::D868UVE},
{"dmr6x2uv", RadioInfo::DMR6X2UV},
{"d878uv", RadioInfo::D878UV},
{"d878uv2", RadioInfo::D878UVII},
{"d578uv", RadioInfo::D578UV},
{"dr1801uv", RadioInfo::DR1801UV}
}

Key->ID map.


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