1 #ifndef DM1701_CODEPLUG_HH
2 #define DM1701_CODEPLUG_HH
4 #include "tyt_codeplug.hh"
106 QString
name()
const;
107 void setName(
const QString &txt);
321 static constexpr
unsigned int messages() {
return 0x002180; }
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
Represents the abstract base class of all codeplug elements.
Definition: codeplug.hh:51
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
uint32_t size() const
Returns the total size of the DFU file.
Definition: dfufile.cc:52
Extends the common TyTCodeplug::ChannelElement to implement the DM-1701 specific settings.
Definition: dm1701_codeplug.hh:58
void clear()
Abstract method to reset the element within the codeplug.
Definition: dm1701_codeplug.cc:68
virtual void setPower(Channel::Power pwr)
Sets the power of this channel.
Definition: dm1701_codeplug.cc:104
Channel * toChannelObj(const ErrorStack &err=ErrorStack()) const
Constructs a generic Channel object from the codeplug channel.
Definition: dm1701_codeplug.cc:118
virtual void enableReverseBurst(bool enable)
Enables/disables reverse burst.
Definition: dm1701_codeplug.cc:93
virtual Channel::Power power() const
Returns the power of this channel.
Definition: dm1701_codeplug.cc:98
virtual void enableTightSquelch(bool enable)
Enables/disables tight squelch.
Definition: dm1701_codeplug.cc:84
virtual bool tightSquelchEnabled() const
Returns true if the squelch is 'tight'.
Definition: dm1701_codeplug.cc:80
void fromChannelObj(const Channel *c, Context &ctx)
Initializes this codeplug channel from the given generic configuration.
Definition: dm1701_codeplug.cc:135
ChannelElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: dm1701_codeplug.cc:55
virtual bool reverseBurst() const
Returns true if the reversed burst is enabled.
Definition: dm1701_codeplug.cc:89
Extends the common TyTCodeplug::GeneralSettingsElement to implement the DM-1701 specific settings.
Definition: dm1701_codeplug.hh:121
virtual bool channelMode() const
Returns true, if the radio is in channel (and not VFO) mode.
Definition: dm1701_codeplug.cc:238
virtual bool fromConfig(const Config *config)
Encodes the general settings.
Definition: dm1701_codeplug.cc:283
GeneralSettingsElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: dm1701_codeplug.cc:192
virtual void enablePrivateCallMatch(bool enable)
Enables/disables private-call match.
Definition: dm1701_codeplug.cc:259
virtual bool groupCallMatch() const
Returns true if group-call match is enabled.
Definition: dm1701_codeplug.cc:247
void clear()
Abstract method to reset the element within the codeplug.
Definition: dm1701_codeplug.cc:205
virtual void setTimeZone(const QTimeZone &zone)
Sets the time-zone.
Definition: dm1701_codeplug.cc:268
virtual bool channelModeB() const
Returns true, if VFO B is in channel mode.
Definition: dm1701_codeplug.cc:229
virtual bool privateCallMatch() const
Returns true if private-call match is enabled.
Definition: dm1701_codeplug.cc:255
virtual void enableChannelModeA(bool enable)
Enables/disables the channel mode for VFO A.
Definition: dm1701_codeplug.cc:224
virtual void enableChannelModeB(bool enable)
Enables/disables the channel mode for VFO B.
Definition: dm1701_codeplug.cc:233
virtual bool channelModeA() const
Returns true, if VFO A is in channel mode.
Definition: dm1701_codeplug.cc:220
virtual unsigned channelHangTime() const
Returns the channel hang time in ms.
Definition: dm1701_codeplug.cc:274
virtual void setChannelHangTime(unsigned dur)
Sets the channel hang time in ms.
Definition: dm1701_codeplug.cc:278
virtual bool updateConfig(Config *config)
Updates config from general settings.
Definition: dm1701_codeplug.cc:303
virtual void enableChannelMode(bool enable)
Enable/disable channel mode.
Definition: dm1701_codeplug.cc:242
virtual QTimeZone timeZone() const
Returns the time-zone.
Definition: dm1701_codeplug.cc:264
virtual void enableGroupCallMatch(bool enable)
Enables/disables group-call match.
Definition: dm1701_codeplug.cc:251
Extends the ChannelElement to implement the VFO channel settings for the DM-1701.
Definition: dm1701_codeplug.hh:95
virtual void setStepSize(unsigned ss_hz)
Sets the step-size for the VFO channel in Hz.
Definition: dm1701_codeplug.cc:182
QString name() const
Returns the name of this channel.
Definition: dm1701_codeplug.cc:168
VFOChannelElement(uint8_t *ptr, size_t size)
Constructor from pointer to memory.
Definition: dm1701_codeplug.cc:151
void setName(const QString &txt)
Sets the name of this channel.
Definition: dm1701_codeplug.cc:172
virtual ~VFOChannelElement()
Destructor.
Definition: dm1701_codeplug.cc:163
virtual unsigned stepSize() const
Returns the step-size for the VFO channel.
Definition: dm1701_codeplug.cc:178
Extended zone data for the DM-1701.
Definition: dm1701_codeplug.hh:228
virtual void setMemberIndexB(unsigned n, uint16_t idx)
Returns the n-th member index of the channel list for B.
Definition: dm1701_codeplug.cc:476
virtual uint16_t memberIndexA(unsigned n) const
Returns the n-th member index of the channel list for A.
Definition: dm1701_codeplug.cc:461
virtual bool linkZoneObj(Zone *zone, Context &ctx)
Links the given zone object.
Definition: dm1701_codeplug.cc:501
virtual ~ZoneExtElement()
Destructor.
Definition: dm1701_codeplug.cc:451
virtual bool fromZoneObj(const Zone *zone, Context &ctx)
Encodes the given zone.
Definition: dm1701_codeplug.cc:481
virtual uint16_t memberIndexB(unsigned n) const
Returns the n-th member index of the channel list for B.
Definition: dm1701_codeplug.cc:471
virtual void setMemberIndexA(unsigned n, uint16_t idx)
Sets the n-th member index of the channel list for A.
Definition: dm1701_codeplug.cc:466
ZoneExtElement(uint8_t *ptr, size_t size)
Constructor.
Definition: dm1701_codeplug.cc:439
void clear()
Abstract method to reset the element within the codeplug.
Definition: dm1701_codeplug.cc:456
Device specific implementation of the codeplug for the Baofeng DM-1701.
Definition: dm1701_codeplug.hh:49
bool encodePositioningSystems(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes all DMR positioning systems in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:911
bool encodeChannels(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all channels in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:577
void clearContacts()
Clears all contacts in the codeplug.
Definition: dm1701_codeplug.cc:622
bool encodeGroupLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:728
bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added scan lists within the configuration.
Definition: dm1701_codeplug.cc:808
bool createScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a scan list to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:792
bool decodeTextMessages(Context &ctx, const ErrorStack &err)
Decodes text messages.
Definition: dm1701_codeplug.cc:886
bool createZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a zone to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:685
void clearMenuSettings()
Clears the menu settings in the codeplug.
Definition: dm1701_codeplug.cc:823
void clearChannels()
Clears all channels in the codeplug.
Definition: dm1701_codeplug.cc:570
bool decodeButtonSetttings(Config *config, const ErrorStack &err=ErrorStack())
Decodes the button settings.
Definition: dm1701_codeplug.cc:840
void clearScanLists()
Clears all scan lists in the codeplug.
Definition: dm1701_codeplug.cc:771
void clearTimestamp()
Clears the time-stamp in the codeplug.
Definition: dm1701_codeplug.cc:541
bool encodeContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:629
bool encodeButtonSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the button settings.
Definition: dm1701_codeplug.cc:833
void clearTextMessages()
Clears all text messages in the codeplug.
Definition: dm1701_codeplug.cc:876
void clearPositioningSystems()
Clears all positioning systems in the codeplug.
Definition: dm1701_codeplug.cc:906
bool linkPositioningSystems(Context &ctx, const ErrorStack &err)
Links all added positioning systems within the configuration.
Definition: dm1701_codeplug.cc:925
virtual ~DM1701Codeplug()
Destructor.
Definition: dm1701_codeplug.cc:536
bool decodeGeneralSettings(Config *config, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition: dm1701_codeplug.cc:564
bool createPositioningSystems(Config *config, Context &ctx, const ErrorStack &err)
Adds a GPS positioning system to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:918
void clearGroupLists()
Clears all RX group lists in the codeplug.
Definition: dm1701_codeplug.cc:722
bool createGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a RX group list to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:741
virtual void clearVFOSettings()
Resets VFO settings.
Definition: dm1701_codeplug.cc:899
bool createChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a channel to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:592
bool encodeScanLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:778
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added channels within the configuration.
Definition: dm1701_codeplug.cc:608
bool createContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition: dm1701_codeplug.cc:643
bool encodePrivacyKeys(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes the encryption keys.
Definition: dm1701_codeplug.cc:852
bool encodeZones(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all zones in the configuration into the codeplug.
Definition: dm1701_codeplug.cc:668
bool encodeTextMessages(Context &ctx, const Flags &flags, const ErrorStack &err)
Encodes text messages.
Definition: dm1701_codeplug.cc:881
bool decodePrivacyKeys(Config *config, Context &ctx, const ErrorStack &err)
Decodes the encryption keys.
Definition: dm1701_codeplug.cc:862
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added RX group lists within the configuration.
Definition: dm1701_codeplug.cc:757
bool encodeTimestamp()
Sets the time-stamp.
Definition: dm1701_codeplug.cc:546
void clearZones()
Clears all zones in the codeplug.
Definition: dm1701_codeplug.cc:659
void clearPrivacyKeys()
Clears all encryption keys in the codeplug.
Definition: dm1701_codeplug.cc:847
void clearButtonSettings()
Clears the button settings in the codeplug.
Definition: dm1701_codeplug.cc:828
void clearEmergencySystems()
Clears all emergency systems in the codeplug.
Definition: dm1701_codeplug.cc:892
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition: dm1701_codeplug.cc:553
bool encodeGeneralSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition: dm1701_codeplug.cc:558
DM1701Codeplug(QObject *parent=nullptr)
Constructor.
Definition: dm1701_codeplug.cc:525
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added zones within the configuration.
Definition: dm1701_codeplug.cc:702
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Represents a single channel (analog or digital) within the TyT codeplug.
Definition: tyt_codeplug.hh:35
Codeplug representation of the general settings.
Definition: tyt_codeplug.hh:443
Base class of all TyT codeplugs.
Definition: tyt_codeplug.hh:26
Represents a zone within the generic configuration.
Definition: zone.hh:15
Some internal offsets within the codeplug.
Definition: dm1701_codeplug.hh:319