libdrmconf 0.12.1
A library to program DMR radios.
|
Device specific implementation of the codeplug for the TyT MD-UV390. More...
#include <uv390_codeplug.hh>
Classes | |
class | BootSettingsElement |
Represents the boot-time settings (selected zone and channels) within the UV390 code-plug. More... | |
class | ChannelElement |
Extends the TyTCodeplug::ChannelElement for the TyT MD-UV390 and Retevis RT3S. More... | |
class | GeneralSettingsElement |
Extends the common TyTCodeplug::GeneralSettings to implement the MD-UV390 specific settings. More... | |
class | MenuSettingsElement |
Represents the menu settings (selected zone and channels) within the UV390 code-plug. More... | |
struct | Offset |
Some internal offsets within the codeplug. More... | |
class | VFOChannelElement |
Implements a VFO channel for TyT radios. More... |
Public Types | |
typedef DM1701Codeplug::ZoneExtElement | ZoneExtElement |
Reuse zone extension from DM1701. |
Public Member Functions | |
UV390Codeplug (QObject *parent=nullptr) | |
Constructor. | |
virtual | ~UV390Codeplug () |
Destructor. | |
void | clear () |
Clears and resets the complete codeplug to some default values. | |
void | clearTimestamp () |
Clears the time-stamp in the codeplug. | |
bool | encodeTimestamp () |
Sets the time-stamp. | |
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, const ErrorStack &err=ErrorStack()) |
Updates the given configuration from the general settings. | |
void | clearChannels () |
Clears all channels in the codeplug. | |
bool | encodeChannels (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all channels in the configuration into the codeplug. | |
bool | createChannels (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a channel to the configuration for each one in the codeplug. | |
bool | linkChannels (Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all added channels within the configuration. | |
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 | clearZones () |
Clears all zones in the codeplug. | |
bool | encodeZones (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all zones in the configuration into the codeplug. | |
bool | createZones (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a zone to the configuration for each one in the codeplug. | |
bool | linkZones (Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all added zones within the configuration. | |
void | clearGroupLists () |
Clears all RX group lists in the codeplug. | |
bool | encodeGroupLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all group lists in the configuration into the codeplug. | |
bool | createGroupLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a RX group list to the configuration for each one in the codeplug. | |
bool | linkGroupLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all added RX group lists within the configuration. | |
void | clearScanLists () |
Clears all scan lists in the codeplug. | |
bool | encodeScanLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all scan lists in the configuration into the codeplug. | |
bool | createScanLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a scan list to the configuration for each one in the codeplug. | |
bool | linkScanLists (Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all added scan lists within the configuration. | |
void | clearPositioningSystems () |
Clears all positioning systems in the codeplug. | |
bool | encodePositioningSystems (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes all DMR positioning systems in the configuration into the codeplug. | |
bool | createPositioningSystems (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) |
Adds a GPS positioning system to the configuration for each one in the codeplug. | |
bool | linkPositioningSystems (Context &ctx, const ErrorStack &err=ErrorStack()) |
Links all added positioning systems within the configuration. | |
void | clearButtonSettings () |
Clears the button settings in the codeplug. | |
bool | encodeButtonSettings (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) |
Encodes the button settings. | |
bool | decodeButtonSetttings (Config *config, const ErrorStack &err=ErrorStack()) |
Decodes the button settings. | |
void | clearPrivacyKeys () |
Clears all encryption keys in the codeplug. | |
bool | encodePrivacyKeys (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err) |
Encodes the encryption keys. | |
bool | decodePrivacyKeys (Config *config, Context &ctx, const ErrorStack &err) |
Decodes the encryption keys. | |
void | clearTextMessages () |
Clears all text messages in the codeplug. | |
bool | encodeTextMessages (Context &ctx, const Flags &flags, const ErrorStack &err) |
Encodes text messages. | |
bool | decodeTextMessages (Context &ctx, const ErrorStack &err) |
Decodes text messages. | |
virtual void | clearBootSettings () |
Resets the boot setting, e.g. | |
void | clearMenuSettings () |
Clears the menu settings in the codeplug. | |
void | clearEmergencySystems () |
Clears all emergency systems in the codeplug. | |
virtual void | clearVFOSettings () |
Clears the VFO A & B. | |
Public Member Functions inherited from TyTCodeplug | |
virtual | ~TyTCodeplug () |
Destructor. | |
bool | index (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const |
Indexes all elements of the codeplug. | |
bool | decode (Config *config, const ErrorStack &err=ErrorStack()) |
Decodes the binary codeplug and stores its content in the given generic configuration. | |
bool | encode (Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack()) |
Encodes the given generic configuration as a binary codeplug. | |
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. | |
virtual bool | postprocess (Config *config, const ErrorStack &err=ErrorStack()) const |
Retruns a post-processed configuration of the decoded config. | |
virtual Config * | preprocess (Config *config, const ErrorStack &err=ErrorStack()) const |
Retruns a prepared configuration for this particular radio. | |
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. | |
bool | read (QFile &file, const ErrorStack &err=ErrorStack()) |
Reads the specified DFU file. | |
bool | write (const QString &filename, const ErrorStack &err=ErrorStack()) |
Writes to the specified file. | |
bool | write (QFile &file, const ErrorStack &err=ErrorStack()) |
Writes to the specified file. | |
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. |
Additional Inherited Members | |
Protected Member Functions inherited from TyTCodeplug | |
TyTCodeplug (QObject *parent=nullptr) | |
Empty constructor. | |
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. |
Device specific implementation of the codeplug for the TyT MD-UV390.
The codeplug consists of two segments. The first segment starts at address 0x002000
and ends at address 0x040000
. The second segment starts at address 0x110000
and ends at 0x1a0000
. The segments must align with 0x400
(1024 bytes).
The codeplug structure is reverse engineered almost completely and can be programmed from scratch. That is, it is not necessary to update an existing codeplug on the radio.
Start | End | Size | Content |
---|---|---|---|
First segment 0x002000-0x040000 | |||
0x002000 | 0x00200c | 0x0000c | Timestamp see TyTCodeplug::TimestampElement . |
0x00200c | 0x002040 | 0x00034 | Reserved, filled with 0xff. |
0x002040 | 0x0020f0 | 0x000b0 | General settings see GeneralSettingsElement . |
0x0020f0 | 0x002100 | 0x00010 | Menu settings, see MenuSettingsElement . |
0x002100 | 0x002140 | 0x00040 | Button config, see TyTCodeplug::ButtonSettingsElement . |
0x002140 | 0x002180 | 0x00040 | Reserved, filled with 0xff. |
0x002180 | 0x0059c0 | 0x03840 | 50 Text messages @ 0x120 bytes each. |
0x0059c0 | 0x005a70 | 0x000b0 | Privacy keys, see TyTCodeplug::EncryptionElement . |
0x005a70 | 0x005a80 | 0x00010 | Emergency system settings, see TyTCodeplug::EmergencySettingsElement . |
0x005a80
0x005f80
0x00500
Emergency systems, see TyTCodeplug::EmergencySystemElement
.
0x005f80
0x00ec20
0x08ca0
Reserved, filled with 0xff.
0x00ec20
0x0149e0
0x05dc0
250 RX Group lists @ 0x60 bytes each, see TyTCodeplug::GroupListElement
.
0x0149e0
0x018860
0x03e80
250 Zones @ 0x40 bytes each, see TyTCodeplug::ZoneElement
.
0x018860
0x01edf0
0x06590
250 Scanlists @ 0x68 bytes each, see TyTCodeplug::ScanListElement
.
0x01edf0
0x02ef00
0x10110
Reserved, filled with 0xff
.
0x02ef00
0x02ef40
0x00040
VFO A channel, see VFOChannelElement
.
0x02ef40
0x02ef80
0x00040
VFO B channel, see VFOChannelElement
.
0x02ef80
0x02f000
0x00080
Reserved, filled with 0xff
.
0x02f000
0x02f010
0x00010
Boot settings, see BootSettingsElement
.
0x02f010
0x031000
0x01ff0
Reserved, filled with 0xff
.
0x031000
0x03eac0
0x0dac0
250 Zone-extensions @ 0xe0 bytes each, see DM1701Codeplug::ZoneExtElement
.
0x03eac0
0x03ec40
0x00180
Reserved, filled with 0xff
.
0x03ec40
0x03ed40
0x00100
16 GPS systems @ 0x10 bytes each, see TyTCodeplug::GPSSystemElement
.
0x03ed40
0x040000
0x012c0
Reserved, filled with 0xff
.
Second segment 0x110000-0x1a0000
0x110000
0x13ee00
0x2ee00
3000 Channels @ 0x40 bytes each, see ChannelElement
.
0x13ee00
0x140000
0x01200
Reserved, filled with 0xff
.
0x140000
0x197e40
0x57e40
10000 Contacts @ 0x24 bytes each, see TyTCodeplug::ContactElement
.
0x197e40
0x1a0000
0x081c0
Reserved, filled with 0xff
.
|
virtual |
Clears and resets the complete codeplug to some default values.
Reimplemented from TyTCodeplug.
|
virtual |
Resets the boot setting, e.g.
initial channels and zone at bootup.
|
virtual |
Clears the button settings in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all channels in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all contacts in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all emergency systems in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears the general settings in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all RX group lists in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears the menu settings in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all positioning systems in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all encryption keys in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all scan lists in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all text messages in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears the time-stamp in the codeplug.
Implements TyTCodeplug.
|
virtual |
Clears all zones in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a channel to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a digital contact to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a RX group list to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a GPS positioning system to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a scan list to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Adds a zone to the configuration for each one in the codeplug.
Implements TyTCodeplug.
|
virtual |
Decodes the button settings.
Implements TyTCodeplug.
|
virtual |
Updates the given configuration from the general settings.
Implements TyTCodeplug.
|
virtual |
Decodes the encryption keys.
Implements TyTCodeplug.
|
virtual |
Decodes text messages.
Implements TyTCodeplug.
|
virtual |
Encodes the button settings.
Implements TyTCodeplug.
|
virtual |
Encodes all channels in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Encodes all digital contacts in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Updates the general settings from the given configuration.
Implements TyTCodeplug.
|
virtual |
Encodes all group lists in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Encodes all DMR positioning systems in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Encodes the encryption keys.
Implements TyTCodeplug.
|
virtual |
Encodes all scan lists in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Encodes text messages.
Implements TyTCodeplug.
|
virtual |
Sets the time-stamp.
Implements TyTCodeplug.
|
virtual |
Encodes all zones in the configuration into the codeplug.
Implements TyTCodeplug.
|
virtual |
Links all added channels within the configuration.
Implements TyTCodeplug.
|
virtual |
Links all added RX group lists within the configuration.
Implements TyTCodeplug.
|
virtual |
Links all added positioning systems within the configuration.
Implements TyTCodeplug.
|
virtual |
Links all added scan lists within the configuration.
Implements TyTCodeplug.
|
virtual |
Links all added zones within the configuration.
Implements TyTCodeplug.