libdrmconf
0.12.0
A library to program DMR radios.
|
Implements an interface to Anytone AT-D868UV VHF/UHF 7W DMR (Tier I & II) radios. More...
#include <d868uv.hh>
Public Member Functions | |
D868UV (AnytoneInterface *device=nullptr, QObject *parent=nullptr) | |
Do not construct this class directly, rather use Radio::detect . | |
const RadioLimits & | limits () const |
Returns the limits for this radio. More... | |
![]() | |
virtual | ~AnytoneRadio () |
Destructor. | |
const QString & | name () const |
Returns the name of the radio (e.g., device identifier). | |
const Codeplug & | codeplug () const |
Returns the codeplug instance. | |
Codeplug & | codeplug () |
Returns the codeplug instance. | |
![]() | |
Radio (QObject *parent=nullptr) | |
Default constructor. | |
virtual const CallsignDB * | callsignDB () const |
Returns the call-sign DB instance. | |
virtual CallsignDB * | callsignDB () |
Returns the call-sign DB instance. | |
Status | status () const |
Returns the current status. | |
const ErrorStack & | errorStack () const |
Returns the error stack, passed to startDownload , startUpload or startUploadCallsignDB . More... | |
Static Public Member Functions | |
static RadioInfo | defaultRadioInfo () |
Returns the default radio information. More... | |
![]() | |
static Radio * | detect (const USBDeviceDescriptor &descr, const RadioInfo &force=RadioInfo(), const ErrorStack &err=ErrorStack()) |
Tries to detect the radio connected to the specified interface or constructs the specified radio using the RadioInfo passed by force . | |
Protected Attributes | |
RadioLimits * | _limits |
Holds the limits for this radio. | |
![]() | |
QString | _name |
The device identifier. | |
AnytoneInterface * | _dev |
The interface to the radio. | |
Codeplug::Flags | _codeplugFlags |
If true , the codeplug on the radio gets updated upon upload. More... | |
Config * | _config |
Owns the generic configuration. | |
UserDatabase * | _userDB |
A weak reference to the user-database. | |
AnytoneCodeplug * | _codeplug |
The actual binary codeplug representation. | |
CallsignDB * | _callsigns |
The actual binary callsign database representation. | |
![]() | |
Status | _task |
The current state/task. | |
ErrorStack | _errorStack |
The error stack. | |
Additional Inherited Members | |
![]() | |
enum | Status { StatusIdle , StatusDownload , StatusUpload , StatusUploadCallsigns , StatusError } |
Possible states of the radio object. More... | |
![]() | |
bool | startDownload (bool blocking=false, const ErrorStack &err=ErrorStack()) |
Starts the download of the codeplug and derives the generic configuration from it. | |
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 radio. | |
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. | |
![]() | |
virtual bool | startDownload (bool blocking=false, const ErrorStack &err=ErrorStack())=0 |
Starts the download of the codeplug. More... | |
virtual bool | startUpload (Config *config, bool blocking=false, const Codeplug::Flags &flags=Codeplug::Flags(), const ErrorStack &err=ErrorStack())=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, const CallsignDB::Selection &selection=CallsignDB::Selection(), const ErrorStack &err=ErrorStack())=0 |
Assembles the callsign DB from the given one and uploads it to the device. | |
![]() | |
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. | |
![]() | |
AnytoneRadio (const QString &name, AnytoneInterface *device=nullptr, QObject *parent=nullptr) | |
Do not construct this class directly. | |
void | run () |
Thread main routine, performs all blocking IO operations for codeplug up- and download. | |
Implements an interface to Anytone AT-D868UV VHF/UHF 7W DMR (Tier I & II) radios.
The reverse-engineering of the D868UVCodeplug 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 codeplug) require that the transfer of the codeplug 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 codeplug. 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 codeplug settings. Finally, the resulting binary codeplug gets written back to the device.
This rather complex method of writing a codeplug to the device is needed to maintain all settings within the radio that are not defined within the common codeplug config while keeping the amount of data being read from and written to the device small.
|
static |
Returns the default radio information.
The actual instance may have different properties due to variants of the same radio.
|
virtual |
Returns the limits for this radio.
Call RadioLimits::verifyConfig
to verify a codeplug with respect to a radio.
Implements Radio.