libdrmconf  0.11.3
A library to program DMR radios.
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
DMR6X2UVCodeplug::ExtendedSettingsElement Class Reference

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

#include <dmr6x2uv_codeplug.hh>

Inheritance diagram for DMR6X2UVCodeplug::ExtendedSettingsElement:
Inheritance graph
[legend]
Collaboration diagram for DMR6X2UVCodeplug::ExtendedSettingsElement:
Collaboration graph
[legend]

Classes

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

Public Member Functions

 ExtendedSettingsElement (uint8_t *ptr)
 Constructor.
 
void clear ()
 Resets the general settings.
 
bool sendTalkerAlias () const
 Returns true if the talker alias is sent.
 
void enableSendTalkerAlias (bool enable)
 Enables/disables sending the talker alias.
 
AnytoneDMRSettingsExtension::TalkerAliasSource talkerAliasSource () const
 Returns the talker alias source.
 
void setTalkerAliasSource (AnytoneDMRSettingsExtension::TalkerAliasSource source)
 Sets the talker alias source.
 
AnytoneDMRSettingsExtension::TalkerAliasEncoding talkerAliasEncoding () const
 Returns the talker alias encoding.
 
void setTalkerAliasEncoding (AnytoneDMRSettingsExtension::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.
 
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 (unsigned offset, unsigned bit) const
 Reads 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.
 
uint8_t getUInt2 (unsigned offset, unsigned bit) const
 Reads a 2bit unsigned integer at the given byte- and 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 (unsigned offset, unsigned bit) const
 Reads a 3bit unsigned integer at the given byte- and 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 (unsigned offset, unsigned bit) const
 Reads a 4bit unsigned integer at the given byte- and 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 (unsigned offset, unsigned bit) const
 Reads a 5bit unsigned integer at the given byte- and bit-offset.
 
void setUInt5 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 5bit iunsinged nteger 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 (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. More...
 
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. More...
 

Static Public Member Functions

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 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. More...
 

Additional Inherited Members

- 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.

Memory representation of the encoded settings element (size 0x0e0 bytes):

     7   6   5   4   3   2   1   0   7   6   5   4   3   2   1   0   7   6   5   4   3   2   1   0   7   6   5   4   3   2   1   0
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
00 | Enable send talker alias      | Talker alias display priority | Talker alias encoding         | Font Color                    |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
04 | Enable custom ch. background  | Roaming zone index 0-based    | Enable auto roaming           | Enable repeater check         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
08 | Out of repeater range alert   | Rep. out of range reminder    | Repeater check interval      | Repeater reconnections         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0c | Start roaming condition       | Auto roaming interval        | Roaming eff. waiting time     | Roaming return condition       |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
10 | Mute timer (n+1) min          | Encryption type               | Zone A name color             | Zone B name color             |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
14 | Channel A name color          | Channel B name color          |                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
18 |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1c |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
20 |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
24 |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
28 |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2c |                                                                                                                               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Field description:
 - Talker alias display priority: 0x00=None, 0x01=Contact alias, 0x02=Over-the-air alias
 - Talker alias encoding: 0x00=ISO-8, 0x01=ISO-7, 0x02=Unicode
 - Font Color: 0x00=White, 0x01=Black, 0x02=Orange, 0x03=Red, 0x04=Yellow, 0x05=Green, 0x06=Turquoise, 0x07=Blue
 - Encryption type: 0x00=Common(Basic), 0x01=AES
 - Zone/Channel A/B name color: 0x00=Orange, 0x01=Red, 0x02=Yellow, 0x03=Green, 0x04=Turquoise, 0x05=Blue, 0x06=White, 0x07=Black
 - Out of repeater range alert: 0x00=Off, 0x01=Bell, 0x02=Voice
 - Rep. out of range reminder: Number of times, the reminder is shown (n-1), 0x00=1, 0x01=2, ..., 0x09=10
 - Repeater check interval (n+1)*5 seconds: 0x00=5s, ..., 0x09=50s
 - Repeater reconnections: 0x00=3, 0x01=4, 0x03=5
 - Start roaming condition: 0x00=fixed time, 0x01=out of range
 - Auto roaming interval: 0x00=1min, ..., 0xff=256min
 - Roaming eff. waiting time: 0x00=off, 0x01=1s, ..., 0x1e=30s
 - Roaming return condition: 0x00=fixed time, 0x01=out of range


The documentation for this class was generated from the following files: