libdrmconf
0.12.0
A library to program DMR radios.
|
Represents, encodes and decodes the device specific codeplug for Open GD-77 firmware. More...
#include <opengd77_codeplug.hh>
Classes | |
class | ChannelElement |
Implements the OpenGD77 specific channel. More... | |
class | ContactElement |
Implements the OpenGD77 specific DMR contact. More... | |
class | GroupListElement |
Implements the OpenGD77 specific group list. More... | |
class | ZoneBankElement |
Implements the OpenGD77 specific zone bank. More... | |
class | ZoneElement |
Implements the OpenGD77 specific zone. More... | |
Public Member Functions | |
OpenGD77Codeplug (QObject *parent=nullptr) | |
Constructs an empty codeplug for the GD-77. | |
void | clearGeneralSettings () |
Clears the general settings in the codeplug. | |
bool | encodeGeneralSettings (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Updates the general settings from the given configuration. | |
bool | decodeGeneralSettings (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Updates the given configuration from the general settings. | |
void | clearButtonSettings () |
Clears the button settings. More... | |
void | clearScanLists () |
Clears all scan lists. | |
bool | encodeScanLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all scan lists. | |
bool | createScanLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Creates all scan lists. | |
bool | linkScanLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all scan lists. | |
void | clearContacts () |
Clears all contacts in the codeplug. | |
bool | encodeContacts (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all digital contacts in the configuration into the codeplug. | |
bool | createContacts (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a digital contact to the configuration for each one in the codeplug. | |
void | clearDTMFContacts () |
Clears all DTMF contacts in the codeplug. | |
bool | encodeDTMFContacts (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all DTMF contacts. | |
bool | createDTMFContacts (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds all DTMF contacts to the configuration. | |
void | clearChannels () |
Clear all channels. | |
bool | encodeChannels (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode all channels. | |
bool | createChannels (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds all defined channels to the configuration. | |
bool | linkChannels (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all channels. | |
void | clearBootSettings () |
Clear boot settings. | |
void | clearMenuSettings () |
Clears menu settings. | |
void | clearBootText () |
Clears boot text. | |
bool | encodeBootText (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes boot text. | |
bool | decodeBootText (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Updates the given configuration from the boot text settings. | |
void | clearVFOSettings () |
Clears the VFO settings. | |
void | clearZones () |
Clears all zones. | |
bool | encodeZones (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes zones. | |
bool | createZones (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds zones to the configuration. | |
bool | linkZones (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all zones within the configuration. | |
void | clearGroupLists () |
Clears all group lists. | |
bool | encodeGroupLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all group lists. | |
bool | createGroupLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Creates all group lists. | |
bool | linkGroupLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all group lists. | |
void | clearEncryption () |
Clears all encryption keys. | |
bool | encodeEncryption (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err) |
Encodes all encryption keys defined. | |
bool | createEncryption (Config *config, Context &ctx, const ErrorStack &err) |
Creates all encryption keys. | |
bool | linkEncryption (Config *config, Context &ctx, const ErrorStack &err) |
Links all encryption keys. | |
Public Member Functions inherited from GD77Codeplug | |
GD77Codeplug (QObject *parent=nullptr) | |
Constructs an empty codeplug for the GD-77. | |
bool | encodeButtonSettings (Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack()) |
Encodes button settings. | |
bool | decodeButtonSettings (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decodes the button settings. | |
void | clearMessages () |
Clears the messages. | |
bool | encodeMessages (Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack()) |
Encodes preset messages. | |
bool | decodeMessages (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decodes preset messages. | |
Public Member Functions inherited from RadioddityCodeplug | |
virtual | ~RadioddityCodeplug () |
Destructor. | |
virtual void | clear () |
Clears and resets the complete codeplug to some default values. | |
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 | postprocess (Config *config, const ErrorStack &err) const |
Retruns a post-processed configuration of the decoded config. More... | |
Config * | preprocess (Config *config, const ErrorStack &err) const |
Retruns a prepared configuration for this particular radio. 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... | |
virtual bool | decodeElements (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decodes the binary codeplug and stores its content in the given generic configuration using the given context. | |
virtual bool | encodeElements (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes the given generic configuration as a binary codeplug using the given context. | |
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. | |
Static Public Attributes | |
static const uint32_t | EEPROM = 0 |
EEPROM memory bank. | |
static const uint32_t | FLASH = 1 |
Flash memory bank. | |
Additional Inherited Members | |
Protected Member Functions inherited from RadioddityCodeplug | |
RadioddityCodeplug (QObject *parent=nullptr) | |
Hidden constructor, use a device specific class to instantiate. | |
Protected Member Functions inherited from Codeplug | |
Codeplug (QObject *parent=nullptr) | |
Hidden default constructor. | |
Protected Attributes inherited from DFUFile | |
QVector< Image > | _images |
The list of images. | |
Represents, encodes and decodes the device specific codeplug for Open GD-77 firmware.
This codeplug is almost identical to the original GD77 codeplug.
The memory representation of the codeplug within the radio is divided into two images (EEPROM and Flash) and each image again into two sections.
The first segment of the EEPROM image starts at the address 0x000e0 and ends at 0x06000, while the second EEPROM section starts at 0x07500 and ends at 0x0b000.
The first segment of the Flash image starts at the address 0x00000 and ends at 0x011a0, while the second Flash section starts at 0x7b000 and ends at 0x8ee60.
Start | End | Size | Content |
---|---|---|---|
First EEPROM segment 0x000e0-0x06000 | |||
0x000e0 | 0x000ec | 0x000c | General settings, see RadioddityCodeplug::GeneralSettingsElement . |
0x000ec | 0x00128 | 0x003c | ??? Unknown ??? |
0x00128 | 0x01370 | 0x1248 | 32 message texts, see RadioddityCodeplug::MessageBankElement . |
0x01370 | 0x01790 | 0x0420 | ??? Unknown ??? |
0x01790 | 0x02dd0 | 0x1640 | 64 scan lists, see GD77Codeplug::ScanListBankElement , GD77Codeplug::ScanListElement. |
0x02dd0 | 0x02f88 | 0x01b8 | ??? Unknown ??? |
0x02f88 | 0x03388 | 0x0400 | DTMF contacts, see RadioddityCodeplug::DTMFContactElement. |
0x03388 | 0x03780 | 0x03f8 | ??? Unknown ??? |
0x03780 | 0x05390 | 0x1c10 | First 128 channels (bank 0), see RadioddityCodeplug::ChannelBankElement , OpenGD77Codeplug::ChannelElement . |
0x05390 | 0x06000 | 0x0c70 | ??? Unknown ??? |
Second EEPROM segment 0x07500-0x13000 | |||
0x07500 | 0x07518 | 0x0018 | ??? Unknown ??? |
0x07518 | 0x07538 | 0x0020 | Boot settings, see RadioddityCodeplug::BootSettingsElement . |
0x07538 | 0x07540 | 0x0008 | Menu settings, see RadioddityCodeplug::MenuSettingsElement . |
0x07540 | 0x07560 | 0x0020 | 2 intro lines, RadioddityCodeplug::BootTextElement . |
0x07560 | 0x07590 | 0x0030 | ??? Unknown ??? |
0x07590 | 0x075c8 | 0x0038 | VFO A settings OpenGD77Codeplug::VFOChannelElement |
0x075c8 | 0x07600 | 0x0038 | VFO B settings OpenGD77Codeplug::VFOChannelElement |
0x07600 | 0x08010 | 0x0a10 | ??? Unknown ??? |
0x08010 | 0x12c10 | 0xac00 | 250 zones, see OpenGD77Codeplug::ZoneBankElement , OpenGD77Codeplug::ZoneElement . |
0x12c10 | 0x13000 | 0x03f0 | ??? Unknown ??? |
First Flash segment 0x00000-0x011a0 | |||
0x00000 | 0x011a0 | 0x11a0 | ??? Unknown ??? |
Second Flash segment 0x7b000-0x8ee60 | |||
0x7b000 | 0x7b1b0 | 0x01b0 | ??? Unknown ??? |
0x7b1b0 | 0x87620 | 0xc470 | Remaining 896 channels (bank 1-7), see RadioddityCodeplug::ChannelBankElement and OpenGD77Codeplug::ChannelElement . |
0x87620 | 0x8d620 | 0x6000 | 1024 contacts, see OpenGD77Codeplug::ContactElement . |
0x8d620 | 0x8e2a0 | 0x0c80 | 76 RX group lists, see GD77Codeplug::GroupListBankElement , GD77Codeplug::GroupListElement . |
0x8e2a0 | 0x8ee60 | 0x0bc0 | ??? Unknown ??? |
|
virtual |
Clears the button settings.
Reimplemented from GD77Codeplug.