libdrmconf  0.12.0
A library to program DMR radios.
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
DR1801UVCodeplug::DTMFSettingsElement Class Reference

Implements the binary encoding of the DTMF signaling settings. More...

#include <dr1801uv_codeplug.hh>

Inheritance diagram for DR1801UVCodeplug::DTMFSettingsElement:
Inheritance graph
[legend]
Collaboration diagram for DR1801UVCodeplug::DTMFSettingsElement:
Collaboration graph
[legend]

Classes

struct  Limit
 Some limits. More...
 
struct  Offset
 Internal offsets within the settings element. More...
 

Public Types

enum class  NonNumber {
  None = 0 , A =0xa , B =0xb , C =0xc ,
  D =0xd , Asterisk =0xe , Gate =0xf
}
 Possible DTMF non-number codes. More...
 
enum class  Response { None =0 , Reminder =1 , Reply =2 , Both =3 }
 Possible responses.
 
enum class  Kill { DisableTX = 0 , DisableRXandTX = 1 }
 Possible kill actions.
 

Public Member Functions

 DTMFSettingsElement (uint8_t *ptr)
 Constructor.
 
void clear ()
 Abstract method to reset the element within the codeplug. More...
 
virtual QString radioID () const
 Retunrs the DTMF radio ID as a string.
 
virtual void setRadioID (const QString &id)
 Sets the DTMF radio ID as a string.
 
virtual QString killCode () const
 Retunrs the DTMF kill code as a string.
 
virtual void setKillCode (const QString &code)
 Sets the DTMF kill code as a string.
 
virtual QString wakeCode () const
 Retunrs the DTMF wake code as a string.
 
virtual void setWakeCode (const QString &code)
 Sets the DTMF wake code as a string.
 
virtual NonNumber delimiter () const
 Returns the delimiter code.
 
virtual void setDelimiter (NonNumber code)
 Sets the delimiter code.
 
virtual NonNumber groupCode () const
 Returns the group code.
 
virtual void setGroupCode (NonNumber code)
 Sets the group code.
 
virtual Response response () const
 Returns the decode response.
 
virtual void setResponse (Response resp)
 Sets the decode response.
 
virtual unsigned int autoResetTime () const
 Returns the auto-reset time in seconds [5,60s].
 
virtual void setAutoResetTime (unsigned int sec)
 Set the auto-reset time in seconds.
 
virtual bool killWakeEnabled () const
 Returns true if the kill/wake decoding is endabled.
 
virtual void enableKillWake (bool enable)
 Enables/disables the kill/wake decoding.
 
virtual Kill killType () const
 Returns the kill type.
 
virtual void setKillType (Kill type)
 Sets the kill type.
 
virtual DTMFSystemBankElement dtmfSystems () const
 Returns a reference to the DTMF systems.
 
virtual DTMFIDBankElement dtmfIDs () const
 Returns a reference to the DTMF IDs.
 
virtual PTTIDBankElement pttIDs () const
 Retunrs a reference to the PTT ID bank.
 
- 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...
 

Static Public Member Functions

static constexpr unsigned int size ()
 The size of the element.
 

Protected Member Functions

 DTMFSettingsElement (uint8_t *ptr, size_t 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 binary encoding of the DTMF signaling settings.

Memory representation of the settings (029ch 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
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0000 | DTMF radio ID, 5 x ASCII, 0-padded                                                                                         ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0004  ...                            | Radio ID Length               | Unused set to 0x00                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0008 | DTMF kill code, 6 x ASCII, 0-padded                                                                                        ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
000c  ...                                                            | Kill code length              | Unused, set to 0x00           |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0010 | DTMF wake code, 6 x ASCII, 0-padded                                                                                        ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0014  ...                                                            | Wake code length              | Unused, set to 0x00           |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0018 | Delimiter                     | Group code                    | Decode response               | Auto reset time in sec. [5,60]|
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
001c | Kill/wake enable              | Kill type                     | Unused, set to 0x00                                           |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0020 | DTMF system bank                                                                                                           ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0050  ...                                                                                                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0054 | DTMF ID bank                                                                                                               ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0194  ...                                                                                                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0198 | PTT ID bank                                                                                                                ...
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0298  ...                                                                                                                            |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Where:
  - Delimiter/Group code: 0h=None, ah=A, bh=B, ch=C, dh=D, eh=*, fh=#
  - Decode response: 0=None, 1=Reminder, 2=Reply, 3=Both
  - Kill type: 0=Disable TX, 1=Disable TX & RX

Member Enumeration Documentation

◆ NonNumber

Possible DTMF non-number codes.

Usually used as separator and group codes.

Member Function Documentation

◆ clear()

void DR1801UVCodeplug::DTMFSettingsElement::clear ( )
virtual

Abstract method to reset the element within the codeplug.

Any device specific element should implement this method.

Reimplemented from Codeplug::Element.


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