libdrmconf 0.14.1
A library to program DMR radios.
Loading...
Searching...
No Matches
DMR6X2UV2Codeplug::ExtendedSettingsElement Class Reference

Implements some settings extension for the BTECH DMR-6X2UV PRO. More...

#include <dmr6x2uv2_codeplug.hh>

Inheritance diagram for DMR6X2UV2Codeplug::ExtendedSettingsElement:
Collaboration diagram for DMR6X2UV2Codeplug::ExtendedSettingsElement:

Classes

struct  Limit
 Some limits. More...
struct  Offset
 Some internal offset within the codeplug element. More...

Public Types

enum class  GNSS { GPS =0 , BeiDou =1 , Both =2 }
enum class  ChannelIndexDisplay { GlobalIndex = 0 , IndexWithinZone = 1 }
enum class  Power { Low = 0 , Medium = 1 , High = 2 , Turbo = 3 }

Public Member Functions

 ExtendedSettingsElement (uint8_t *ptr)
 Constructor.
virtual bool bluetoothEnabled () const
 Returns true, if bluetooth is enabled.
virtual void enableBluetooth (bool enable)
 Enables/disables bluetooth.
virtual bool internalMicEnabled () const
 Returns true, if the internal mic is enabled additionally to the bluetooth input.
virtual void enableInternalMic (bool enable)
 Enables/disables the internal mic additionally to the bluetooth input.
virtual bool internalSpeakerEnabled () const
 Returns true, if the internal speaker is enabled additionally to the bluetooth output.
virtual void enableInternalSpeaker (bool enable)
 Enables/disables the internal speaker additionally to the bluetooth output.
virtual unsigned int bluetoothMicGain () const
 Returns the bluetooth mic gain.
virtual void setBluetoothMicGain (unsigned int gain)
 Sets the bluetooth mic gain.
virtual unsigned int bluetoothSpeakerGain () const
 Returns the bluetooth speaker gain.
virtual void setBluetoothSpeakerGain (unsigned int gain)
 Sets the bluetooth speaker gain.
virtual Interval bluetoothHoldDuration () const
 Returns the hold duration.
virtual void setBluetoothHoldDuration (const Interval &dur)
 Sets the hold duration.
virtual Interval bluetoothHoldDelay () const
 Returns the hold delay.
virtual void setBluetoothHoldDelay (const Interval &dur)
 Sets the hold duration.
virtual bool bluetoothPTTLatchEnabled () const
 Returns true, if PTT latches.
virtual void enableBluetoothPTTLatch (bool enable)
 Enable/disable bluetooth PTT latch.
virtual Interval bluetoothPTTSleepTimeout () const
 Returns the bluetooth PTT sleep timeout.
virtual void setBluetoothPTTSleepTimeout (const Interval &dur)
 Sets the bluetooth PTT sleep timeout.
virtual bool fmIdleToneEnabled () const
 Returns true if the FM channel idle tone is enabled.
virtual void enableFMIdleTone (bool enable)
 Enables/disables FM channel idle tone.
virtual Level fmMicGain () const
 Returns the FM mic gain [1-10].
virtual void setFMMicGain (Level gain)
 Sets the FM mic gain [1-10].
virtual bool totWarningToneEnabled () const
 Returns true, if transmit timeout warning tone is enabled.
virtual void enableTOTWarningTone (bool enable)
 Enables/disables transmit timeout warning tone.
virtual bool atpcEnabled () const
 Returns true, if ATPC is enabled.
virtual void enableATPC (bool enable)
 Enables/disables ATPC.
virtual GNSSSettings::Systems gnss () const
 Returns enabled GNSSs.
virtual void setGNSS (GNSSSettings::Systems gnss)
 Sets enabled GNSSs.
virtual ChannelIndexDisplay channelIndexDisplay () const
 Returns the channel index display mode.
virtual void setChannelIndexDisplay (ChannelIndexDisplay mode)
 Sets the channel index display mode.
virtual bool wxAlarmEnabled () const
 Returns true if the weather alarm is enabled.
virtual void enableWXAlarm (bool enable)
 Enables/disables the weather alarm.
virtual bool locationSourceGNSS () const
 Returns true if the location is taken from GNSS, otherwise a fixed location is used.
virtual unsigned int fixedLocationIndex () const
 Returns the fixed location index.
virtual void setFixedLocationIndex (unsigned int idx)
 Sets the fixed location index.
virtual void setLocationSourceGNSS ()
 Sets the location source to GNSS.
virtual Channel::Power satPower () const
 Returns the power setting for satellite mode.
virtual void setSatPower (Channel::Power power)
 Sets the power level for satellite mode.
virtual unsigned int satSquelchLevel () const
 Returns the squelch level for satellite mode [0,1-10], 0=open.
virtual void setSatSquelchLevel (unsigned int level)
 Sets the squelch level for satellite mode [0,1-10], 0=open.
bool fromConfig (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
 Encodes the settings from the config.
bool updateConfig (Context &ctx, const ErrorStack &err=ErrorStack())
 Update config from settings.
bool linkConfig (Context &ctx, const ErrorStack &err=ErrorStack())
 Link config from settings extension.
Public Member Functions inherited from DMR6X2UVCodeplug::ExtendedSettingsElement
 ExtendedSettingsElement (uint8_t *ptr)
 Constructor.
void clear ()
 Resets the general settings.
virtual bool sendTalkerAlias () const
 Returns true if the talker alias is sent.
virtual void enableSendTalkerAlias (bool enable)
 Enables/disables sending the talker alias.
virtual AnytoneDMRSettingsExtension::TalkerAliasSource talkerAliasSource () const
 Returns the talker alias source.
virtual void setTalkerAliasSource (AnytoneDMRSettingsExtension::TalkerAliasSource mode)
 Sets the talker alias source.
virtual DMRSettings::TalkerAliasEncoding talkerAliasEncoding () const
 Returns the talker alias encoding.
virtual void setTalkerAliasEncoding (DMRSettings::TalkerAliasEncoding encoding)
 Sets the talker alias encoding.
virtual AnytoneDisplaySettingsExtension::Color fontColor () const
 Returns the font color.
virtual void setFontColor (AnytoneDisplaySettingsExtension::Color color)
 Sets the font color.
virtual bool customChannelBackgroundEnabled () const
 Returns true if the custom channel background is enabled.
virtual void enableCustomChannelBackground (bool enable)
 Enables/disables the custom channel background.
virtual bool autoRoamingEnabled () const
 Returns true if auto roaming is enabled.
virtual void enableAutoRoaming (bool enable)
 Enables/disables auto roaming.
virtual bool repeaterRangeCheckEnabled () const
 Returns true if repeater check is enabled.
virtual void enableRepeaterRangeCheck (bool enable)
 Enables/disables repeater check.
virtual unsigned int repeaterCheckNumNotifications () const
 Returns the number of times, the repeater out-of-range reminder is shown (1-10).
virtual void setRepeaterCheckNumNotifications (unsigned int n)
 Sets the number of times, the repeater out-of-range reminder is shown (1-10).
virtual Interval repeaterRangeCheckInterval () const
 Returns the repeater check interval in seconds (5-50s).
virtual void setRepeaterRangeCheckInterval (Interval intv)
 Sets the repeater check interval in seconds (5-50s).
virtual AnytoneRoamingSettingsExtension::OutOfRangeAlert repeaterOutOfRangeAlert () const
 Returns the repeater out-of-range alert type.
virtual void setRepeaterOutOfRangeAlert (AnytoneRoamingSettingsExtension::OutOfRangeAlert alert)
 Sets the repeater out-of-range alert type.
virtual unsigned int repeaterRangeCheckCount () const
 Returns the number of times, a repeater reconnection is tried (3-5).
virtual void setRepeaterRangeCheckCount (unsigned int n)
 Sets the number of times, a repeater reconnection is tried (3-5).
virtual unsigned int defaultRoamingZoneIndex () const
 Returns the roaming zone index.
virtual void setDefaultRoamingZoneIndex (unsigned int index)
 Sets the roaming zone index.
virtual AnytoneRoamingSettingsExtension::RoamStart roamingStartCondition () const
 Returns the condition to start roaming.
virtual void setRoamingStartCondition (AnytoneRoamingSettingsExtension::RoamStart cond)
 Sets the condition to start roaming.
virtual Interval autoRoamPeriod () const
 Returns the auto-roaming interval in minutes (1-256).
virtual void setAutoRoamPeriod (Interval minutes)
 Sets the auto-roaming interval in minutes (1-256).
virtual Interval autoRoamDelay () const
 Returns the effective roaming waiting time in seconds (0-30s).
virtual void setAutoRoamDelay (Interval sec)
 Sets the effective roaming waiting time in seconds (0-30s).
virtual AnytoneRoamingSettingsExtension::RoamStart roamingReturnCondition () const
 Returns the roaming return condition.
virtual void setRoamingReturnCondition (AnytoneRoamingSettingsExtension::RoamStart cond)
 Sets the roaming return condition.
virtual Interval muteTimer () const
 Returns the mute timer in minutes.
virtual void setMuteTimer (Interval minutes)
 Sets the mute timer in minutes.
virtual AnytoneDMRSettingsExtension::EncryptionType encryptionType () const
 Returns the encryption type.
virtual void setEncryptionType (AnytoneDMRSettingsExtension::EncryptionType type)
 Sets the encryption type.
AnytoneDisplaySettingsExtension::Color zoneANameColor () const
 Returns the color of the zone name for VFO A.
void setZoneANameColor (AnytoneDisplaySettingsExtension::Color color)
 Sets the zone name color for the VFO A.
AnytoneDisplaySettingsExtension::Color zoneBNameColor () const
 Returns the color of the zone name for VFO B.
void setZoneBNameColor (AnytoneDisplaySettingsExtension::Color color)
 Sets the zone name color for the VFO B.
virtual AnytoneDisplaySettingsExtension::Color channelANameColor () const
 Returns the name color for channel A.
virtual void setChannelANameColor (AnytoneDisplaySettingsExtension::Color color)
 Sets the name color for channel A.
AnytoneDisplaySettingsExtension::Color channelBNameColor () const
 Returns the color of the channel name for VFO B.
void setChannelBNameColor (AnytoneDisplaySettingsExtension::Color color)
 Sets the channel name color for the VFO B.
bool fromConfig (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
 Encodes the settings from the config.
bool updateConfig (Context &ctx, const ErrorStack &err=ErrorStack())
 Update config from settings.
bool linkConfig (Context &ctx, const ErrorStack &err=ErrorStack())
 Link config from settings extension.
Public Member Functions inherited from Codeplug::Element
 Element (const Element &other)
 Copy constructor.
virtual ~Element ()
 Destructor.
Elementoperator= (const Element &other)
 Copy assignment.
virtual bool isValid () const
 Returns true if the pointer is not null.
bool fill (uint8_t value, unsigned offset=0, int size=-1)
 Fills the memsets the entire element to the given value.
bool getBit (const Offset::Bit &offset) const
 Reads a specific bit at the given byte-offset.
bool getBit (unsigned offset, unsigned bit) const
 Reads a specific bit at the given byte-offset.
void setBit (const Offset::Bit &offset, bool value=true)
 Sets a specific bit at the given byte-offset.
void setBit (unsigned offset, unsigned bit, bool value=true)
 Sets a specific bit at the given byte-offset.
void clearBit (unsigned offset, unsigned bit)
 Clears a specific bit at the given byte-offset.
void clearBit (const Offset::Bit &offset)
 Clears a specific bit.
uint8_t getUInt2 (const Offset::Bit &offset) const
 Reads a 2bit unsigned integer at the given bit-offset.
uint8_t getUInt2 (unsigned offset, unsigned bit) const
 Reads a 2bit unsigned integer at the given byte- and bit-offset.
void setUInt2 (const Offset::Bit &offset, uint8_t value)
 Stores a 2bit unsigned integer at the given bit-offset.
void setUInt2 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 2bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt3 (const Offset::Bit &offset) const
 Reads a 3bit unsigned integer at the given bit-offset.
uint8_t getUInt3 (unsigned offset, unsigned bit) const
 Reads a 3bit unsigned integer at the given byte- and bit-offset.
void setUInt3 (const Offset::Bit &offset, uint8_t value)
 Stores a 3bit unsigned integer at the given bit-offset.
void setUInt3 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 3bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt4 (const Offset::Bit &offset) const
 Reads a 4bit unsigned integer at the given bit-offset.
uint8_t getUInt4 (unsigned offset, unsigned bit) const
 Reads a 4bit unsigned integer at the given byte- and bit-offset.
void setUInt4 (const Offset::Bit &offset, uint8_t value)
 Stores a 4bit unsigned integer at the given bit-offset.
void setUInt4 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 4bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt5 (const Offset::Bit &offset) const
 Reads a 5bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt5 (unsigned offset, unsigned bit) const
 Reads a 5bit unsigned integer at the given byte- and bit-offset.
void setUInt5 (const Offset::Bit &offset, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
void setUInt5 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt6 (const Offset::Bit &offset) const
 Reads a 6bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt6 (unsigned offset, unsigned bit) const
 Reads a 6bit unsigned integer at the given byte- and bit-offset.
void setUInt6 (const Offset::Bit &offset, uint8_t value)
 Stores a 6bit unsigned integer at the given byte- and bit-offset.
void setUInt6 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 6bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt8 (unsigned offset) const
 Reads a 8bit unsigned integer at the given byte- and bit-offset.
void setUInt8 (unsigned offset, uint8_t value)
 Reads a 8bit unsigned integer at the given byte- and bit-offset.
int8_t getInt8 (unsigned offset) const
 Reads a 8bit signed integer at the given byte- and bit-offset.
void setInt8 (unsigned offset, int8_t value)
 Reads a 8bit signed integer at the given byte- and bit-offset.
uint16_t getUInt16_be (unsigned offset) const
 Reads a 16bit big-endian unsigned integer at the given byte-offset.
uint16_t getUInt16_le (unsigned offset) const
 Reads a 16bit little-endian unsigned integer at the given byte-offset.
void setUInt16_be (unsigned offset, uint16_t value)
 Stores a 16bit big-endian unsigned integer at the given byte-offset.
void setUInt16_le (unsigned offset, uint16_t value)
 Stores a 16bit little-endian unsigned integer at the given byte-offset.
uint32_t getUInt24_be (unsigned offset) const
 Reads a 24bit big-endian unsigned integer at the given byte-offset.
uint32_t getUInt24_le (unsigned offset) const
 Reads a 24bit little-endian unsigned integer at the given byte-offset.
void setUInt24_be (unsigned offset, uint32_t value)
 Stores a 24bit big-endian unsigned integer at the given byte-offset.
void setUInt24_le (unsigned offset, uint32_t value)
 Stores a 24bit little-endian unsigned integer at the given byte-offset.
uint32_t getUInt32_be (unsigned offset) const
 Reads a 32bit big-endian unsigned integer at the given byte-offset.
uint32_t getUInt32_le (unsigned offset) const
 Reads a 32bit little-endian unsigned integer at the given byte-offset.
void setUInt32_be (unsigned offset, uint32_t value)
 Stores a 32bit big-endian unsigned integer at the given byte-offset.
void setUInt32_le (unsigned offset, uint32_t value)
 Stores a 32bit little-endian unsigned integer at the given byte-offset.
uint64_t getUInt64_be (unsigned offset) const
 Reads a 64bit big-endian unsigned integer at the given byte-offset.
uint64_t getUInt64_le (unsigned offset) const
 Reads a 64bit little-endian unsigned integer at the given byte-offset.
void setUInt64_be (unsigned offset, uint64_t value)
 Stores a 64bit big-endian unsigned integer at the given byte-offset.
void setUInt64_le (unsigned offset, uint64_t value)
 Stores a 64bit little-endian unsigned integer at the given byte-offset.
uint8_t getBCD2 (unsigned offset) const
 Reads a 2-digit (1-byte/8bit) BDC value in big-endian at the given byte-offset.
void setBCD2 (unsigned offset, uint8_t value)
 Stores a 2-digit (1-byte/8bit) BDC value in big-endian at the given byte-offset.
uint16_t getBCD4_be (unsigned offset) const
 Reads a 4-digit (2-byte/16bit) BDC value in big-endian at the given byte-offset.
void setBCD4_be (unsigned offset, uint16_t value)
 Stores a 4-digit (2-byte/16bit) BDC value in big-endian at the given byte-offset.
uint16_t getBCD4_le (unsigned offset) const
 Reads a 4-digit (2-byte/16bit) BDC value in little-endian at the given byte-offset.
void setBCD4_le (unsigned offset, uint16_t value)
 Stores a 4-digit (1-byte/16bit) BDC value in little-endian at the given byte-offset.
uint32_t getBCD8_be (unsigned offset) const
 Reads a 8-digit (4-byte/32bit) BDC value in big-endian at the given byte-offset.
void setBCD8_be (unsigned offset, uint32_t value)
 Stores a 8-digit (4-byte/32bit) BDC value in big-endian at the given byte-offset.
uint32_t getBCD8_le (unsigned offset) const
 Reads a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset.
void setBCD8_le (unsigned offset, uint32_t value)
 Stores a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset.
QString readASCII (unsigned offset, unsigned maxlen, uint8_t eos=0x00) const
 Reads up to maxlen ASCII chars at the given byte-offset using eos as the string termination char.
void writeASCII (unsigned offset, const QString &txt, unsigned maxlen, uint8_t eos=0x00)
 Stores up to maxlen ASCII chars at the given byte-offset using eos as the string termination char.
QString readUnicode (unsigned offset, unsigned maxlen, uint16_t eos=0x0000) const
 Reads up to maxlen unicode chars at the given byte-offset using eos as the string termination char.
void writeUnicode (unsigned offset, const QString &txt, unsigned maxlen, uint16_t eos=0x0000)
 Stores up to maxlen unicode chars at the given byte-offset using eos as the string termination char.

Static Public Member Functions

static constexpr unsigned int size ()
 Returns the size of the element.
Static Public Member Functions inherited from DMR6X2UVCodeplug::ExtendedSettingsElement
static constexpr unsigned int size ()
 Returns the size of the element.

Protected Member Functions

 ExtendedSettingsElement (uint8_t *ptr, unsigned size)
 Hidden Constructor.
Protected Member Functions inherited from DMR6X2UVCodeplug::ExtendedSettingsElement
 ExtendedSettingsElement (uint8_t *ptr, unsigned size)
 Hidden Constructor.
Protected Member Functions inherited from AnytoneCodeplug::ExtendedSettingsElement
 ExtendedSettingsElement (uint8_t *ptr, unsigned size)
 Hidden constructor.
Protected Member Functions inherited from Codeplug::Element
 Element (uint8_t *ptr, size_t size)
 Hidden constructor.

Additional Inherited Members

Protected Types inherited from DMR6X2UVCodeplug::ExtendedSettingsElement
enum class  TalkerAliasEncoding { ISO8 = 0 , ISO7 = 1 , Unicode = 2 }
 Talker alias encoding.
Protected Attributes inherited from Codeplug::Element
uint8_t * _data
 Holds the pointer to the element.
size_t _size
 Holds the size of the element.

Detailed Description

Implements some settings extension for the BTECH DMR-6X2UV PRO.

Member Function Documentation

◆ bluetoothHoldDuration()

Interval DMR6X2UV2Codeplug::ExtendedSettingsElement::bluetoothHoldDuration ( ) const
virtual

Returns the hold duration.

Todo
Implement interval=infinite.

◆ bluetoothMicGain()

unsigned int DMR6X2UV2Codeplug::ExtendedSettingsElement::bluetoothMicGain ( ) const
virtual

Returns the bluetooth mic gain.

Valid values are 0,...,4.

◆ bluetoothSpeakerGain()

unsigned int DMR6X2UV2Codeplug::ExtendedSettingsElement::bluetoothSpeakerGain ( ) const
virtual

Returns the bluetooth speaker gain.

Valid values are 0,...,4.

◆ fromConfig()

bool DMR6X2UV2Codeplug::ExtendedSettingsElement::fromConfig ( const Flags & flags,
Context & ctx,
const ErrorStack & err = ErrorStack() )
virtual

Encodes the settings from the config.

Reimplemented from AnytoneCodeplug::ExtendedSettingsElement.

◆ linkConfig()

bool DMR6X2UV2Codeplug::ExtendedSettingsElement::linkConfig ( Context & ctx,
const ErrorStack & err = ErrorStack() )
virtual

Link config from settings extension.

Reimplemented from AnytoneCodeplug::ExtendedSettingsElement.

◆ setBluetoothMicGain()

void DMR6X2UV2Codeplug::ExtendedSettingsElement::setBluetoothMicGain ( unsigned int gain)
virtual

Sets the bluetooth mic gain.

Valid values are 0,...,4.

◆ setBluetoothSpeakerGain()

void DMR6X2UV2Codeplug::ExtendedSettingsElement::setBluetoothSpeakerGain ( unsigned int gain)
virtual

Sets the bluetooth speaker gain.

Valid values are 0,...,4.

◆ updateConfig()

bool DMR6X2UV2Codeplug::ExtendedSettingsElement::updateConfig ( Context & ctx,
const ErrorStack & err = ErrorStack() )
virtual

Update config from settings.

Reimplemented from AnytoneCodeplug::ExtendedSettingsElement.


The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dmr6x2uv2_codeplug.hh
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dmr6x2uv2_codeplug.cc