1#ifndef RD5R_CODEPLUG_HH
2#define RD5R_CODEPLUG_HH
5#include "radioddity_codeplug.hh"
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:37
Base class for all codeplug contexts.
Definition codeplug.hh:331
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
Some simple class implementing a [1-10] level setting.
Definition level.hh:15
Channel * toChannelObj(Context &ctx, const ErrorStack &err=ErrorStack()) const
Constructs a generic Channel object from the codeplug channel.
Definition rd5r_codeplug.cc:60
virtual Level squelch() const
Returns the squelch level.
Definition rd5r_codeplug.cc:30
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:74
bool fromChannelObj(const Channel *c, Context &ctx, const ErrorStack &err=ErrorStack())
Initializes this codeplug channel from the given generic configuration.
Definition rd5r_codeplug.cc:39
ChannelElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition rd5r_codeplug.cc:11
void clear()
Resets the channel.
Definition rd5r_codeplug.cc:24
virtual void setSquelch(Level level)
Sets the squelch level.
Definition rd5r_codeplug.cc:34
void setBasicKey(unsigned n, const QByteArray &key)
Sets the n-th "basic" key (32bit).
Definition rd5r_codeplug.cc:151
EncryptionElement(uint8_t *ptr)
Constructor.
Definition rd5r_codeplug.cc:130
bool isBasicKeySet(unsigned n) const
Returns true if the n-th "basic" key (32bit) is set.
Definition rd5r_codeplug.cc:137
QByteArray basicKey(unsigned n) const
Returns the n-th "basic" key (32bit).
Definition rd5r_codeplug.cc:144
TimestampElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition rd5r_codeplug.cc:91
void clear()
Resets the timestamp.
Definition rd5r_codeplug.cc:108
virtual void set(const QDateTime &ts=QDateTime::currentDateTime())
Sets the time stamp.
Definition rd5r_codeplug.cc:118
virtual ~TimestampElement()
Destructor.
Definition rd5r_codeplug.cc:103
virtual QDateTime get() const
Returns the time stamp.
Definition rd5r_codeplug.cc:113
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:586
bool linkEncryption(Context &ctx, const ErrorStack &err)
Links all encryption keys.
Definition rd5r_codeplug.cc:661
void clearContacts()
Clears all contacts in the codeplug.
Definition rd5r_codeplug.cc:266
void clear()
Clears and resets the complete codeplug to some default values.
Definition rd5r_codeplug.cc:172
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:192
RD5RCodeplug(QObject *parent=0)
Empty constructor.
Definition rd5r_codeplug.cc:163
bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition rd5r_codeplug.cc:464
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition rd5r_codeplug.cc:404
bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition rd5r_codeplug.cc:382
void clearScanLists()
Clears all scan lists.
Definition rd5r_codeplug.cc:520
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:178
void clearVFOSettings()
Clears the VFO settings.
Definition rd5r_codeplug.cc:450
void clearChannels()
Clear all channels.
Definition rd5r_codeplug.cc:345
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition rd5r_codeplug.cc:211
bool encodeMessages(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes preset messages.
Definition rd5r_codeplug.cc:248
void clearEncryption()
Clears all encryption keys.
Definition rd5r_codeplug.cc:638
bool decodeButtonSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the button settings.
Definition rd5r_codeplug.cc:239
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition rd5r_codeplug.cc:503
void clearBootSettings()
Clear boot settings.
Definition rd5r_codeplug.cc:422
void clearGroupLists()
Clears all group lists.
Definition rd5r_codeplug.cc:579
bool encodeBootText(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text.
Definition rd5r_codeplug.cc:437
bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition rd5r_codeplug.cc:607
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:272
bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition rd5r_codeplug.cc:216
void clearBootText()
Clears boot text.
Definition rd5r_codeplug.cc:432
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition rd5r_codeplug.cc:304
bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition rd5r_codeplug.cc:486
bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition rd5r_codeplug.cc:327
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:289
bool encodeButtonSettings(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes button settings.
Definition rd5r_codeplug.cc:234
bool createScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all scan lists.
Definition rd5r_codeplug.cc:546
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition rd5r_codeplug.cc:620
bool encodeEncryption(const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all encryption keys defined.
Definition rd5r_codeplug.cc:644
void clearZones()
Clears all zones.
Definition rd5r_codeplug.cc:456
bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all scan lists.
Definition rd5r_codeplug.cc:563
void clearMenuSettings()
Clears menu settings.
Definition rd5r_codeplug.cc:427
bool decodeBootText(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the boot text settings.
Definition rd5r_codeplug.cc:444
virtual bool encodeTimestamp(const ErrorStack &err=ErrorStack())
Sets the time-stamp.
Definition rd5r_codeplug.cc:204
bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition rd5r_codeplug.cc:310
bool decodeMessages(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes preset messages.
Definition rd5r_codeplug.cc:256
bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition rd5r_codeplug.cc:225
bool createEncryption(Context &ctx, const ErrorStack &err)
Creates all encryption keys.
Definition rd5r_codeplug.cc:652
bool encodeScanLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists.
Definition rd5r_codeplug.cc:527
void clearButtonSettings()
Clears the button settings.
Definition rd5r_codeplug.cc:230
void clearMessages()
Clears the messages.
Definition rd5r_codeplug.cc:244
virtual void clearTimestamp()
Clears the time-stamp in the codeplug.
Definition rd5r_codeplug.cc:199
bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition rd5r_codeplug.cc:357
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:1605
RadioddityCodeplug(QObject *parent=nullptr)
Hidden constructor, use a device specific class to instantiate.
Definition radioddity_codeplug.cc:2808
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