libdrmconf  0.12.0
A library to program DMR radios.
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
AnytoneCodeplug Class Referenceabstract

Base class interface for all Anytone radio codeplugs. More...

#include <anytone_codeplug.hh>

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

Classes

class  AlarmSettingElement
 Represents the base class of alarm setting entry for all AnyTone codeplugs. More...
 
class  AnalogQuickCallElement
 Represents base class of a analog quick call entry for all AnyTone codeplugs. More...
 
class  AnalogQuickCallsElement
 Implements the list of analog quick-call settings for all AnyTone codeplugs. More...
 
class  BitmapElement
 Represents the base class for bitmaps in all AnyTone codeplugs. More...
 
class  BootSettingsElement
 Represents the base class of the boot settings for all AnyTone codeplug. More...
 
class  ChannelBitmapElement
 Represents the channel bitmaps in all AnyTone codeplugs. More...
 
class  ChannelElement
 Represents the base class for channel encodings in all AnyTone codeplugs. More...
 
class  ContactBitmapElement
 Represents the contact bitmaps in all AnyTone codeplugs. More...
 
class  ContactElement
 Represents the base class for conacts in all AnyTone codeplugs. More...
 
class  ContactMapElement
 Represents the base class for entries to the contact indices in all AnyTone codeplugs. More...
 
class  DigitalAlarmExtensionElement
 Represents the base class of digital alarm setting extension for all AnyTone codeplugs. More...
 
class  DMRAPRSMessageElement
 Represents the base class of a DMR APRS message for all AnyTone codeplugs. More...
 
class  DMRAPRSSettingsElement
 Represents the base class of DMR APRS settings for all AnyTone codeplugs. More...
 
class  DMREncryptionKeyIDListElement
 Represents a list of DMR encryption key IDs. More...
 
class  DMREncryptionKeyListElement
 Represents a list of DMR encryption keys. More...
 
class  DTMFContactBytemapElement
 Represents the DTMF contact byte map, indicating which contacts are valid. More...
 
class  DTMFContactElement
 Represents the base class for analog (DTMF) contacts in all AnyTone codeplugs. More...
 
class  DTMFIDListElement
 Represents a list of DTMF IDs to be send. More...
 
class  DTMFSettingsElement
 Represents the base class of DTMF settings for all AnyTone codeplugs. More...
 
class  ExtendedSettingsElement
 Represents the base class for the extended settings element in many AnyTone codeplugs. More...
 
class  FiveToneFunctionElement
 Represents the base-class for 5Tone function for all AnyTone codeplugs. More...
 
class  FiveToneFunctionListElement
 Represents the list of five-tone functions for all AnyTone codeplugs. More...
 
class  FiveToneIDBitmapElement
 Represents the bitmap indicating which five-tone IDs are valid. More...
 
class  FiveToneIDElement
 Represents the base-class for 5Tone IDs for all AnyTone codeplugs. More...
 
class  FiveToneIDListElement
 Represents the list of five-tone IDs. More...
 
class  FiveToneSettingsElement
 Represents the base-class for 5Tone settings for all AnyTone codeplugs. More...
 
class  GeneralSettingsElement
 Represents the base class for the settings elements in all AnyTone codeplugs. More...
 
class  GroupListBitmapElement
 Represents the bitmap indicating which group list element is valid. More...
 
class  GroupListElement
 Represents the base class for group lists in all AnyTone codeplugs. More...
 
class  HotKeyElement
 Represents the base class of a hot-key setting entry for all AnyTone codeplugs. More...
 
class  HotKeySettingsElement
 Represents the list of hot-key settings for all AnyTone codeplugs. More...
 
class  InvertedBitmapElement
 Represents the base class for inverted bitmaps in all AnyTone codeplugs. More...
 
class  InvertedBytemapElement
 Represents the base class for inverted bytemaps in all AnyTone codeplugs. More...
 
class  MessageBytemapElement
 Represents the bytemap indicating which message is valid. More...
 
class  MessageElement
 Represents base class of a preset message for all AnyTone codeplugs. More...
 
class  MessageListElement
 Represents the base class of prefabricated message linked list for all AnyTone codeplugs. More...
 
class  RadioIDBitmapElement
 Represents the bitmap indicating which radio IDs are valid. More...
 
class  RadioIDElement
 Represents the base class for radio IDs in all AnyTone codeplugs. More...
 
class  RepeaterOffsetListElement
 Represents the table of repeater offset frequencies. More...
 
class  ScanListBitmapElement
 Represents the bitmap indicating which scanlist elements are valid. More...
 
class  ScanListElement
 Represents the base class for scan lists in all AnyTone codeplugs. More...
 
class  StatusMessageBitmapElement
 Represents the bitmap, indicating which status messages are valid. More...
 
class  StatusMessagesElement
 Implements the list of status messages for all AnyTone codeplugs. More...
 
class  TwoToneFunctionBitmapElement
 Rerpesents the two-tone function bitmap, indicating which two-tone functions are valid. More...
 
class  TwoToneFunctionElement
 Represents the base-class for a 2-tone function for all AnyTone codeplugs. More...
 
class  TwoToneIDBitmapElement
 Represents the two-tone ID bitmap, indicating the which two-tone IDs are valid. More...
 
class  TwoToneIDElement
 Represents the base-class for a 2-tone ID for all AnyTone codeplugs. More...
 
class  TwoToneSettingsElement
 Represents the base class of 2-tone settings for all AnyTone codeplugs. More...
 
class  WFMChannelBitmapElement
 Represents the bitmap, indicating which WFM (FM broadcast) channels are valid. More...
 
class  WFMChannelListElement
 Represents a list of 100 FM broad cast channels. More...
 
class  WFMVFOElement
 Represents the WFM (FM broadcast) VFO frquency. More...
 
class  ZoneBitmapElement
 Represents the bitmap indcating which zones are valid. More...
 
class  ZoneChannelListElement
 Represents the base class for zone channel list for all AnyTone codeplugs. More...
 

Public Member Functions

virtual ~AnytoneCodeplug ()
 Destructor.
 
virtual void clear ()
 Clears and resets the complete codeplug to some default values.
 
Configpreprocess (Config *config, const ErrorStack &err) const
 Retruns a prepared configuration for this particular radio. More...
 
bool encode (Config *config, const Flags &flags, const ErrorStack &err)
 Encodes a given abstract configuration (config) to the device specific binary code-plug. More...
 
bool decode (Config *config, const ErrorStack &err)
 Decodes a binary codeplug to the given abstract configuration config. More...
 
bool postprocess (Config *config, const ErrorStack &err) const
 Retruns a post-processed configuration of the decoded config. More...
 
- Public Member Functions inherited from Codeplug
virtual ~Codeplug ()
 Destructor.
 
- Public Member Functions inherited from DFUFile
 DFUFile (QObject *parent=nullptr)
 Constructs an empty DFU file object.
 
uint32_t size () const
 Returns the total size of the DFU file.
 
uint32_t memSize () const
 Returns the total memory size stored in the DFU file.
 
int numImages () const
 Returns the number of images within the DFU file.
 
const Imageimage (int i) const
 Returns a reference to the i-th image of the file.
 
Imageimage (int i)
 Returns a reference to the i-th image of the file.
 
void addImage (const QString &name, uint8_t altSettings=1)
 Adds a new image to the file.
 
void addImage (const Image &img)
 Adds an image to the file.
 
void remImage (int i)
 Deletes the i-th image from the file.
 
bool isAligned (unsigned blocksize) const
 Checks if all image addresses and sizes is aligned with the given block size.
 
bool read (const QString &filename, const ErrorStack &err=ErrorStack())
 Reads the specified DFU file. More...
 
bool read (QFile &file, const ErrorStack &err=ErrorStack())
 Reads the specified DFU file. More...
 
bool write (const QString &filename, const ErrorStack &err=ErrorStack())
 Writes to the specified file. More...
 
bool write (QFile &file, const ErrorStack &err=ErrorStack())
 Writes to the specified file. More...
 
void dump (QTextStream &stream) const
 Dumps a text representation of the DFU file structure to the specified text stream.
 
virtual bool isAllocated (uint32_t offset, uint32_t img=0) const
 Returns true if the specified address (and image) is allocated.
 
virtual unsigned char * data (uint32_t offset, uint32_t img=0)
 Returns a pointer to the encoded raw data at the specified offset.
 
virtual const unsigned char * data (uint32_t offset, uint32_t img=0) const
 Returns a const pointer to the encoded raw data at the specified offset.
 

Protected Member Functions

 AnytoneCodeplug (const QString &label, QObject *parent=nullptr)
 Hidden constructor.
 
virtual bool index (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const
 Indexes all elements of the codeplug. More...
 
virtual bool allocateBitmaps ()=0
 Allocates the bitmaps. More...
 
virtual void setBitmaps (Context &ctx)=0
 Sets all bitmaps for the given config.
 
virtual void allocateUpdated ()=0
 Allocate all code-plug elements that must be written back to the device to maintain a working codeplug. More...
 
virtual void allocateForDecoding ()=0
 Allocate all code-plug elements that must be downloaded for decoding. More...
 
virtual void allocateForEncoding ()=0
 Allocate all code-plug elements that are defined through the common Config.
 
virtual bool encodeElements (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes the given config (via context) to the binary codeplug.
 
virtual bool decodeElements (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Decodes the downloaded codeplug.
 
- Protected Member Functions inherited from Codeplug
 Codeplug (QObject *parent=nullptr)
 Hidden default constructor.
 

Protected Attributes

QString _label
 Holds the image label.
 
- Protected Attributes inherited from DFUFile
QVector< Image_images
 The list of images.
 

Friends

class AnytoneRadio
 

Detailed Description

Base class interface for all Anytone radio codeplugs.

This class extends the generic CodePlug to provide an interface to the multi-step up and download of the binary codeplug. In contrast to the majority of radios, the Anytone codeplugs are heavily segmented and only valid sections are read from a written to the device.

Member Function Documentation

◆ allocateBitmaps()

virtual bool AnytoneCodeplug::allocateBitmaps ( )
protectedpure virtual

Allocates the bitmaps.

This is also performed during a clear.

Implemented in DMR6X2UVCodeplug, D878UVCodeplug, D868UVCodeplug, and D578UVCodeplug.

◆ allocateForDecoding()

virtual void AnytoneCodeplug::allocateForDecoding ( )
protectedpure virtual

Allocate all code-plug elements that must be downloaded for decoding.

All code-plug elements within the radio that are not represented within the common Config are omitted.

Implemented in DMR6X2UVCodeplug, D878UVCodeplug, and D868UVCodeplug.

◆ allocateUpdated()

virtual void AnytoneCodeplug::allocateUpdated ( )
protectedpure virtual

Allocate all code-plug elements that must be written back to the device to maintain a working codeplug.

These elements might be updated during encoding.

Implemented in DMR6X2UVCodeplug, D878UVCodeplug, D868UVCodeplug, and D578UVCodeplug.

◆ decode()

bool AnytoneCodeplug::decode ( Config config,
const ErrorStack err 
)
virtual

Decodes a binary codeplug to the given abstract configuration config.

This must be implemented by the device-specific codeplug.

Implements Codeplug.

◆ encode()

bool AnytoneCodeplug::encode ( Config config,
const Flags flags,
const ErrorStack err 
)
virtual

Encodes a given abstract configuration (config) to the device specific binary code-plug.

This must be implemented by the device-specific codeplug.

Implements Codeplug.

◆ index()

bool AnytoneCodeplug::index ( Config config,
Context ctx,
const ErrorStack err = ErrorStack() 
) const
protectedvirtual

Indexes all elements of the codeplug.

This method must be implemented by any device or vendor specific codeplug to map config objects to indices used within the binary codeplug to address each element (e.g., channels, contacts etc.).

Implements Codeplug.

◆ postprocess()

bool AnytoneCodeplug::postprocess ( Config config,
const ErrorStack err 
) const
virtual

Retruns a post-processed configuration of the decoded config.

By default, the passed config is returned.

Reimplemented from Codeplug.

◆ preprocess()

Config * AnytoneCodeplug::preprocess ( Config config,
const ErrorStack err 
) const
virtual

Retruns a prepared configuration for this particular radio.

All unsupported featrues are removed from the copy. The default implementation only copies the config.

Reimplemented from Codeplug.


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