1 #ifndef OPENGD77_CODEPLUG_HH
2 #define OPENGD77_CODEPLUG_HH
4 #include "gd77_codeplug.hh"
5 #include "opengd77_extension.hh"
64 static const uint32_t
FLASH = 1;
75 typedef OpenGD77ChannelExtension::Power
Power;
103 virtual unsigned squelch()
const;
112 virtual unsigned radioId()
const;
169 uint8_t *
get(
unsigned n)
const;
The base class of all channels (analog and digital) of a codeplug configuration.
Definition: channel.hh:34
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition: channel.hh:61
Base class for all codeplug contexts.
Definition: codeplug.hh:238
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition: codeplug.hh:25
The config class, representing the codeplug configuration.
Definition: config.hh:70
TimeSlot
Possible timeslots for digital channels.
Definition: channel.hh:389
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Channel representation within the binary codeplug.
Definition: gd77_codeplug.hh:72
Represents an RX group list within the codeplug.
Definition: gd77_codeplug.hh:169
static constexpr unsigned int size()
Size of the group list element.
Definition: gd77_codeplug.hh:179
Represents, encodes and decodes the device specific codeplug for a Radioddity GD-77.
Definition: gd77_codeplug.hh:63
Implements the OpenGD77 specific channel.
Definition: opengd77_codeplug.hh:72
virtual bool scanAllSkip() const
If true, the scan all skip is enabled.
Definition: opengd77_codeplug.cc:151
virtual void setExtendedPower(Power power)
Sets extended power.
Definition: opengd77_codeplug.cc:120
virtual Power extendedPower() const
Returns extended power settings.
Definition: opengd77_codeplug.cc:116
virtual void setSquelchDefault()
Sets the squelch to radio wide default.
Definition: opengd77_codeplug.cc:137
virtual unsigned radioId() const
Returns the radio ID for the channel.
Definition: opengd77_codeplug.cc:164
virtual void setRadioId(unsigned id)
Sets and enables the radio ID for the channel.
Definition: opengd77_codeplug.cc:168
bool autoscan() const
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:263
virtual bool hasRadioId() const
Returns true if the channel specific radio ID is set.
Definition: opengd77_codeplug.cc:160
void clear()
Resets the channel.
Definition: opengd77_codeplug.cc:71
void setPrivacyGroup(PrivacyGroup grp)
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:294
void enableLoneWorker(bool enable)
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:276
Channel * toChannelObj(Context &ctx) const
Constructs a generic Channel object from the codeplug channel.
Definition: opengd77_codeplug.cc:179
virtual void enableScanAllSkip(bool enable)
Enables/disables scan all skip.
Definition: opengd77_codeplug.cc:155
ChannelElement(uint8_t *ptr)
Constructor.
Definition: opengd77_codeplug.cc:64
void setPower(Channel::Power power)
Sets the power setting of the channel.
Definition: opengd77_codeplug.cc:105
virtual bool scanZoneSkip() const
If true, the scan zone skip is enabled.
Definition: opengd77_codeplug.cc:142
virtual void enableScanZoneSkip(bool enable)
Enables/disables scan zone skip.
Definition: opengd77_codeplug.cc:146
virtual unsigned squelch() const
Returns the quelch value [0-10].
Definition: opengd77_codeplug.cc:129
bool loneWorker() const
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:272
unsigned rxSignalingIndex() const
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:281
virtual bool squelchIsDefault() const
Returns true if the squelch is set to radio wide default.
Definition: opengd77_codeplug.cc:125
OpenGD77ChannelExtension::Power Power
Reuse Power enum from extension.
Definition: opengd77_codeplug.hh:75
void setRXSignalingIndex(unsigned idx)
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:285
PrivacyGroup privacyGroup() const
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:290
bool linkChannelObj(Channel *c, Context &ctx) const
Links a previously constructed channel to the rest of the configuration.
Definition: opengd77_codeplug.cc:205
bool fromChannelObj(const Channel *c, Context &ctx)
Initializes this codeplug channel from the given generic configuration.
Definition: opengd77_codeplug.cc:229
void enableAutoscan(bool enable)
Overridden, reused in OpenGD77.
Definition: opengd77_codeplug.cc:267
Channel::Power power() const
Returns the power setting of the channel.
Definition: opengd77_codeplug.cc:81
virtual void setSquelch(unsigned squelch)
Sets the squelch value.
Definition: opengd77_codeplug.cc:133
virtual void clearRadioId()
Clears the radio ID.
Definition: opengd77_codeplug.cc:173
Implements the OpenGD77 specific group list.
Definition: opengd77_codeplug.hh:221
void fromRXGroupListObj(const RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Reset this codeplug representation from a RXGroupList object.
Definition: opengd77_codeplug.cc:483
GroupListElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition: opengd77_codeplug.cc:470
Implements the OpenGD77 specific zone bank.
Definition: opengd77_codeplug.hh:164
uint8_t * get(unsigned n) const
Returns a pointer to the channel at the given index.
Definition: opengd77_codeplug.cc:373
ZoneBankElement(uint8_t *ptr)
Constructor.
Definition: opengd77_codeplug.cc:366
Implements the OpenGD77 specific zone.
Definition: opengd77_codeplug.hh:147
void fromZoneObjA(const Zone *zone, Context &ctx)
Resets this codeplug zone representation from the given generic Zone object.
Definition: opengd77_codeplug.cc:333
bool linkZoneObj(Zone *zone, Context &ctx) const
Links a previously constructed Zone object to the rest of the configuration.
Definition: opengd77_codeplug.cc:315
void clear()
Clears the zone.
Definition: opengd77_codeplug.cc:309
ZoneElement(uint8_t *ptr)
Constructor.
Definition: opengd77_codeplug.cc:302
void fromZoneObjB(const Zone *zone, Context &ctx)
Resets this codeplug zone representation from the given generic Zone object.
Definition: opengd77_codeplug.cc:348
Represents, encodes and decodes the device specific codeplug for Open GD-77 firmware.
Definition: opengd77_codeplug.hh:57
bool createScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Creates all scan lists.
Definition: opengd77_codeplug.cc:554
void clearZones()
Clears all zones.
Definition: opengd77_codeplug.cc:750
bool encodeZones(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition: opengd77_codeplug.cc:758
void clearBootText()
Clears boot text.
Definition: opengd77_codeplug.cc:723
bool encodeDTMFContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition: opengd77_codeplug.cc:608
void clearBootSettings()
Clear boot settings.
Definition: opengd77_codeplug.cc:713
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition: opengd77_codeplug.cc:519
bool linkEncryption(Config *config, Context &ctx, const ErrorStack &err)
Links all encryption keys.
Definition: opengd77_codeplug.cc:888
void clearButtonSettings()
Clears the button settings.
Definition: opengd77_codeplug.cc:539
bool createZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition: opengd77_codeplug.cc:780
bool decodeGeneralSettings(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition: opengd77_codeplug.cc:533
bool createChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition: opengd77_codeplug.cc:675
OpenGD77Codeplug(QObject *parent=nullptr)
Constructs an empty codeplug for the GD-77.
Definition: opengd77_codeplug.cc:503
bool encodeGeneralSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition: opengd77_codeplug.cc:524
bool createEncryption(Config *config, Context &ctx, const ErrorStack &err)
Creates all encryption keys.
Definition: opengd77_codeplug.cc:882
void clearChannels()
Clear all channels.
Definition: opengd77_codeplug.cc:637
void clearScanLists()
Clears all scan lists.
Definition: opengd77_codeplug.cc:544
void clearMenuSettings()
Clears menu settings.
Definition: opengd77_codeplug.cc:718
static const uint32_t EEPROM
EEPROM memory bank.
Definition: opengd77_codeplug.hh:62
bool encodeEncryption(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all encryption keys defined.
Definition: opengd77_codeplug.cc:876
bool createDTMFContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition: opengd77_codeplug.cc:622
void clearContacts()
Clears all contacts in the codeplug.
Definition: opengd77_codeplug.cc:567
void clearGroupLists()
Clears all group lists.
Definition: opengd77_codeplug.cc:818
void clearEncryption()
Clears all encryption keys.
Definition: opengd77_codeplug.cc:872
bool decodeBootText(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the boot text settings.
Definition: opengd77_codeplug.cc:736
bool encodeContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition: opengd77_codeplug.cc:573
static const uint32_t FLASH
Flash memory bank.
Definition: opengd77_codeplug.hh:64
bool encodeChannels(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition: opengd77_codeplug.cc:649
bool linkScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all scan lists.
Definition: opengd77_codeplug.cc:560
void clearVFOSettings()
Clears the VFO settings.
Definition: opengd77_codeplug.cc:744
bool linkChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition: opengd77_codeplug.cc:694
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition: opengd77_codeplug.cc:602
bool encodeGroupLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition: opengd77_codeplug.cc:825
bool encodeScanLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists.
Definition: opengd77_codeplug.cc:548
bool createContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition: opengd77_codeplug.cc:587
bool encodeBootText(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot text.
Definition: opengd77_codeplug.cc:728
bool linkGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition: opengd77_codeplug.cc:853
bool linkZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition: opengd77_codeplug.cc:798
bool createGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition: opengd77_codeplug.cc:840
TimeSlotOverride
Possible values for the time-slot override option.
Definition: opengd77_extension.hh:101
Generic representation of a RX group list.
Definition: rxgrouplist.hh:14
PrivacyGroup
Possible privacy groups, not used in ham radio.
Definition: radioddity_codeplug.hh:49
Implements the base class for all zone banks of Radioddity codeplugs.
Definition: radioddity_codeplug.hh:450
Represents a zone within Radioddity codeplugs.
Definition: radioddity_codeplug.hh:403
Represents a zone within the generic configuration.
Definition: zone.hh:15