LibDMRConf
0.6.0
A library to program DMR radios.
|
Implements an interface to Anytone AT-D878UV VHF/UHF 7W DMR (Tier I & II) radios. More...
#include <d878uv.hh>
Public Slots | |
bool | startDownload (bool blocking=false) |
Starts the download of the codeplug and derives the generic configuration from it. | |
bool | startUpload (Config *config, bool blocking=false, bool update=true) |
Derives the device-specific codeplug from the generic configuration and uploads that codeplug to the radio. | |
bool | startUploadCallsignDB (UserDatabase *db, bool blocking=false) |
Encodes the given user-database and uploades it to the device. | |
![]() | |
virtual bool | startDownload (bool blocking=false)=0 |
Starts the download of the codeplug. More... | |
virtual bool | startUpload (Config *config, bool blocking=false, bool update=true)=0 |
Derives the device-specific codeplug from the generic configuration and uploads that codeplug to the radio. | |
virtual bool | startUploadCallsignDB (UserDatabase *db, bool blocking=false)=0 |
Assembles the callsign DB from the given one and uploads it to the device. | |
Public Member Functions | |
D878UV (QObject *parent=nullptr) | |
Do not construct this class directly, rather use Radio::detect . | |
const QString & | name () const |
Returns the name of the radio (e.g., device identifier). | |
const Radio::Features & | features () const |
Returns the features for the particular radio. | |
const CodePlug & | codeplug () const |
Returns the codeplug instance. | |
CodePlug & | codeplug () |
Returns the codeplug instance. | |
![]() | |
Radio (QObject *parent=nullptr) | |
Default constructor. | |
bool | verifyConfig (Config *config, QList< VerifyIssue > &issues) |
Verifies the configuration against the radio features. More... | |
Status | status () const |
Returns the current status. | |
const QString & | errorMessage () const |
Returns the last error message. | |
void | clearError () |
Clears the last error message and state. | |
Protected Member Functions | |
void | run () |
Thread main routine, performs all blocking IO operations for codeplug up- and download. | |
bool | download () |
Downloads the codeplug from the radio. More... | |
bool | upload () |
Uploads the encoded codeplug to the radio. More... | |
Protected Attributes | |
QString | _name |
The device identifier. | |
AnytoneInterface * | _dev |
The interface to the radio. | |
bool | _codeplugUpdate |
If true , the codeplug on the radio gets updated upon upload. More... | |
Config * | _config |
The generic configuration. | |
UserDatabase * | _userDB |
A weak reference to the user-database. | |
D878UVCodeplug | _codeplug |
The actual binary codeplug representation. | |
![]() | |
Status | _task |
The current state/task. | |
QString | _errorMessage |
Holds the last error message. | |
Additional Inherited Members | |
![]() | |
enum | Status { StatusIdle, StatusDownload, StatusUpload, StatusUploadCallsigns, StatusError } |
Possible states of the radio object. More... | |
![]() | |
void | downloadStarted () |
Gets emitted once the codeplug download has been started. | |
void | downloadProgress (int percent) |
Gets emitted on download progress (e.g., for progress bars). | |
void | downloadFinished (Radio *radio, CodePlug *codeplug) |
Gets emitted once the codeplug download has been finished. | |
void | downloadError (Radio *radio) |
Gets emitted if there was an error during the codeplug download. | |
void | uploadStarted () |
Gets emitted once the codeplug upload has been started. | |
void | uploadProgress (int percent) |
Gets emitted on upload progress (e.g., for progress bars). | |
void | uploadError (Radio *radio) |
Gets emitted if there was an error during the upload. | |
void | uploadComplete (Radio *radio) |
Gets emitted once the codeplug upload has been completed successfully. | |
![]() | |
static Radio * | detect (QString &errorMessage, const QString &force="") |
Detects a radio and returns the corresponding device specific radio instance. | |
Implements an interface to Anytone AT-D878UV VHF/UHF 7W DMR (Tier I & II) radios.
The reverse-engineering of the D878UVCodeplug was quiet hard as it is huge and the radio provides a lot of bells and whistles. Moreover, the binary code-plug file created by the windows CPS does not directly relate to the data being written to the device. These two issues (a lot of features and a huge code-plug) require that the transfer of the code-plug to the device is performed in 4 steps.
First only the bitmaps of all lists are downloaded from the device. Then all elements that are not touched or only updated by the common code-plug config are downloaded. Then, the common config gets applied to the binary code-plug. That is, all channels, contacts, zones, group-lists and scan-lists are generated and their bitmaps gets updated accordingly. Also the general config gets updated from the common code-plug settings. Finally, the resulting binar code-plug gets written back to the device.
This rather complex method of writing a code-plug to the device is needed to maintain all settings within the radio that are not defined within the common code-plug config while keeping the amount of data being read from and written to the device small.
|
protected |
Downloads the codeplug from the radio.
This method block until the download is complete.
|
protected |
Uploads the encoded codeplug to the radio.
This method block until the upload is complete.
|
protected |
If true
, the codeplug on the radio gets updated upon upload.
If false
, it gets overridden.