libdrmconf  0.10.4
A library to program DMR radios.
tyt_radio.hh
1 
5 #ifndef TYT_RADIO_HH
6 #define TYT_RADIO_HH
7 
8 #include "radio.hh"
9 #include "tyt_interface.hh"
10 
14 class TyTRadio: public Radio
15 {
16  Q_OBJECT
17 
18 public:
20  explicit TyTRadio(TyTInterface *device=nullptr, QObject *parent=nullptr);
21 
22  virtual ~TyTRadio();
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(),
31  const ErrorStack &err=ErrorStack());
33  bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
35  const ErrorStack &err=ErrorStack());
36 
37 protected:
39  void run();
40 
41 private:
42  virtual bool download();
43  virtual bool upload();
44  virtual bool uploadCallsigns();
45 
46 protected:
55 };
56 
57 #endif // UV390_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
Interface to TyT (and Retevis) devices.
Definition: tyt_interface.hh:64
Implements an USB interface to TYT & Retevis radios.
Definition: tyt_radio.hh:15
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: tyt_radio.cc:91
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: tyt_radio.cc:47
TyTInterface * _dev
The interface to the radio.
Definition: tyt_radio.hh:48
TyTRadio(TyTInterface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly, rather use Radio::detect.
Definition: tyt_radio.cc:9
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition: tyt_radio.cc:30
Config * _config
The generic configuration.
Definition: tyt_radio.hh:52
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: tyt_radio.cc:67
UserDatabase * _userDB
A weak reference to the user-database.
Definition: tyt_radio.hh:54
Codeplug::Flags _codeplugFlags
Holds the flags to control assembly and upload of code-plugs.
Definition: tyt_radio.hh:50
Auto-updating DMR user database.
Definition: userdatabase.hh:23