libdrmconf  0.10.4
A library to program DMR radios.
opengd77.hh
1 
5 #ifndef OPENGD77_HH
6 #define OPENGD77_HH
7 
8 #include "radio.hh"
9 #include "opengd77_interface.hh"
10 #include "opengd77_codeplug.hh"
11 #include "opengd77_callsigndb.hh"
12 
13 
17 class OpenGD77 : public Radio
18 {
19  Q_OBJECT
20 
21 public:
23  explicit OpenGD77(OpenGD77Interface *device=nullptr, QObject *parent=nullptr);
24  virtual ~OpenGD77();
25 
26  const QString &name() const;
27  const RadioLimits &limits() const;
28  const Codeplug &codeplug() const;
29  Codeplug &codeplug();
30 
33  static RadioInfo defaultRadioInfo();
34 
35 public slots:
37  bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack());
40  bool startUpload(Config *config, bool blocking=false,
41  const Codeplug::Flags &flags = Codeplug::Flags(), const ErrorStack &err=ErrorStack());
43  bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
44  const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack());
45 
46 protected:
48  void run();
49 
51  bool download();
53  bool upload();
55  bool uploadCallsigns();
56 
57 protected:
59  QString _name;
68 
69 private:
71  static RadioLimits *_limits;
72 };
73 
74 #endif // OPENGD77_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:24
This class defines the interface all device-specific code-plugs must implement.
Definition: codeplug.hh:18
The config class, representing the codeplug configuration.
Definition: config.hh:67
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Represents and encodes the binary format for the call-sign database within the radio.
Definition: opengd77_callsigndb.hh:20
Represents, encodes and decodes the device specific codeplug for Open GD-77 firmware.
Definition: opengd77_codeplug.hh:57
Implements the interfact to a radio running the Open GD77 firmware.
Definition: opengd77_interface.hh:16
Implements an USB interface to Open GD-77(S) VHF/UHF 5W DMR (Tier I&II) radios.
Definition: opengd77.hh:18
const RadioLimits & limits() const
Returns the limits for this radio.
Definition: opengd77.cc:36
const QString & name() const
Returns the name of the radio (e.g., device identifier).
Definition: opengd77.cc:31
OpenGD77CallsignDB _callsigns
The actual binary callsign DB representation.
Definition: opengd77.hh:67
OpenGD77Codeplug _codeplug
The actual binary codeplug representation.
Definition: opengd77.hh:65
OpenGD77(OpenGD77Interface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly, rather use Radio::detect.
Definition: opengd77.cc:11
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: opengd77.cc:147
bool upload()
Implements the actual codeplug upload process.
Definition: opengd77.cc:264
QString _name
The device identifier.
Definition: opengd77.hh:59
bool download()
Implements the actual download process.
Definition: opengd77.cc:214
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: opengd77.cc:53
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition: opengd77.cc:60
Config * _config
The generic configuration.
Definition: opengd77.hh:63
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: opengd77.cc:117
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: opengd77.cc:84
bool uploadCallsigns()
Implements the actual callsign DB upload process.
Definition: opengd77.cc:341
const Codeplug & codeplug() const
Returns the codeplug instance.
Definition: opengd77.cc:43
OpenGD77Interface * _dev
The interface to the radio.
Definition: opengd77.hh:61
Provides some information about a radio model.
Definition: radioinfo.hh:16
Represents the limits or the entire codeplug.
Definition: radiolimits.hh:678
Base class for all Radio objects.
Definition: radio.hh:32
Auto-updating DMR user database.
Definition: userdatabase.hh:23