libdrmconf  0.10.4
A library to program DMR radios.
openrtx.hh
1 
5 #ifndef OPENGRTX_HH
6 #define OPENGRTX_HH
7 
8 #include "radio.hh"
9 //#include "openrtx_interface.hh"
10 #include "openrtx_codeplug.hh"
11 
12 class OpenRTXInterface;
13 
17 class OpenRTX: public Radio
18 {
19  Q_OBJECT
20 
21 public:
23  explicit OpenRTX(OpenRTXInterface *device=nullptr, QObject *parent=nullptr);
24  virtual ~OpenRTX();
25 
26  const QString &name() const;
27  const Codeplug &codeplug() const;
28  Codeplug &codeplug();
29 
32  static RadioInfo defaultRadioInfo();
33 
34 public slots:
36  bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack());
39  bool startUpload(Config *config, bool blocking=false,
40  const Codeplug::Flags &flags = Codeplug::Flags(),
41  const ErrorStack &err=ErrorStack());
43  bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
45  const ErrorStack &err=ErrorStack());
46 
47 protected:
49  void run();
50 
53  bool connect(const ErrorStack &err=ErrorStack());
55  bool download(const ErrorStack &err=ErrorStack());
57  bool upload(const ErrorStack &err=ErrorStack());
58 
59 protected:
61  QString _name;
68 };
69 
70 #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
Implements the binary encoding and decoding of the OpenRTX codeplug.
Definition: openrtx_codeplug.hh:31
Implements the communication interface to radios running the OpenRTX firmware.
Definition: openrtx_interface.hh:11
Implements an USB interface to radios running the Open RTX firmware.
Definition: openrtx.hh:18
bool upload(const ErrorStack &err=ErrorStack())
Implements the actual codeplug upload process.
Definition: openrtx.cc:239
QString _name
The device identifier.
Definition: openrtx.hh:61
const QString & name() const
Returns the name of the radio (e.g., device identifier).
Definition: openrtx.cc:32
bool connect(const ErrorStack &err=ErrorStack())
Connects to the radio, if a radio interface is passed to the constructor, this interface instance is ...
Definition: openrtx.cc:168
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: openrtx.cc:77
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: openrtx.cc:108
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: openrtx.cc:118
static RadioInfo defaultRadioInfo()
Returns the default radio information.
Definition: openrtx.cc:47
const Codeplug & codeplug() const
Returns the codeplug instance.
Definition: openrtx.cc:37
Config * _config
The generic configuration.
Definition: openrtx.hh:65
bool download(const ErrorStack &err=ErrorStack())
Implements the actual download process.
Definition: openrtx.cc:188
OpenRTXCodeplug _codeplug
The actual binary codeplug representation.
Definition: openrtx.hh:67
OpenRTX(OpenRTXInterface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly, rather use Radio::detect.
Definition: openrtx.cc:10
OpenRTXInterface * _dev
The interface to the radio.
Definition: openrtx.hh:63
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition: openrtx.cc:54
Provides some information about a radio model.
Definition: radioinfo.hh:16
Base class for all Radio objects.
Definition: radio.hh:32
Auto-updating DMR user database.
Definition: userdatabase.hh:23