libdrmconf
0.12.0
A library to program DMR radios.
|
Represents, encodes and decodes the device specific codeplug for a Radioddity GD-73. More...
#include <gd73_codeplug.hh>
Classes | |
class | ChannelBankElement |
Implements the bank of channels within the binary codeplug. More... | |
class | ChannelElement |
Implements an FM/DMR channel. More... | |
class | ContactBankElement |
Implements the contact bank within the codeplug. More... | |
class | ContactElement |
Implements the contact element. More... | |
class | DMRSettingsElement |
Implements the DMR settings element. More... | |
class | DTMFNumberBankElement |
Implements the bank of 16 DTMF numbers. More... | |
class | DTMFNumberElement |
Implements a single DTMF number. More... | |
class | DTMFPTTSettingBankElement |
Implements the bank of 32 DTMF PTT settings. More... | |
class | DTMFPTTSettingElement |
Implements a single DTMF PTT setting. More... | |
class | DTMFSystemBankElement |
Implements the bank of 4 DTMF systems. More... | |
class | DTMFSystemElement |
Implements a single DTMF system. More... | |
class | EncryptionKeyBankElement |
Implements the encryption key-bank. More... | |
class | EncryptionKeyElement |
Implements the encryption key element. More... | |
class | GroupListBankElement |
Encodes the bank of group lists. More... | |
class | GroupListElement |
Encodes a group list. More... | |
class | InformationElement |
Implements the information element. More... | |
class | MessageBankElement |
Implements the message bank element. More... | |
class | MessageElement |
Implements a message. More... | |
struct | Offset |
Internal used offsets within the codeplug. More... | |
class | OneTouchSettingElement |
Implements one of the 5 one-touch settings elements. More... | |
class | ScanListBankElement |
Implements the bank of scan lists. More... | |
class | ScanListElement |
Implements a scan list. More... | |
class | SettingsElement |
Implements the radio settings. More... | |
class | ZoneBankElement |
Implements the bank of zones. More... | |
class | ZoneElement |
Implements a single zone within the binary codeplug. More... | |
Public Member Functions | |
GD73Codeplug (QObject *parent=nullptr) | |
Default constructor. | |
Config * | preprocess (Config *config, const ErrorStack &err=ErrorStack()) const |
Retruns a prepared configuration for this particular radio. More... | |
bool | postprocess (Config *config, const ErrorStack &err=ErrorStack()) const |
Retruns a post-processed configuration of the decoded config. More... | |
bool | index (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const |
Indexes all elements of the codeplug. More... | |
bool | decode (Config *config, const ErrorStack &err=ErrorStack()) |
Decodes a binary codeplug to the given abstract configuration config . More... | |
bool | encode (Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack()) |
Encodes a given abstract configuration (config ) to the device specific binary code-plug. 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 Image & | image (int i) const |
Returns a reference to the i-th image of the file. | |
Image & | image (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 | |
virtual bool | decodeTimestamp (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decodes the time-stamp field. | |
virtual bool | encodeTimestamp (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes the time-stamp field. | |
virtual bool | createMessages (Context &ctx, const ErrorStack &err=ErrorStack()) |
Creates messages. | |
virtual bool | encodeMessages (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode messages. | |
virtual bool | decodeSettings (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decodes the settings fields (generic & DMR). | |
virtual bool | encodeSettings (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode settings fields (generic & DMR settings). | |
virtual bool | createContacts (Context &ctx, const ErrorStack &err=ErrorStack()) |
Creates contacts. | |
virtual bool | encodeContacts (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode contacts. | |
virtual bool | createDTMFContacts (Context &ctx, const ErrorStack &err=ErrorStack()) |
Creates DTMF contacts. | |
virtual bool | createGroupLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Create group lists. | |
virtual bool | linkGroupLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Link group lists. | |
virtual bool | encodeGroupLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode group lists. | |
virtual bool | createEncryptionKeys (Context &ctx, const ErrorStack &err=ErrorStack()) |
Create encryption keys. | |
virtual bool | encodeEncryptionKeys (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode encryption keys. | |
virtual bool | createChannels (Context &ctx, const ErrorStack &err=ErrorStack()) |
Create channels. | |
virtual bool | linkChannels (Context &ctx, const ErrorStack &err=ErrorStack()) |
Link channels. | |
virtual bool | encodeChannels (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode channels. | |
virtual bool | createZones (Context &ctx, const ErrorStack &err=ErrorStack()) |
Create zones. | |
virtual bool | linkZones (Context &ctx, const ErrorStack &err=ErrorStack()) |
Link zones. | |
virtual bool | encodeZones (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode zones. | |
virtual bool | createScanLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Create scan lists. | |
virtual bool | linkScanLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Link zones. | |
virtual bool | encodeScanLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode zones. | |
Protected Member Functions inherited from Codeplug | |
Codeplug (QObject *parent=nullptr) | |
Hidden default constructor. | |
Additional Inherited Members | |
Protected Attributes inherited from DFUFile | |
QVector< Image > | _images |
The list of images. | |
Represents, encodes and decodes the device specific codeplug for a Radioddity GD-73.
Start | End | Size | Content |
---|---|---|---|
First segment 0x00000-0x22014 | |||
0x00000 | 0x00061 | 0x0061 | Basic info, see GD73Codeplug::InformationElement |
0x00061 | 0x0010b | 0x00aa | Radio settings, see GD73Codeplug::SettingsElement |
0x0010b | 0x00d4c | 0x0c41 | Zone bank, see GD73Codeplug::ZoneBankElement |
0x00d4c | 0x1254e | 0x11802 | Channel bank, see GD73Codeplug::ChannelBankElement |
0x125ff | 0x1c201 | 0x9c02 | Contact bank, see GD73Codeplug::ContactBankElement |
0x1c201 | 0x21310 | 0x510f | Group list bank, see GD73Codeplug::GroupListBankElement |
0x21310 | 0x21911 | 0x0601 | Scan list bank, see GD73Codeplug::ScanListBankElement |
0x21911 | 0x2191f | 0x000e | DMR settings, see GD73Codeplug::DMRSettingsElement |
0x2191f | 0x2196f | 0x0050 | 16 encryption keys, see GD73Codeplug::EncryptionKeyBankElement |
0x2196f | 0x21e80 | 0x0511 | Message bank, see GD73Codeplug::MessageBankElement |
0x21e80 | 0x21e94 | 0x0014 | 4 DTMF systems, see GD73Codeplug::DTMFSystemBankElement |
0x21e94 | 0x21f24 | 0x0090 | 16 DTMF numbers, see GD73Codeplug::DTMFNumberBankElement |
0x21f24 | 0x21fc4 | 0x00a0 | 32 DTMF PTT settings, see GD73Codeplug::DTMFPTTSettingBankElement |
0x21fc4 | 0x22014 | 0x0050 | Unused, filled with 0x00 |
|
virtual |
Decodes a binary codeplug to the given abstract configuration config
.
This must be implemented by the device-specific codeplug.
Implements Codeplug.
|
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.
|
virtual |
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.
|
virtual |
Retruns a post-processed configuration of the decoded config.
By default, the passed config is returned.
Reimplemented from Codeplug.
|
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.