libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches

Represents, encodes and decodes the device specific codeplug for a Baofeng/Radioddity RD-5R. More...

#include <rd5r_codeplug.hh>

Inheritance diagram for RD5RCodeplug:
Collaboration diagram for RD5RCodeplug:

Classes

class  ChannelElement
 Implements the specialization of the Radioddity channel for the RD5R radio. More...
class  EncryptionElement
 Implements the encoding/decoding of encryption keys for the RD-5R radio. More...
struct  Limit
 Some limits for the codeplug. More...
struct  Offset
 Some internal offsets within the codeplug. More...
class  TimestampElement
 Implements the timestamp for RD-5R codeplugs. More...

Public Member Functions

 RD5RCodeplug (QObject *parent=0)
 Empty constructor.
void clear ()
bool encodeElements (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool decodeElements (Context &ctx, const ErrorStack &err=ErrorStack())
virtual void clearTimestamp ()
 Clears the time-stamp in the codeplug.
virtual bool encodeTimestamp (const ErrorStack &err=ErrorStack())
 Sets the time-stamp.
void clearGeneralSettings ()
bool encodeGeneralSettings (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool decodeGeneralSettings (Context &ctx, const ErrorStack &err=ErrorStack())
void clearButtonSettings ()
bool encodeButtonSettings (Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
bool decodeButtonSettings (Context &ctx, const ErrorStack &err=ErrorStack())
void clearMessages ()
bool encodeMessages (Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
bool decodeMessages (Context &ctx, const ErrorStack &err=ErrorStack())
void clearContacts ()
bool encodeContacts (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createContacts (Context &ctx, const ErrorStack &err=ErrorStack())
void clearDTMFContacts ()
bool encodeDTMFContacts (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createDTMFContacts (Context &ctx, const ErrorStack &err=ErrorStack())
void clearChannels ()
bool encodeChannels (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createChannels (Context &ctx, const ErrorStack &err=ErrorStack())
bool linkChannels (Context &ctx, const ErrorStack &err=ErrorStack())
void clearBootSettings ()
void clearMenuSettings ()
void clearBootText ()
bool encodeBootText (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool decodeBootText (Context &ctx, const ErrorStack &err=ErrorStack())
void clearVFOSettings ()
void clearZones ()
bool encodeZones (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createZones (Context &ctx, const ErrorStack &err=ErrorStack())
bool linkZones (Context &ctx, const ErrorStack &err=ErrorStack())
void clearScanLists ()
bool encodeScanLists (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createScanLists (Context &ctx, const ErrorStack &err=ErrorStack())
bool linkScanLists (Context &ctx, const ErrorStack &err=ErrorStack())
void clearGroupLists ()
bool encodeGroupLists (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
bool createGroupLists (Context &ctx, const ErrorStack &err=ErrorStack())
bool linkGroupLists (Context &ctx, const ErrorStack &err=ErrorStack())
void clearEncryption ()
bool encodeEncryption (const Flags &flags, Context &ctx, const ErrorStack &err)
bool createEncryption (Context &ctx, const ErrorStack &err)
bool linkEncryption (Context &ctx, const ErrorStack &err)

Detailed Description

Represents, encodes and decodes the device specific codeplug for a Baofeng/Radioddity RD-5R.

This codeplug format is quiet funny. It reveals some history of this device. First of all, the channels are organizes in two blocks. The first block contains only a single bank of 128 channels, while the second block contains 7 banks with a total of 896 channels. I would guess there was a previous firmware or even hardware version with only 128 channels.

Moreover, channels, zones, rx group lists and scan lists are organized in tables or banks, with some preceding bitfield indicating which channel is enabled/valid. Contacts, however, are just organized in a list, where each entry has a field, indicating whether that contact is valid.

This difference looks like, as if the firmware code for the contacts stems from a different device or was developed by a different engineer. Moreover, the message list again, uses yet another method. Here a simple counter precedes the messages, indicating how many valid messages there are. All in all, a rather inconsistent way of representing variable length lists in the codeplug. I would guess, that over time, different people/teams worked on different revisions of the firmware. It must have been a real nightmare to Serge Vakulenko reverse-engineering this codeplug.

Codeplug structure within radio

This implementation targets firmware version 2.1.6.

The memory representation of the codeplug within the radio is divided into two segments. The first segment starts at the address 0x00080 and ends at 0x07c00 while the second section starts at 0x08000 and ends at 0x1e300.

Please note, that the codeplug is not yet fully understood and a full codeplug cannot be build from scratch. That is, it is necessary to update an existing codeplug on the radio.

StartEndSizeContent
First segment 0x00080-0x07c00
0x000800x000880x0008??? Unknown ???
0x000880x0008e0x0006Timestamp, see RadioddityCodeplug::TimestampElement.
0x0008e0x000e00x0052CPS, firmware, DSP version numbers (not touched).
0x000e00x001080x0028General settings, see RadioddityCodeplug::GeneralSettingsElement.
0x001080x001280x0020Button settings, see RadioddityCodeplug::ButtonSettingsElement.
0x001280x013700x124832 preset message texts, see RadioddityCodeplug::MessageBankElement.
0x013700x015880x0218??? Unknown ???
0x015880x017880x0200??? 32 Emergency systems ???
0x017880x02f880x1800256 contacts, see RadioddityCodeplug::ContactElement.
0x02f880x033880x040032 DTMF contacts, see RadioddityCodeplug::DTMFContactElement.
0x033880x037800x03f8??? Unknown ???
0x037800x053900x1c10First 128 channels (bank 0), see RadioddityCodeplug::ChannelBankElement and RD5RCodeplug::ChannelElement.
0x053900x075180x2188??? Unknown ???
0x075180x075380x0020Boot settings, see RadioddityCodeplug::BootSettingsElement.
0x075380x075400x0008Menu settings, see RadioddityCodeplug::MenuSettingsElement.
0x075400x075600x00202 intro lines, RadioddityCodeplug::BootTextElement.
0x075600x075900x0030??? Unknown ???
0x075900x075c80x0038VFO A settings RadioddityCodeplug::ChannelElement
0x075c80x076000x0038VFO B settings RadioddityCodeplug::ChannelElement
0x076000x07c000x0600??? Unknown ???
Second segment 0x08000-0x1e300
0x080000x080100x0010??? Unknown ???
0x080100x0af100x2f00250 zones, see RadioddityCodeplug::ZoneBankElement.
0x0af100x0b1b00x02a0??? Unknown ???
0x0b1b00x176200xc470Remaining 896 channels (bank 1-7), see RadioddityCodeplug::ChannelBankElement and RD5RCodeplug::ChannelElement.
0x176200x1cd100x56f0250 scan lists, see RadioddityCodeplug::ScanListBankElement
0x1cd100x1d6200x0910??? Unknown ???
0x1d6200x1e2a00x0c8064 RX group lists, see RadioddityCodeplug::GroupListBankElement
0x1e2a00x1e3000x0060??? Unknown ???

The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/qdmr-0.12.1-build/qdmr-0.12.1/lib/rd5r_codeplug.hh
  • /builddir/build/BUILD/qdmr-0.12.1-build/qdmr-0.12.1/lib/rd5r_codeplug.cc