libdrmconf  0.12.0
A library to program DMR radios.
dr1801uv.hh
1 
8 #ifndef DR1801UV_HH
9 #define DR1801UV_HH
10 
11 #include "radio.hh"
12 #include "dr1801uv_interface.hh"
13 #include "dr1801uv_codeplug.hh"
14 #include "dr1801uv_limits.hh"
15 
19 class DR1801UV : public Radio
20 {
21  Q_OBJECT
22 
23 public:
25  explicit DR1801UV(DR1801UVInterface *device=nullptr, QObject *parent=nullptr);
26 
27 public:
29  static RadioInfo defaultRadioInfo();
30 
31  const QString &name() const;
32 
33  const RadioLimits &limits() const;
34 
35  const Codeplug &codeplug() const;
36  Codeplug &codeplug();
37 
38  bool startDownload(bool blocking, const ErrorStack &err);
39  bool startUpload(Config *config, bool blocking, const Codeplug::Flags &flags, const ErrorStack &err);
40  bool startUploadCallsignDB(UserDatabase *db, bool blocking, const CallsignDB::Selection &selection, const ErrorStack &err);
41 
42 protected:
44  void run();
45 
46 private:
47  virtual bool download();
48  virtual bool upload();
49 
50 protected:
54  QString _name;
61 
62 private:
64  static RadioLimits *_limits;
65 };
66 
67 #endif // DR1801UV_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:25
This class defines the interface all device-specific code-plugs must implement.
Definition: codeplug.hh:19
The config class, representing the codeplug configuration.
Definition: config.hh:70
Implements the binary codeplug representation of a BTECH DR-1801UV (a.k.a, BF-1801-A6).
Definition: dr1801uv_codeplug.hh:64
Implements the actual interface to the DR-1801UV, which builds upon the AuctusA6Interface.
Definition: dr1801uv_interface.hh:15
Implements the BTECH DR-1801UV (BF-1801 A6).
Definition: dr1801uv.hh:20
const QString & name() const
Returns the name of the radio (e.g., device identifier).
Definition: dr1801uv.cc:27
Config * _config
The generic configuration.
Definition: dr1801uv.hh:58
DR1801UVCodeplug _codeplug
The binary codeplug.
Definition: dr1801uv.hh:56
DR1801UV(DR1801UVInterface *device=nullptr, QObject *parent=nullptr)
Constructs a new instance representig a DR-1801UV.
Definition: dr1801uv.cc:8
QString _name
Holds the device name, once it got identified.
Definition: dr1801uv.hh:54
DR1801UVInterface * _device
Owns the interface to the device.
Definition: dr1801uv.hh:52
Codeplug::Flags _codeplugFlags
Some codeplug flags.
Definition: dr1801uv.hh:60
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition: dr1801uv.cc:102
static RadioInfo defaultRadioInfo()
Retunrs the default radio info.
Definition: dr1801uv.cc:19
bool startDownload(bool blocking, const ErrorStack &err)
Starts the download of the codeplug.
Definition: dr1801uv.cc:49
const RadioLimits & limits() const
Returns the limits for this radio.
Definition: dr1801uv.cc:42
bool startUploadCallsignDB(UserDatabase *db, bool blocking, const CallsignDB::Selection &selection, const ErrorStack &err)
Assembles the callsign DB from the given one and uploads it to the device.
Definition: dr1801uv.cc:95
const Codeplug & codeplug() const
Returns the codeplug instance.
Definition: dr1801uv.cc:32
bool startUpload(Config *config, bool blocking, const Codeplug::Flags &flags, const ErrorStack &err)
Derives the device-specific codeplug from the generic configuration and uploads that codeplug to the ...
Definition: dr1801uv.cc:71
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Provides some information about a radio model.
Definition: radioinfo.hh:16
Represents the limits or the entire codeplug.
Definition: radiolimits.hh:684
Base class for all Radio objects.
Definition: radio.hh:32
Auto-updating DMR user database.
Definition: userdatabase.hh:23