libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
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
13
17class OpenRTX: public Radio
18{
19 Q_OBJECT
20
21public:
23 explicit OpenRTX(OpenRTXInterface *device=nullptr, QObject *parent=nullptr);
24 virtual ~OpenRTX();
25
26 const QString &name() const;
27 const Codeplug &codeplug() const;
29
33
34public 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
47protected:
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
59protected:
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:26
This class defines the interface all device-specific code-plugs must implement.
Definition codeplug.hh:20
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
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:243
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:172
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:112
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition openrtx.cc:122
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:192
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