libdrmconf  0.12.0
A library to program DMR radios.
Public Types | Public Member Functions | Protected Member Functions | List of all members
RadioddityCodeplug::GeneralSettingsElement Class Reference

Implements the base class of general settings for all Radioddity codeplugs. More...

#include <radioddity_codeplug.hh>

Inheritance diagram for RadioddityCodeplug::GeneralSettingsElement:
Inheritance graph
[legend]
Collaboration diagram for RadioddityCodeplug::GeneralSettingsElement:
Collaboration graph
[legend]

Public Types

typedef RadiodditySettingsExtension::MonitorType MonitorType
 Use monitor type from extension.
 
typedef RadioddityToneSettingsExtension::ARTSTone ARTSTone
 Use ARTS tone mode from extension.
 
typedef RadiodditySettingsExtension::ScanMode ScanMode
 Use scan mode from extension.
 

Public Member Functions

 GeneralSettingsElement (uint8_t *ptr)
 Constructor.
 
virtual ~GeneralSettingsElement ()
 Destructor.
 
void clear ()
 Resets the general settings.
 
virtual QString name () const
 Returns the radio name.
 
virtual void setName (const QString &name)
 Sets the radio name.
 
virtual unsigned radioID () const
 Returns the DMR radio ID.
 
virtual void setRadioID (unsigned id)
 Sets the DMR radio ID.
 
virtual unsigned preambleDuration () const
 Returns the preamble duration in ms.
 
virtual void setPreambleDuration (unsigned ms)
 Sets the preamble duration in ms.
 
virtual MonitorType monitorType () const
 Returns the monitor type.
 
virtual void setMonitorType (MonitorType type)
 Sets the monitor type.
 
virtual unsigned voxSensitivity () const
 Returns the VOX sensitivity [1-10], 0=disabled.
 
virtual void setVOXSensitivity (unsigned value)
 Sets the VOX sensitivity.
 
virtual unsigned lowBatteryWarnInterval () const
 Returns the low-battery warn interval in seconds.
 
virtual void setLowBatteryWarnInterval (unsigned sec)
 Sets the low-battery warn interval in seconds.
 
virtual unsigned callAlertDuration () const
 Returns the call-alert duration in seconds.
 
virtual void setCallAlertDuration (unsigned sec)
 Sets the call-allert duration in seconds.
 
virtual unsigned loneWorkerResponsePeriod () const
 Returns the lone-worker response period in minutes.
 
virtual void setLoneWorkerResponsePeriod (unsigned min)
 Sets the lone-worker response period in minutes.
 
virtual unsigned loneWorkerReminderPeriod () const
 Returns the lone-worker reminder period in seconds.
 
virtual void setLoneWorkerReminderPeriod (unsigned sec)
 Sets the lone-worker reminder period in seconds.
 
virtual unsigned groupCallHangTime () const
 Returns the group call hang time in ms.
 
virtual void setGroupCallHangTime (unsigned ms)
 Sets the group call hang time in ms.
 
virtual unsigned privateCallHangTime () const
 Returns the private call hang time in ms.
 
virtual void setPrivateCallHangTime (unsigned ms)
 Sets the private call hang time in ms.
 
virtual bool downChannelModeVFO () const
 Returns true if the down-channel mode is VFO.
 
virtual void enableDownChannelModeVFO (bool enable)
 Enables/disables down-channel mode is VFO.
 
virtual bool upChannelModeVFO () const
 Returns true if the up-channel mode is VFO.
 
virtual void enableUpChannelModeVFO (bool enable)
 Enables/disables up-channel mode is VFO.
 
virtual bool resetTone () const
 Returns true if the reset tone is enabled.
 
virtual void enableResetTone (bool enable)
 Enables/disables reset tone.
 
virtual bool unknownNumberTone () const
 Returns true if the unknown number tone is enabled.
 
virtual void enableUnknownNumberTone (bool enable)
 Enables/disables reset tone.
 
virtual ARTSTone artsToneMode () const
 Returns the ARTS tone mode.
 
virtual void setARTSToneMode (ARTSTone mode)
 Sets the ARTS tone mode.
 
virtual bool digitalTalkPermitTone () const
 Returns true if the digital channel talk permit tone is enabled.
 
virtual void enableDigitalTalkPermitTone (bool enable)
 Enables/disables digital channel talk permit tone.
 
virtual bool analogTalkPermitTone () const
 Returns true if the analog channel talk permit tone is enabled.
 
virtual void enableAnalogTalkPermitTone (bool enable)
 Enables/disables analog channel talk permit tone.
 
virtual bool selftestTone () const
 Returns true if the reset tone is enabled.
 
virtual void enableSelftestTone (bool enable)
 Enables/disables reset tone.
 
virtual bool channelFreeIndicationTone () const
 Returns true if the channel free indication tone is enabled.
 
virtual void enableChannelFreeIndicationTone (bool enable)
 Enables/disables channel free indication tone.
 
virtual bool allTonesDisabled () const
 Returns true if all tones are disabled.
 
virtual void disableAllTones (bool disable)
 Disables/enables all tones.
 
virtual bool batsaveRX () const
 Returns true if reception is disabled for battery saving.
 
virtual void enableBatsaveRX (bool enable)
 Enables/disables battery saving by disabling RX.
 
virtual bool batsavePreamble () const
 Returns true if preable is disabled for battery saving.
 
virtual void enableBatsavePreamble (bool enable)
 Enables/disables battery saving by disabling preamble.
 
virtual bool allLEDsDisabled () const
 Returns true if all LEDs are disabled.
 
virtual void disableAllLEDs (bool disable)
 Disables/enables all LEDs.
 
virtual bool quickKeyOverrideInhibited () const
 Returns true if quick-key override is inhibited.
 
virtual void inhibitQuickKeyOverride (bool inhibit)
 Inhibits quick-key override.
 
virtual bool txExitTone () const
 Returns true if the TX exit tone is enabled.
 
virtual void enableTXExitTone (bool enable)
 Enables/disables TX exit tone.
 
virtual bool txOnActiveChannel () const
 Returns true if the radio transmits on the active channel on double monitor.
 
virtual void enableTXOnActiveChannel (bool enable)
 Enables/disables transmission on active channel on double monitor.
 
virtual bool animation () const
 Returns true if animation is enabled.
 
virtual void enableAnimation (bool enable)
 Enables/disables animation.
 
virtual ScanMode scanMode () const
 Returns the scan mode.
 
virtual void setScanMode (ScanMode mode)
 Sets the scan mode.
 
virtual unsigned repeaterEndDelay () const
 Returns the repeater end delay in [0-10].
 
virtual void setRepeaterEndDelay (unsigned delay)
 Sets the repeater end delay in [0-10].
 
virtual unsigned repeaterSTE () const
 Returns the repeater STE in [0-10].
 
virtual void setRepeaterSTE (unsigned ste)
 Sets the repeater STE in [0-10].
 
virtual bool hasProgPassword () const
 Returns true if a programming password is set.
 
virtual QString progPassword () const
 Returns the programming password.
 
virtual void setProgPassword (const QString &pwd)
 Sets the programming password.
 
virtual void clearProgPassword ()
 Resets the programming password.
 
virtual bool fromConfig (const Config *conf, Context &ctx)
 Encodes the general setting from the given config.
 
virtual bool updateConfig (Config *conf, Context &ctx)
 Updates the given config from this settings.
 
- 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::BitOffset &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::BitOffset &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.
 
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...
 

Protected Member Functions

 GeneralSettingsElement (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 the base class of general settings for all Radioddity codeplugs.

Memory layout of the general settings

       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
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0000 | Radio name, 8 x 1byte ASCII encoded, 0xff terminated text                                                                  ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0004  ...                                                                                                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0008 | 8-digit BCD DMR ID, big-endian.                                                                                               |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
000c | Unused set to 0x00000000                                                                                                      |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0010 | Unused set to 0x00            | Tx preamble N x 60ms          | Monitor type 0=open, 1=silent | VOX sensitivity [1..10]       |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0014 | Low battery interval N x 5s   | Call alert dur N x 5s         | Lone worker response in min   | Lone worker reminder in sec   |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0018 | Groupcall hang-time N x 500ms | Priv.call hang-time N x 500ms | ARTS tone     |UNT|RST|UMV|DMV|SBP|SBR|DAT| 0 |FIT|STT|PAT|PDT|
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
001c | 1 |IQO|DAL| 0   0   0   0   0 | ScanM |ANI|DBW|TXT| 0   0   0 | Rep. STE      | Rep. delay    | Unused set to 0x00            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0020 | Prog. passwd 8 x ASCII, 0xff terminated                                                                                    ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0024  ...                                                                                                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
where
UNT = Unknown number tone
RST = Reset tone
UMV = Up-channel mode VFO
DMV = Down-channel mode VFO
SBP = Send wakeup preamble.
SBR = Enable sleep mode during RX.
DAT = Disables all tones;
FIT = Channel free indication tone
STT = Self-test pass tone
PAT = Talk permit tone analog
PDT = Talk permit tone digital
IQO = Inhibit quick-key override
DAL = Disables all LEDs
ScanM = Scan mode
ANI = Enable animation
DBW = Always TX on active channel on double-wait
TXT = TX exit tone

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