1#ifndef GD77_CODEPLUG_HH
2#define GD77_CODEPLUG_HH
4#include "radioddity_codeplug.hh"
168 static constexpr unsigned int validFlag() {
return 0x0017; }
188 static constexpr unsigned int size() {
return 0x0050; }
220 static constexpr unsigned int size() {
return 0x1480; }
222 uint8_t *
get(
unsigned n)
const;
264 static constexpr unsigned int size() {
return 0x1640; }
269 uint8_t *
get(
unsigned n)
const;
281 static constexpr unsigned int bytemap() {
return 0x0000; }
282 static constexpr unsigned int scanLists() {
return 0x0040; }
359 static constexpr unsigned int settings() {
return 0x0000e0; }
360 static constexpr unsigned int buttons() {
return 0x000108; }
361 static constexpr unsigned int messages() {
return 0x000128; }
362 static constexpr unsigned int encryption() {
return 0x001370; }
363 static constexpr unsigned int scanListBank() {
return 0x001790; }
364 static constexpr unsigned int dtmfContacts() {
return 0x002f88; }
365 static constexpr unsigned int channelBank0() {
return 0x003780; }
366 static constexpr unsigned int bootSettings() {
return 0x007518; }
367 static constexpr unsigned int bootText() {
return 0x007540; }
368 static constexpr unsigned int menuSettings() {
return 0x007538; }
369 static constexpr unsigned int vfoA() {
return 0x007590; }
370 static constexpr unsigned int vfoB() {
return 0x0075c8; }
371 static constexpr unsigned int zoneBank() {
return 0x008010; }
372 static constexpr unsigned int channelBank1() {
return 0x00b1b0; }
373 static constexpr unsigned int contacts() {
return 0x017620; }
374 static constexpr unsigned int groupListBank() {
return 0x01d620; }
Base class for all codeplug contexts.
Definition codeplug.hh:291
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
uint32_t size() const
Returns the total size of the DFU file.
Definition dfufile.cc:52
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
virtual ARTSMode artsMode() const
Returns the ARTS mode.
Definition gd77_codeplug.cc:33
PTTId
PTT ID send.
Definition gd77_codeplug.hh:91
virtual STEAngle steAngle() const
Returns the STE angle.
Definition gd77_codeplug.cc:42
virtual void enableTightSquelch(bool enable)
Enables/disables tight squelch.
Definition gd77_codeplug.cc:64
virtual PTTId pttIDMode() const
Returns the PTT ID mode.
Definition gd77_codeplug.cc:51
STEAngle
STE angle.
Definition gd77_codeplug.hh:83
@ STE_180DEG
180 degree.
Definition gd77_codeplug.hh:86
@ STE_120DEG
120 degree.
Definition gd77_codeplug.hh:85
@ STE_240DEG
240 degree.
Definition gd77_codeplug.hh:87
@ STE_FREQUENCY
STE Frequency.
Definition gd77_codeplug.hh:84
virtual void setSTEAngle(STEAngle angle)
Sets the STE angle.
Definition gd77_codeplug.cc:46
virtual void enableLoneWorker(bool enable)
Enables/disables lone worker.
Definition gd77_codeplug.cc:73
virtual void setPTTIDMode(PTTId mode)
Sets the PTT ID mode.
Definition gd77_codeplug.cc:55
ARTSMode
ARTS send.
Definition gd77_codeplug.hh:75
virtual bool squelchIsTight() const
Returns true if the squech type is tight.
Definition gd77_codeplug.cc:60
void clear()
Resets the channel.
Definition gd77_codeplug.cc:25
ChannelElement(uint8_t *ptr, size_t size)
Hidden Constructor.
Definition gd77_codeplug.cc:12
virtual bool loneWorker() const
Returns true if lone worker is enabled.
Definition gd77_codeplug.cc:69
virtual void setARTSMode(ARTSMode mode)
Sets the ARTS mode.
Definition gd77_codeplug.cc:37
virtual void enableAutoscan(bool enable)
Enables/disables auto scan.
Definition gd77_codeplug.cc:82
virtual bool autoscan() const
Returns true if auto scan is enabled.
Definition gd77_codeplug.cc:78
uint8_t * get(unsigned n) const
Returns a pointer to the n-th group list.
Definition gd77_codeplug.cc:246
GroupListBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition gd77_codeplug.cc:233
static constexpr unsigned int size()
The size of the group list bank.
Definition gd77_codeplug.hh:220
static constexpr unsigned int size()
The size of the element.
Definition gd77_codeplug.hh:188
virtual bool fromRXGroupListObj(const RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Reset this codeplug representation from a RXGroupList object.
Definition gd77_codeplug.cc:204
virtual bool linkRXGroupListObj(unsigned int ncnt, RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack()) const
Links a previously constructed RXGroupList to the rest of the generic configuration.
Definition gd77_codeplug.cc:189
GroupListElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition gd77_codeplug.cc:176
ScanListBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition gd77_codeplug.cc:150
static constexpr unsigned int size()
The size of the scan list bank.
Definition gd77_codeplug.hh:264
uint8_t * get(unsigned n) const
Returns a pointer to the n-th scan list.
Definition gd77_codeplug.cc:168
void clear()
Clears the scan list bank.
Definition gd77_codeplug.cc:163
void clear()
Resets the scan list.
Definition gd77_codeplug.cc:141
ScanListElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition gd77_codeplug.cc:128
bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition gd77_codeplug.cc:595
bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition gd77_codeplug.cc:570
bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition gd77_codeplug.cc:608
bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition gd77_codeplug.cc:513
void clearContacts()
Clears all contacts in the codeplug.
Definition gd77_codeplug.cc:546
bool decodeBootText(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the boot text settings.
Definition gd77_codeplug.cc:471
bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition gd77_codeplug.cc:406
void clearMessages()
Clears the messages.
Definition gd77_codeplug.cc:299
void clearEncryption()
Clears all encryption keys.
Definition gd77_codeplug.cc:679
void clearMenuSettings()
Clears menu settings.
Definition gd77_codeplug.cc:454
void clearBootText()
Clears boot text.
Definition gd77_codeplug.cc:459
bool createEncryption(Context &ctx, const ErrorStack &err)
Creates all encryption keys.
Definition gd77_codeplug.cc:693
bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition gd77_codeplug.cc:272
bool encodeMessages(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes preset messages.
Definition gd77_codeplug.cc:303
void clearChannels()
Clear all channels.
Definition gd77_codeplug.cc:368
void clearScanLists()
Clears all scan lists.
Definition gd77_codeplug.cc:312
void clearBootSettings()
Clear boot settings.
Definition gd77_codeplug.cc:449
bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition gd77_codeplug.cc:380
bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition gd77_codeplug.cc:552
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition gd77_codeplug.cc:589
bool encodeEncryption(const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all encryption keys defined.
Definition gd77_codeplug.cc:685
bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition gd77_codeplug.cc:491
bool linkEncryption(Context &ctx, const ErrorStack &err)
Links all encryption keys.
Definition gd77_codeplug.cc:701
bool encodeBootText(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text.
Definition gd77_codeplug.cc:464
GD77Codeplug(QObject *parent=nullptr)
Constructs an empty codeplug for the GD-77.
Definition gd77_codeplug.cc:258
bool encodeButtonSettings(Context &ctx, const Flags &flags, const ErrorStack &err=ErrorStack())
Encodes button settings.
Definition gd77_codeplug.cc:289
bool createScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all scan lists.
Definition gd77_codeplug.cc:336
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition gd77_codeplug.cc:663
bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition gd77_codeplug.cc:647
void clearGroupLists()
Clears all group lists.
Definition gd77_codeplug.cc:625
void clearZones()
Clears all zones.
Definition gd77_codeplug.cc:483
void clearButtonSettings()
Clears the button settings.
Definition gd77_codeplug.cc:285
bool encodeScanLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists.
Definition gd77_codeplug.cc:319
bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all scan lists.
Definition gd77_codeplug.cc:355
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition gd77_codeplug.cc:529
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition gd77_codeplug.cc:267
bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition gd77_codeplug.cc:280
bool decodeButtonSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the button settings.
Definition gd77_codeplug.cc:294
bool decodeMessages(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes preset messages.
Definition gd77_codeplug.cc:307
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition gd77_codeplug.cc:429
void clearVFOSettings()
Clears the VFO settings.
Definition gd77_codeplug.cc:477
bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition gd77_codeplug.cc:632
Generic representation of a RX group list.
Definition rxgrouplist.hh:14
Implements the base for all Radioddity channel encodings.
Definition radioddity_codeplug.hh:33
virtual Mode mode() const
Returns the channel mode.
Definition radioddity_codeplug.cc:89
Implements a base class of group list memory banks for all Radioddity codeplugs.
Definition radioddity_codeplug.hh:709
Represents a base class for all group lists within Radioddity codeplugs.
Definition radioddity_codeplug.hh:646
Implements the base class of scan lists banks for all Radioddity codeplugs.
Definition radioddity_codeplug.hh:910
Implements the base class for scan lists of all Radioddity codeplugs.
Definition radioddity_codeplug.hh:761
static constexpr unsigned int size()
The size of the scan list.
Definition radioddity_codeplug.hh:782
RadioddityCodeplug(QObject *parent=nullptr)
Hidden constructor, use a device specific class to instantiate.
Definition radioddity_codeplug.cc:2793
Base class for Limits.
Definition codeplug.hh:92
Some limits for the group list bank.
Definition gd77_codeplug.hh:226
static constexpr unsigned int groupListCount()
Number of group lists.
Definition gd77_codeplug.hh:227
static constexpr unsigned int memberCount()
Maximum number of entries.
Definition gd77_codeplug.hh:196
Some limits for the GD77 codeplug.
Definition gd77_codeplug.hh:348
static constexpr unsigned int channelCount()
Maximum number of channels.
Definition gd77_codeplug.hh:351
static constexpr unsigned int contactCount()
Maximum number of contacts.
Definition gd77_codeplug.hh:352
static constexpr unsigned int channelBankCount()
Number of channel banks.
Definition gd77_codeplug.hh:350
static constexpr unsigned int dtmfContactCount()
Maximum number of DTMF contacts.
Definition gd77_codeplug.hh:349
Some internal offsets within the codeplug.
Definition gd77_codeplug.hh:357
Some limits for the scan list bank.
Definition gd77_codeplug.hh:273
static constexpr unsigned int scanListCount()
Maximum number of scan lists.
Definition gd77_codeplug.hh:274
Internal offsets within the element.
Definition gd77_codeplug.hh:279
Some limits for the group list bank.
Definition radioddity_codeplug.hh:741
Some limits for the scan list bank.
Definition radioddity_codeplug.hh:936
Internal offsets within the element.
Definition radioddity_codeplug.hh:942