1 #ifndef RD5R_CODEPLUG_HH
2 #define RD5R_CODEPLUG_HH
5 #include "radioddity_codeplug.hh"
6 #include "signaling.hh"
99 virtual unsigned squelch()
const;
128 virtual QDateTime
get()
const;
130 virtual void set(
const QDateTime &ts=QDateTime::currentDateTime());
145 QByteArray
basicKey(
unsigned n)
const;
146 void setBasicKey(
unsigned n,
const QByteArray &key);
The base class of all channels (analog and digital) of a codeplug configuration.
Definition: channel.hh:32
Base class for all codeplug contexts.
Definition: codeplug.hh:195
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition: codeplug.hh:24
The config class, representing the codeplug configuration.
Definition: config.hh:67
uint32_t size() const
Returns the total size of the DFU file.
Definition: dfufile.cc:50
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Implements the specialization of the Radioddity channel for the RD5R radio.
Definition: rd5r_codeplug.hh:87
bool linkChannelObj(Channel *c, Context &ctx) const
Links a previously constructed channel to the rest of the configuration.
Definition: rd5r_codeplug.cc:116
virtual void setSquelch(unsigned level)
Sets the squelch level.
Definition: rd5r_codeplug.cc:75
virtual unsigned squelch() const
Returns the squelch level.
Definition: rd5r_codeplug.cc:71
bool fromChannelObj(const Channel *c, Context &ctx)
Initializes this codeplug channel from the given generic configuration.
Definition: rd5r_codeplug.cc:81
Channel * toChannelObj(Context &ctx) const
Constructs a generic Channel object from the codeplug channel.
Definition: rd5r_codeplug.cc:102
ChannelElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: rd5r_codeplug.cc:52
void clear()
Resets the channel.
Definition: rd5r_codeplug.cc:65
Implements the encoding/decoding of encryption keys for the RD-5R radio.
Definition: rd5r_codeplug.hh:139
void setBasicKey(unsigned n, const QByteArray &key)
Sets the n-th "basic" key (32bit).
Definition: rd5r_codeplug.cc:193
EncryptionElement(uint8_t *ptr)
Constructor.
Definition: rd5r_codeplug.cc:172
bool isBasicKeySet(unsigned n) const
Returns true if the n-th "basic" key (32bit) is set.
Definition: rd5r_codeplug.cc:179
QByteArray basicKey(unsigned n) const
Returns the n-th "basic" key (32bit).
Definition: rd5r_codeplug.cc:186
Implements the timestamp for RD-5R codeplugs.
Definition: rd5r_codeplug.hh:113
TimestampElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition: rd5r_codeplug.cc:133
void clear()
Resets the timestamp.
Definition: rd5r_codeplug.cc:150
virtual void set(const QDateTime &ts=QDateTime::currentDateTime())
Sets the time stamp.
Definition: rd5r_codeplug.cc:160
virtual ~TimestampElement()
Destructor.
Definition: rd5r_codeplug.cc:145
virtual QDateTime get() const
Returns the time stamp.
Definition: rd5r_codeplug.cc:155
Represents, encodes and decodes the device specific codeplug for a Baofeng/Radioddity RD-5R.
Definition: rd5r_codeplug.hh:78
bool decodeGeneralSettings(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition: rd5r_codeplug.cc:267
void clearContacts()
Clears all contacts in the codeplug.
Definition: rd5r_codeplug.cc:283
void clear()
Clears and resets the complete codeplug to some default values.
Definition: rd5r_codeplug.cc:214
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:234
RD5RCodeplug(QObject *parent=0)
Empty constructor.
Definition: rd5r_codeplug.cc:205
bool linkEncryption(Config *config, Context &ctx, const ErrorStack &err)
Links all encryption keys.
Definition: rd5r_codeplug.cc:709
bool encodeGeneralSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition: rd5r_codeplug.cc:258
void clearScanLists()
Clears all scan lists.
Definition: rd5r_codeplug.cc:573
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:220
void clearVFOSettings()
Clears the VFO settings.
Definition: rd5r_codeplug.cc:452
void clearChannels()
Clear all channels.
Definition: rd5r_codeplug.cc:350
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition: rd5r_codeplug.cc:253
void clearEncryption()
Clears all encryption keys.
Definition: rd5r_codeplug.cc:686
bool encodeGroupLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition: rd5r_codeplug.cc:631
bool encodeChannels(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition: rd5r_codeplug.cc:362
bool createGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition: rd5r_codeplug.cc:651
bool createZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition: rd5r_codeplug.cc:503
bool createEncryption(Config *config, Context &ctx, const ErrorStack &err)
Creates all encryption keys.
Definition: rd5r_codeplug.cc:700
bool encodeContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition: rd5r_codeplug.cc:289
bool encodeZones(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition: rd5r_codeplug.cc:466
bool encodeDTMFContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition: rd5r_codeplug.cc:323
void clearBootSettings()
Clear boot settings.
Definition: rd5r_codeplug.cc:423
void clearGroupLists()
Clears all group lists.
Definition: rd5r_codeplug.cc:624
bool encodeBootText(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text.
Definition: rd5r_codeplug.cc:438
bool linkScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all scan lists.
Definition: rd5r_codeplug.cc:610
void clearBootText()
Clears boot text.
Definition: rd5r_codeplug.cc:433
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition: rd5r_codeplug.cc:317
bool linkChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition: rd5r_codeplug.cc:405
bool decodeBootText(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the boot text settings.
Definition: rd5r_codeplug.cc:445
bool linkGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition: rd5r_codeplug.cc:666
void clearZones()
Clears all zones.
Definition: rd5r_codeplug.cc:458
bool createContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition: rd5r_codeplug.cc:302
bool createChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition: rd5r_codeplug.cc:387
void clearMenuSettings()
Clears menu settings.
Definition: rd5r_codeplug.cc:428
bool linkZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition: rd5r_codeplug.cc:538
virtual bool encodeTimestamp(const ErrorStack &err=ErrorStack())
Sets the time-stamp.
Definition: rd5r_codeplug.cc:246
bool encodeScanLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists.
Definition: rd5r_codeplug.cc:580
void clearButtonSettings()
Clears the button settings.
Definition: rd5r_codeplug.cc:273
void clearMessages()
Clears the messages.
Definition: rd5r_codeplug.cc:278
bool createScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Creates all scan lists.
Definition: rd5r_codeplug.cc:595
virtual void clearTimestamp()
Clears the time-stamp in the codeplug.
Definition: rd5r_codeplug.cc:241
bool encodeEncryption(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all encryption keys defined.
Definition: rd5r_codeplug.cc:692
bool createDTMFContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition: rd5r_codeplug.cc:336
Implements the base for all Radioddity channel encodings.
Definition: radioddity_codeplug.hh:31
Represents all encryption keys and settings within the codeplug on the device.
Definition: radioddity_codeplug.hh:1255
Base class of all Radioddity codeplugs.
Definition: radioddity_codeplug.hh:22