libdrmconf  0.11.3
A library to program DMR radios.
Classes | Public Types | Public Member Functions | List of all members

Device specific implementation of the codeplug for the TyT MD-2017. More...

#include <md2017_codeplug.hh>

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

Classes

class  ContactElement
 Contact element for MD2017 codeplugs. More...
 

Public Types

typedef UV390Codeplug::ChannelElement ChannelElement
 Reuse TyT MD-UV390 channel element.
 
typedef UV390Codeplug::VFOChannelElement VFOChannelElement
 Reuse TyT MD-UV390 VFO channel element.
 
typedef UV390Codeplug::ZoneExtElement ZoneExtElement
 Reuse TyT MD-UV390 zone extension element.
 
typedef UV390Codeplug::BootSettingsElement BootSettingsElement
 Reuse TyT MD-UV390 boot settings element.
 
typedef UV390Codeplug::MenuSettingsElement MenuSettingsElement
 Reuse TyT MD-UV390 menu settings element.
 

Public Member Functions

 MD2017Codeplug (QObject *parent=nullptr)
 Constructor.
 
virtual ~MD2017Codeplug ()
 Destructor.
 
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=ErrorStack())
 Decodes the encryption keys.
 
virtual void clearBootSettings ()
 Resets/clears the boot settings.
 
void clearMenuSettings ()
 Clears the menu settings in the codeplug.
 
void clearTextMessages ()
 Clears all text messages in the codeplug.
 
void clearEmergencySystems ()
 Clears all emergency systems in the codeplug.
 
virtual void clearVFOSettings ()
 Resets VFO settings.
 
- Public Member Functions inherited from TyTCodeplug
virtual ~TyTCodeplug ()
 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 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.
 
- 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.
 

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.
 

Detailed Description

Device specific implementation of the codeplug for the TyT MD-2017.

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).

Codeplug structure within radio

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 TyTCodeplug::GeneralSettingsElement.
0x0020f0 0x002100 0x00010 Menu settings, see UV390Codeplug::menu_t
0x002100 0x002140 0x00040 Button config, see UV390Codeplug::buttons_t.
0x002140 0x002180 0x00040 Reserved, filled with 0xff.
0x002180 0x0059c0 0x03840 50 Text messages @ 0x120 bytes each, see UV390Codeplug::message_t.
0x0059c0 0x005a70 0x000b0 Privacy keys, see UV390Codeplug::privacy_t.
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 TyTCodeplug::VFOChannelElement.
0x02ef40 0x02ef80 0x00040 VFO B channel, see TyTCodeplug::VFOChannelElement.
0x02ef80 0x02f000 0x00080 Reserved, filled with 0xff.
0x02f000 0x02f010 0x00010 Some unknown settings like current channel, see TyTCodeplug::BootSettingsElement.
0x02f010 0x031000 0x01ff0 Reserved, filled with 0xff.
0x031000 0x03eac0 0x0dac0 250 Zone-extensions @ 0xe0 bytes each, see TyTCodeplug::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 TyTCodeplug::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.

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