libdrmconf  0.12.0
A library to program DMR radios.
gd73.hh
1 
9 #ifndef GD73_HH
10 #define GD73_HH
11 
12 #include "radio.hh"
13 #include "gd73_interface.hh"
14 #include "gd73_codeplug.hh"
15 
16 
17 
21 class GD73 : public Radio
22 {
23  Q_OBJECT
24 
25 public:
27  explicit GD73(GD73Interface *device=nullptr, QObject *parent=nullptr);
28 
29  const QString &name() const;
30  const RadioLimits &limits() const;
31  const Codeplug &codeplug() const;
32  Codeplug &codeplug();
33 
36  static RadioInfo defaultRadioInfo();
37 
38 public slots:
40  bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack());
41 
44  bool startUpload(Config *config, bool blocking=false,
45  const Codeplug::Flags &flags = Codeplug::Flags(), const ErrorStack &err=ErrorStack());
46 
48  bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
49  const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack());
50 
51 protected:
53  void run();
54 
55 private:
56  virtual bool download();
57  virtual bool upload();
58  virtual bool uploadCallsigns();
59 
60 protected:
62  QString _name;
63 
70 
73 
74 private:
76  static RadioLimits *_limits;
77 };
78 
79 #endif // GD77_HH
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition: callsigndb.hh:20
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition: codeplug.hh:25
This class defines the interface all device-specific code-plugs must implement.
Definition: codeplug.hh:19
The config class, representing the codeplug configuration.
Definition: config.hh:70
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Represents, encodes and decodes the device specific codeplug for a Radioddity GD-73.
Definition: gd73_codeplug.hh:53
Implements the communication interface to the GD-73.
Definition: gd73_interface.hh:10
Implements an USB interface to the Radioddity GD-73 UHF 2W DMR (Tier I&II) radio.
Definition: gd73.hh:22
GD73Codeplug _codeplug
The codeplug.
Definition: gd73.hh:72
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: gd73.cc:98
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: gd73.cc:44
bool startUploadCallsignDB(UserDatabase *db, bool blocking=false, const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack())
Encodes the given user-database and uploades it to the device.
Definition: gd73.cc:87
bool startUpload(Config *config, bool blocking=false, const Codeplug::Flags &flags=Codeplug::Flags(), const ErrorStack &err=ErrorStack())
Derives the device-specific codeplug from the generic configuration and uploads that codeplug to the ...
Definition: gd73.cc:67
Config * _config
The generic configuration.
Definition: gd73.hh:69
const RadioLimits & limits() const
Returns the limits for this radio.
Definition: gd73.cc:27
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition: gd73.cc:50
GD73(GD73Interface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly, rather use Radio::detect.
Definition: gd73.cc:13
const QString & name() const
Returns the name of the radio (e.g., device identifier).
Definition: gd73.cc:22
QString _name
The device identifier.
Definition: gd73.hh:62
const Codeplug & codeplug() const
Returns the codeplug instance.
Definition: gd73.cc:34
GD73Interface * _dev
The interface to the radio.
Definition: gd73.hh:65
Codeplug::Flags _codeplugFlags
Holds the flags to control assembly and upload of code-plugs.
Definition: gd73.hh:67
Provides some information about a radio model.
Definition: radioinfo.hh:16
Represents the limits or the entire codeplug.
Definition: radiolimits.hh:684
Base class for all Radio objects.
Definition: radio.hh:32
Auto-updating DMR user database.
Definition: userdatabase.hh:23