1#ifndef RD5R_CODEPLUG_HH
2#define RD5R_CODEPLUG_HH
5#include "radioddity_codeplug.hh"
99 virtual unsigned squelch()
const;
111 static constexpr unsigned int squelch() {
return 0x0037; }
134 static constexpr unsigned int size() {
return 0x0006; }
140 virtual QDateTime
get()
const;
142 virtual void set(
const QDateTime &ts=QDateTime::currentDateTime());
148 static constexpr unsigned int year() {
return 0x0000; }
149 static constexpr unsigned int month() {
return 0x0002; }
150 static constexpr unsigned int day() {
return 0x0003; }
151 static constexpr unsigned int hour() {
return 0x0004; }
152 static constexpr unsigned int minute() {
return 0x0005; }
170 QByteArray
basicKey(
unsigned n)
const;
171 void setBasicKey(
unsigned n,
const QByteArray &key);
250 static constexpr unsigned int zoneCount() {
return 250; }
257 static constexpr unsigned int timestamp() {
return 0x000088; }
258 static constexpr unsigned int settings() {
return 0x0000e0; }
259 static constexpr unsigned int buttons() {
return 0x000108; }
260 static constexpr unsigned int messages() {
return 0x000128; }
261 static constexpr unsigned int encryption() {
return 0x001370; }
262 static constexpr unsigned int contacts() {
return 0x001788; }
263 static constexpr unsigned int dtmfContacts() {
return 0x002f88; }
264 static constexpr unsigned int channelBank0() {
return 0x003780; }
265 static constexpr unsigned int bootSettings() {
return 0x007518; }
266 static constexpr unsigned int menuSettings() {
return 0x007538; }
267 static constexpr unsigned int bootText() {
return 0x007540; }
268 static constexpr unsigned int vfoA() {
return 0x007590; }
269 static constexpr unsigned int vfoB() {
return 0x0075c8; }
270 static constexpr unsigned int zoneBank() {
return 0x008010; }
271 static constexpr unsigned int channelBank1() {
return 0x00b1b0; }
272 static constexpr unsigned int scanListBank() {
return 0x017620; }
273 static constexpr unsigned int groupListBank() {
return 0x01d620; }
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:34
Base class for all codeplug contexts.
Definition codeplug.hh:291
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:65
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Channel * toChannelObj(Context &ctx, const ErrorStack &err=ErrorStack()) const
Constructs a generic Channel object from the codeplug channel.
Definition rd5r_codeplug.cc:62
virtual void setSquelch(unsigned level)
Sets the squelch level.
Definition rd5r_codeplug.cc:35
virtual unsigned squelch() const
Returns the squelch level.
Definition rd5r_codeplug.cc:31
bool linkChannelObj(Channel *c, Context &ctx, const ErrorStack &err=ErrorStack()) const
Links a previously constructed channel to the rest of the configuration.
Definition rd5r_codeplug.cc:76
bool fromChannelObj(const Channel *c, Context &ctx, const ErrorStack &err=ErrorStack())
Initializes this codeplug channel from the given generic configuration.
Definition rd5r_codeplug.cc:41
ChannelElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition rd5r_codeplug.cc:12
void clear()
Resets the channel.
Definition rd5r_codeplug.cc:25
void setBasicKey(unsigned n, const QByteArray &key)
Sets the n-th "basic" key (32bit).
Definition rd5r_codeplug.cc:153
EncryptionElement(uint8_t *ptr)
Constructor.
Definition rd5r_codeplug.cc:132
bool isBasicKeySet(unsigned n) const
Returns true if the n-th "basic" key (32bit) is set.
Definition rd5r_codeplug.cc:139
QByteArray basicKey(unsigned n) const
Returns the n-th "basic" key (32bit).
Definition rd5r_codeplug.cc:146
TimestampElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition rd5r_codeplug.cc:93
void clear()
Resets the timestamp.
Definition rd5r_codeplug.cc:110
virtual void set(const QDateTime &ts=QDateTime::currentDateTime())
Sets the time stamp.
Definition rd5r_codeplug.cc:120
virtual ~TimestampElement()
Destructor.
Definition rd5r_codeplug.cc:105
virtual QDateTime get() const
Returns the time stamp.
Definition rd5r_codeplug.cc:115
static constexpr unsigned int size()
The size of the element.
Definition rd5r_codeplug.hh:134
bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition rd5r_codeplug.cc:588
bool linkEncryption(Context &ctx, const ErrorStack &err)
Links all encryption keys.
Definition rd5r_codeplug.cc:663
void clearContacts()
Clears all contacts in the codeplug.
Definition rd5r_codeplug.cc:268
void clear()
Clears and resets the complete codeplug to some default values.
Definition rd5r_codeplug.cc:174
bool decodeElements(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the binary codeplug and stores its content in the given generic configuration using the given...
Definition rd5r_codeplug.cc:194
RD5RCodeplug(QObject *parent=0)
Empty constructor.
Definition rd5r_codeplug.cc:165
bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition rd5r_codeplug.cc:466
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition rd5r_codeplug.cc:406
bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition rd5r_codeplug.cc:384
void clearScanLists()
Clears all scan lists.
Definition rd5r_codeplug.cc:522
bool encodeElements(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the given generic configuration as a binary codeplug using the given context.
Definition rd5r_codeplug.cc:180
void clearVFOSettings()
Clears the VFO settings.
Definition rd5r_codeplug.cc:452
void clearChannels()
Clear all channels.
Definition rd5r_codeplug.cc:347
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition rd5r_codeplug.cc:213
bool encodeMessages(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes preset messages.
Definition rd5r_codeplug.cc:250
void clearEncryption()
Clears all encryption keys.
Definition rd5r_codeplug.cc:640
bool decodeButtonSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the button settings.
Definition rd5r_codeplug.cc:241
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition rd5r_codeplug.cc:505
void clearBootSettings()
Clear boot settings.
Definition rd5r_codeplug.cc:424
void clearGroupLists()
Clears all group lists.
Definition rd5r_codeplug.cc:581
bool encodeBootText(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text.
Definition rd5r_codeplug.cc:439
bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition rd5r_codeplug.cc:609
bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition rd5r_codeplug.cc:274
bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition rd5r_codeplug.cc:218
void clearBootText()
Clears boot text.
Definition rd5r_codeplug.cc:434
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition rd5r_codeplug.cc:306
bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition rd5r_codeplug.cc:488
bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition rd5r_codeplug.cc:329
bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition rd5r_codeplug.cc:291
bool encodeButtonSettings(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes button settings.
Definition rd5r_codeplug.cc:236
bool createScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all scan lists.
Definition rd5r_codeplug.cc:548
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition rd5r_codeplug.cc:622
bool encodeEncryption(const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all encryption keys defined.
Definition rd5r_codeplug.cc:646
void clearZones()
Clears all zones.
Definition rd5r_codeplug.cc:458
bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all scan lists.
Definition rd5r_codeplug.cc:565
void clearMenuSettings()
Clears menu settings.
Definition rd5r_codeplug.cc:429
bool decodeBootText(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the boot text settings.
Definition rd5r_codeplug.cc:446
virtual bool encodeTimestamp(const ErrorStack &err=ErrorStack())
Sets the time-stamp.
Definition rd5r_codeplug.cc:206
bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition rd5r_codeplug.cc:312
bool decodeMessages(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes preset messages.
Definition rd5r_codeplug.cc:258
bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition rd5r_codeplug.cc:227
bool createEncryption(Context &ctx, const ErrorStack &err)
Creates all encryption keys.
Definition rd5r_codeplug.cc:654
bool encodeScanLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists.
Definition rd5r_codeplug.cc:529
void clearButtonSettings()
Clears the button settings.
Definition rd5r_codeplug.cc:232
void clearMessages()
Clears the messages.
Definition rd5r_codeplug.cc:246
virtual void clearTimestamp()
Clears the time-stamp in the codeplug.
Definition rd5r_codeplug.cc:201
bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition rd5r_codeplug.cc:359
Implements the base for all Radioddity channel encodings.
Definition radioddity_codeplug.hh:33
static constexpr unsigned int size()
The size of the channel.
Definition radioddity_codeplug.hh:65
Represents all encryption keys and settings within the codeplug on the device.
Definition radioddity_codeplug.hh:1598
RadioddityCodeplug(QObject *parent=nullptr)
Hidden constructor, use a device specific class to instantiate.
Definition radioddity_codeplug.cc:2793
Internal offsets within the channel element.
Definition rd5r_codeplug.hh:109
Some limits for the codeplug.
Definition rd5r_codeplug.hh:245
static constexpr unsigned int contactCount()
Maximum number of DMR contacts.
Definition rd5r_codeplug.hh:248
static constexpr unsigned int zoneCount()
Maximum number of zones.
Definition rd5r_codeplug.hh:250
static constexpr unsigned int dtmfContactCount()
Maximum number of DTMF contacts.
Definition rd5r_codeplug.hh:249
static constexpr unsigned int channelBankCount()
The number of channel banks.
Definition rd5r_codeplug.hh:246
static constexpr unsigned int channelCount()
Maximum number of channels in the codeplug.
Definition rd5r_codeplug.hh:247
Some internal offsets within the codeplug.
Definition rd5r_codeplug.hh:255
Internal offsets within the element.
Definition rd5r_codeplug.hh:146
Some internal offsets within the channel element.
Definition radioddity_codeplug.hh:234