libdrmconf 0.12.3
A library to program DMR radios.
 
Loading...
Searching...
No Matches
anytone_radio.hh
1
10#ifndef __ANYTONE_RADIO_HH__
11#define __ANYTONE_RADIO_HH__
12
13#include "radio.hh"
14#include "anytone_interface.hh"
15#include "anytone_codeplug.hh"
16#include "anytone_satelliteconfig.hh"
17
34class AnytoneRadio: public Radio
35{
36 Q_OBJECT
37
38protected:
40 explicit AnytoneRadio(const QString &name, AnytoneInterface *device=nullptr, QObject *parent=nullptr);
41
42public:
44 virtual ~AnytoneRadio();
45
46 const QString &name() const;
47 const Codeplug &codeplug() const;
49
50public slots:
52 bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack());
53
56 bool startUpload(Config *config, bool blocking=false,
57 const Codeplug::Flags &flags = Codeplug::Flags(), const ErrorStack &err=ErrorStack());
58
60 bool startUploadCallsignDB(UserDatabase *db, bool blocking=false,
61 const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack());
62
63 bool startUploadSatelliteConfig(
64 SatelliteDatabase *db, bool blocking=false, const ErrorStack &err=ErrorStack());
65
66protected:
68 void run();
69
70private:
72 virtual bool download();
74 virtual bool upload();
77 virtual bool uploadCallsigns();
80 virtual bool uploadSatellites();
81
82protected:
84 QString _name;
100};
101
102#endif // __D868UV_HH__
Base class interface for all Anytone radio codeplugs.
Definition anytone_codeplug.hh:20
Implements the interface to Anytone D868UV, D878UV, etc radios.
Definition anytone_interface.hh:15
Codeplug::Flags _codeplugFlags
If true, the codeplug on the radio gets updated upon upload.
Definition anytone_radio.hh:89
AnytoneSatelliteConfig * _satellites
The actual binary callsign database representation.
Definition anytone_radio.hh:99
AnytoneRadio(const QString &name, AnytoneInterface *device=nullptr, QObject *parent=nullptr)
Do not construct this class directly.
Definition anytone_radio.cc:12
void run()
Thread main routine, performs all blocking IO operations for codeplug up- and download.
Definition anytone_radio.cc:150
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 anytone_radio.cc:71
Config * _config
Owns the generic configuration.
Definition anytone_radio.hh:91
UserDatabase * _userDB
A weak reference to the user-database.
Definition anytone_radio.hh:93
AnytoneCodeplug * _codeplug
The actual binary codeplug representation.
Definition anytone_radio.hh:95
const QString & name() const
Returns the name of the radio (e.g., device identifier).
Definition anytone_radio.cc:35
CallsignDB * _callsigns
The actual binary callsign database representation.
Definition anytone_radio.hh:97
AnytoneInterface * _dev
The interface to the radio.
Definition anytone_radio.hh:86
const Codeplug & codeplug() const
Returns the codeplug instance.
Definition anytone_radio.cc:40
virtual ~AnytoneRadio()
Destructor.
Definition anytone_radio.cc:23
bool startDownload(bool blocking=false, const ErrorStack &err=ErrorStack())
Starts the download of the codeplug and derives the generic configuration from it.
Definition anytone_radio.cc:50
QString _name
The device identifier.
Definition anytone_radio.hh:84
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 anytone_radio.cc:105
Implementation of satellite confifuration for all AnyTone devices.
Definition anytone_satelliteconfig.hh:16
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:20
Abstract base class of all callsign database implementations.
Definition callsigndb.hh:14
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
Radio(QObject *parent=nullptr)
Default constructor.
Definition radio.cc:35
A table holding all known satellites.
Definition satellitedatabase.hh:108
Auto-updating DMR user database.
Definition userdatabase.hh:23