LibDMRConf
0.6.0
A library to program DMR radios.
|
Base class for all Radio objects. More...
#include <radio.hh>
Classes | |
struct | Features |
Represents a radio feature list, a generic configuration is verified against. More... | |
Public Types | |
enum | Status { StatusIdle, StatusDownload, StatusUpload, StatusUploadCallsigns, StatusError } |
Possible states of the radio object. More... | |
Public Slots | |
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. | |
Signals | |
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. | |
Public Member Functions | |
Radio (QObject *parent=nullptr) | |
Default constructor. | |
virtual const QString & | name () const =0 |
Returns the name of the radio (e.g., device identifier). | |
virtual const Features & | features () const =0 |
Returns the features for the particular radio. | |
virtual const CodePlug & | codeplug () const =0 |
Returns the codeplug instance. | |
virtual CodePlug & | codeplug ()=0 |
Returns the codeplug instance. | |
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. | |
Static Public Member Functions | |
static Radio * | detect (QString &errorMessage, const QString &force="") |
Detects a radio and returns the corresponding device specific radio instance. | |
Protected Attributes | |
Status | _task |
The current state/task. | |
QString | _errorMessage |
Holds the last error message. | |
Base class for all Radio objects.
The radio objects represents a connected radio. This class controlles the communication with the device as well as the conversion betwenn device specific code-plugs and generic configurations.
enum Radio::Status |
|
pure virtualslot |
Starts the download of the codeplug.
Once the download finished, the codeplug can be accessed and decoded using the codeplug()
method.
bool Radio::verifyConfig | ( | Config * | config, |
QList< VerifyIssue > & | issues | ||
) |
Verifies the configuration against the radio features.
On exit, issues
will contain the issues found.