libdrmconf  0.10.4
A library to program DMR radios.
radioddity_radio.hh
1 
5 #ifndef RADIODDITY_RADIO_HH
6 #define RADIODDITY_RADIO_HH
7 
8 #include "radio.hh"
9 #include "radioddity_interface.hh"
10 
14 class RadioddityRadio: public Radio
15 {
16  Q_OBJECT
17 
18 public:
20  explicit RadioddityRadio(RadioddityInterface *device=nullptr, QObject *parent=nullptr);
21 
22  virtual ~RadioddityRadio();
23 
24 public slots:
26  bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack());
29  bool startUpload(Config *config, bool blocking=false,
30  const Codeplug::Flags &flags = Codeplug::Flags(), const ErrorStack &err=ErrorStack());
32  bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
33  const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack());
34 
35 protected:
37  void run();
38 
39 private:
40  virtual bool download();
41  virtual bool upload();
42  virtual bool uploadCallsigns();
43 
44 protected:
53 };
54 
55 #endif // RADIODDITY_RADIO_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
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
Base class for all Radio objects.
Definition: radio.hh:32
Implements a radio interface for radios using the HID USB schema (i.e.
Definition: radioddity_interface.hh:18
Base class for all Radioddity radios.
Definition: radioddity_radio.hh:15
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: radioddity_radio.cc:45
Codeplug::Flags _codeplugFlags
Holds the flags to control assembly and upload of code-plugs.
Definition: radioddity_radio.hh:48
Config * _config
The generic configuration.
Definition: radioddity_radio.hh:50
RadioddityRadio(RadioddityInterface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly, rather use Radio::detect.
Definition: radioddity_radio.cc:9
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: radioddity_radio.cc:65
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition: radioddity_radio.cc:28
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: radioddity_radio.cc:76
UserDatabase * _userDB
A weak reference to the user-database.
Definition: radioddity_radio.hh:52
RadioddityInterface * _dev
The interface to the radio.
Definition: radioddity_radio.hh:46
Auto-updating DMR user database.
Definition: userdatabase.hh:23