LibDMRConf  0.5.2
A library to program DMR radios.
Classes | Public Member Functions | List of all members
UV390Codeplug Class Reference

Represents the device specific binary codeplug for TYT UV-390 & Retevis RT3S radios. More...

#include <uv390_codeplug.hh>

Inheritance diagram for UV390Codeplug:
CodePlug DFUFile

Classes

struct  buttons_t
 Represents all button settings within the codeplug on the radio. More...
 
struct  channel_t
 Represents a single channel (analog or digital) within the codeplug. More...
 
struct  contact_t
 Represents a digital (DMR) contact within the codeplug. More...
 
struct  emergency_t
 Represents the emergency settings within the codeplug on the radio. More...
 
struct  general_settings_t
 Codeplug representation of the general settings. More...
 
struct  gpssystem_t
 Represents a single GPS system within the codeplug. More...
 
struct  grouplist_t
 Representation of an RX group list within the codeplug. More...
 
struct  menu_t
 Represents all menu settings within the codeplug on the radio. More...
 
struct  message_t
 Represents a single message within the codeplug. More...
 
struct  privacy_t
 Represents all privacy settings within the codeplug on the device. More...
 
struct  scanlist_t
 Represents a scan list within the codeplug. More...
 
struct  timestamp_t
 Codeplug representation of programming time-stamp and CPS version. More...
 
struct  zone_ext_t
 Extended zone data. More...
 
struct  zone_t
 Represents a zone within the codeplug. More...
 

Public Member Functions

 UV390Codeplug (QObject *parent=nullptr)
 Empty constructor.
 
void clear ()
 Clears and resets the complete codeplug to some default values.
 
bool decode (Config *config)
 Decodes the binary codeplug and stores its content in the given generic configuration.
 
bool encode (Config *config, bool update=true)
 Encodes the given generic configuration as a binary codeplug.
 
- 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 (uint blocksize) const
 Checks if all image addresses and sizes is aligned with the given block size.
 
const QString & errorMessage () const
 Returns the error message in case of an error.
 
bool read (const QString &filename)
 Reads the specified DFU file. More...
 
bool read (QFile &file)
 Reads the specified DFU file. More...
 
bool write (const QString &filename)
 Writes to the specified file. More...
 
bool write (QFile &file)
 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 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 CodePlug
 CodePlug (QObject *parent=nullptr)
 Hidden default constructor.
 
- Protected Attributes inherited from DFUFile
QString _errorMessage
 Holds the error string.
 
QVector< Image > _images
 The list of images.
 

Detailed Description

Represents the device specific binary codeplug for TYT UV-390 & Retevis RT3S radios.

The codeplug consists of two segments. The first segment starts at address 0x002800 and ends at address 0x040800. The second segment starts at address 0x110800 and ends at 0x1a0800. 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 neccessary to update an existing codeplug on the radio.

Start End Size Content
First segment 0x002800-0x040800
0x002800 0x00280c 0x0000c Timestamp see UV390Codeplug::timestamp_t.
0x00280c 0x002840 0x00034 Reserved, filled with 0xff.
0x002840 0x0028f0 0x000b0 General settings see UV390Codeplug::general_settings_t.
0x0028f0 0x002900 0x00010 Menu settings, see UV390Codeplug::menu_t
0x002900 0x002940 0x00040 Button config, see UV390Codeplug::buttons_t.
0x002940 0x002980 0x00040 Reserved, filled with 0xff.
0x002980 0x0061c0 0x03840 50 Text messages @ 0x120 bytes each, see UV390Codeplug::message_t.
0x0061c0 0x006270 0x000b0 Privacy keys, see UV390Codeplug::privacy_t.
0x006250 0x006760 0x00510 Emergency Systems, see UV390Codeplug::emergency_t.
0x006760 0x00f420 0x08cc0 Reserved, filled with 0xff.
0x00f420 0x0151e0 0x05dc0 250 RX Group lists @ 0x60 bytes each, see UV390Codeplug::grouplist_t.
0x0151e0 0x019060 0x03e80 250 Zones @ 0x40 bytes each, see UV390Codeplug::zone_t.
0x019060 0x01f5f0 0x06590 250 Scanlists @ 0x68 bytes each, see UV390Codeplug::scanlist_t.
0x01f5f0 0x02f700 0x10110 Reserved, filled with 0xff.
0x02f700 0x02f740 0x00040 VFO A channel, see UV390Codeplug::channel_t.
0x02f740 0x02f780 0x00040 VFO B channel, see UV390Codeplug::channel_t.
0x02f780 0x030800 0x01080 Reserved, filled with 0xff.
0x030800 0x030b80 0x00380 ??? Unknown. DTMF Systems? ???
0x030b80 0x031800 0x00c80 Reserved, filled with 0xff.
0x031800 0x03f2c0 0x0dac0 250 Zone-extensions @ 0xe0 bytes each, see UV390Codeplug::zone_ext_t.
0x03f2c0 0x03f440 0x00180 Reserved, filled with 0xff.
0x03f440 0x03f540 0x00100 16 GPS systems @ 0x10 bytes each, see UV390Codeplug::gpssystem_t.
0x03f540 0x040800 0x012c0 Reserved, filled with 0xff.
Second segment 0x110800-0x1a0800
0x110800 0x13f600 0x2ee00 3000 Channels @ 0x40 bytes each, see UV390Codeplug::channel_t.
0x13f600 0x140800 0x01200 Reserved, filled with 0xff.
0x140800 0x198640 0x57e40 10000 Contacts @ 0x24 bytes each, see UV390Codeplug::contact_t.
0x198640 0x1a0800 0x081c0 Reserved, filled with 0xff.
Callsign database 0x0200000-0x1000000
0x200000 0x204004 0x04004 Callsign database index table, see UV390Codeplug::callsign_db_t
0x204004 0xffffdc 0xdfbfd8 122197 callsign database entries, see UV390Codeplug::callsign_db_t::callsign_t.
0xffffdc 0x1000000 0x00025 Padding, filled with 0xff.

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