libdrmconf
0.12.0
A library to program DMR radios.
|
Implements the binary codeplug representation of a BTECH DR-1801UV (a.k.a, BF-1801-A6). More...
#include <dr1801uv_codeplug.hh>
Classes | |
class | AlarmSystemBankElement |
Implements the binary encoding of the alarm system bank. More... | |
class | AlarmSystemElement |
Implements the binary encoding of the alarm system. More... | |
class | ChannelBankElement |
Implements the binary encoding of the channel bank. More... | |
class | ChannelElement |
Implements the binary encoding of the channels settings. More... | |
class | ContactBankElement |
Implements the binary encoding of the contact bank. More... | |
class | ContactElement |
Implements the binary encoding of a contact. More... | |
class | DMRSettingsElement |
Implements the binary encoding of the DMR settings. More... | |
class | DTMFIDBankElement |
Implements the DTMF ID bank. More... | |
class | DTMFIDElement |
Implements the DTMF ID. More... | |
class | DTMFSettingsElement |
Implements the binary encoding of the DTMF signaling settings. More... | |
class | DTMFSystemBankElement |
Implements the DTMF systems bank. More... | |
class | DTMFSystemElement |
Implements the DTMF system. More... | |
class | EncryptionKeyBankElement |
Implements the binary encoding of the encryption keys. More... | |
class | EncryptionKeyElement |
Implements the binary encoding of an encryption key. More... | |
class | GroupListBankElement |
Implements the binary encoding of the group-list bank. More... | |
class | GroupListElement |
Implements the binary encoding of a group list. More... | |
class | KeySettingsElement |
Implements the binary encoding of the key settings. More... | |
class | MessageBankElement |
Implements the binary encoding of the preset message bank element. More... | |
class | MessageElement |
Implements the binary representation of a single message. More... | |
struct | Offset |
Defines the offsets within the codeplug. More... | |
class | OneTouchSettingElement |
Implements the binary encoding of a one-touch setting. More... | |
class | OneTouchSettingsElement |
Implements the binary encoding of the one-touch settings. More... | |
class | PTTIDBankElement |
Implements the encoding of the DTMF PTT IDs. More... | |
class | PTTIDElement |
Implements the PTT ID. More... | |
class | ScanListBankElement |
Implements the binary encoding of the scan-list bank. More... | |
class | ScanListElement |
Implements the binary encoding of a scan list element. More... | |
class | SettingsElement |
Implements the binary encoding of the settings element. More... | |
class | VFOBankElement |
Implements the binary encoding of the VFO settings. More... | |
class | ZoneBankElement |
Implements the binary encoding of the zone bank. More... | |
class | ZoneElement |
Implements the binary encoding of a zone. More... | |
Public Member Functions | |
DR1801UVCodeplug (QObject *parent=nullptr) | |
Default constructor. | |
Config * | preprocess (Config *config, const ErrorStack &err) const |
Retruns a prepared configuration for this particular radio. More... | |
bool | postprocess (Config *config, const ErrorStack &err) 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 | encode (Config *config, const Flags &flags, const ErrorStack &err=ErrorStack()) |
Encodes a given abstract configuration (config ) to the device specific binary code-plug. More... | |
bool | decode (Config *config, const ErrorStack &err=ErrorStack()) |
Decodes a binary codeplug to the given abstract configuration 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 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 | decodeElements (Context &ctx, const ErrorStack &err=ErrorStack()) |
Decode codeplug elements. | |
virtual bool | linkElements (Context &ctx, const ErrorStack &err=ErrorStack()) |
Link decoded elements. | |
virtual bool | encodeElements (Context &ctx, const ErrorStack &err=ErrorStack()) |
Encode all elements. | |
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. | |
Implements the binary codeplug representation of a BTECH DR-1801UV (a.k.a, BF-1801-A6).
This device is kind of a re-release of the BTECH DM-1801. However, the hardware and firmware is completely different. It is just the chassis that remained the same. This version uses the Auctus A6 radio-on-a-chip as its main component.
This class implements the codeplug for the firmware version 1.10
. The codeplug format usually does not change much with firmware revisions, in particular not with older radios.
The memory representation of the codeplug within the radio is simply a single large block of data, read and written entirely. The total size of the codeplug is 01dd90h bytes.
Start | End | Size | Content |
---|---|---|---|
0x00000 | 0x00300 | 0x00300 | Some unkown settings, not configurable through the CPS. Likely some sort of calibration data. Must be conserved. |
0x00300 | 0x003bc | 0x000bc | Some information about the radio. Like serial number, firmware version, etc and timestamp. |
0x003b4 | 0x00418 | 0x00064 | General settings, see DR1801UVCodeplug::SettingsElement . |
0x00418 | 0x04110 | 0x00000 | Zone bank, see DR1801UVCodeplug::ZoneBankElement . |
0x04110 | 0x04274 | 0x00164 | Message bank, see DR1801UVCodeplug::MessageBankElement . |
0x04334 | 0x0a338 | 0x06008 | Contact bank, see DR1801UVCodeplug::ContactBankElement . |
0x0a338 | 0x0a65c | 0x00324 | Scan-list bank, see DR1801UVCodeplug::ScanListBankElement . |
0x0a65c | 0x1c660 | 0x12004 | Channel bank, see DR1801UVCodeplug::ChannelBankElement . |
0x1c6c4 | 0x1c6dc | 0x0018 | Key settings, see DR1801UVCodeplug::KeySettingsElement . |
0x1c6dc | 0x1d7e0 | 0x01104 | Group list bank, see DR1801UVCodeplug::GroupListBankElement . |
0x1d7e0 | 0x1d858 | 0x00078 | Encryption keys, see DR1801UVCodeplug::EncryptionKeyBankElement . |
0x1d858 | 0x1daf4 | 0x0029c | DTMF signaling settings, see DR1801UVCodeplug::DTMFSettingsElement . |
0x1daf4 | 0x1dbb8 | 0x00c4 | Alarm settings, see DR1801UVCodeplug::AlarmSettingsBankElement . |
0x1dbb8 | 0x1dbc8 | 0x0010 | DMR settings, see DR1801UVCodeplug::DMRSettingsElement . |
0x1dbc8 | 0x1dbf0 | 0x00028 | One-touch settings, see DR1801UVCodeplug::OneTouchSettingsElement . |
0x1dbf0 | 0x1dd00 | 0x00110 | Some unknown settings. |
0x1dd00 | 0x1dd90 | 0x00090 | VFO channels, see DR1801UVCodeplug::VFOBankElement . |
|
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.