libdrmconf  0.12.0
A library to program DMR radios.
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Radio Class Referenceabstract

Base class for all Radio objects. More...

#include <radio.hh>

Inheritance diagram for Radio:
Inheritance graph
[legend]
Collaboration diagram for Radio:
Collaboration graph
[legend]

Public Types

enum  Status {
  StatusIdle , StatusDownload , StatusUpload , StatusUploadCallsigns ,
  StatusError
}
 Possible states of the radio object. More...
 

Public Slots

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.
 

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 RadioLimitslimits () const =0
 Returns the limits for this radio. More...
 
virtual const Codeplugcodeplug () const =0
 Returns the codeplug instance.
 
virtual Codeplugcodeplug ()=0
 Returns the codeplug instance.
 
virtual const CallsignDBcallsignDB () const
 Returns the call-sign DB instance.
 
virtual CallsignDBcallsignDB ()
 Returns the call-sign DB instance.
 
Status status () const
 Returns the current status.
 
const ErrorStackerrorStack () const
 Returns the error stack, passed to startDownload, startUpload or startUploadCallsignDB. More...
 

Static Public Member Functions

static Radiodetect (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

Status _task
 The current state/task.
 
ErrorStack _errorStack
 The error stack.
 

Detailed Description

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 between device specific code-plugs and generic configurations.

Member Enumeration Documentation

◆ Status

Possible states of the radio object.

Enumerator
StatusIdle 

Idle, nothing to do.

StatusDownload 

Downloading codeplug.

StatusUpload 

Uploading codeplug.

StatusUploadCallsigns 

Uploading codeplug.

StatusError 

An error occurred.

Member Function Documentation

◆ errorStack()

const ErrorStack & Radio::errorStack ( ) const

Returns the error stack, passed to startDownload, startUpload or startUploadCallsignDB.

It contains the error messages from the upload/download process.

◆ limits()

virtual const RadioLimits& Radio::limits ( ) const
pure virtual

Returns the limits for this radio.

Call RadioLimits::verifyConfig to verify a codeplug with respect to a radio.

Since
Version 0.10.2

Implemented in UV390, RD5R, OpenGD77, MD390, MD2017, GD77, GD73, DR1801UV, DMR6X2UV, DM1701, D878UV2, D878UV, D868UV, and D578UV.

◆ startDownload

virtual bool Radio::startDownload ( bool  blocking = false,
const ErrorStack err = ErrorStack() 
)
pure virtualslot

Starts the download of the codeplug.

Once the download finished, the codeplug can be accessed and decoded using the codeplug() method.

Implemented in DR1801UV.


The documentation for this class was generated from the following files: