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

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

#include <radioddity_codeplug.hh>

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

Public Types

enum class  Action {
  None = 0x00 , ToggleAllAlertTones = 0x01 , EmergencyOn = 0x02 , EmergencyOff = 0x03 ,
  ToggleMonitor = 0x05 , NuiaceDelete = 0x06 , OneTouch1 = 0x07 , OneTouch2 = 0x08 ,
  OneTouch3 = 0x09 , OneTouch4 = 0x0a , OneTouch5 = 0x0b , OneTouch6 = 0x0c ,
  ToggleRepeatTalkaround = 0x0d , ToggleScan = 0x0e , TogglePrivacy = 0x10 , ToggleVox = 0x11 ,
  ZoneSelect = 0x12 , BatteryIndicator = 0x13 , ToggleLoneWorker = 0x14 , PhoneExit = 0x16 ,
  ToggleFlashLight = 0x1a , ToggleFMRadio = 0x1b
}
 Possible actions for each button on short and long press. More...
 
enum class  OneTouchAction { None = 0x00 , DigitalCall = 0x10 , DigitalMessage = 0x11 , AnalogCall = 0x20 }
 Possible one-touch actions. More...
 

Public Member Functions

 ButtonSettingsElement (uint8_t *ptr)
 Constructor.
 
virtual ~ButtonSettingsElement ()
 Destructor.
 
void clear ()
 Clears the button settings.
 
virtual unsigned longPressDuration () const
 Returns the long-press duration in ms.
 
virtual void setLongPressDuration (unsigned ms)
 Sets the long-press duration in ms.
 
virtual Action sk1ShortPress () const
 Returns the side-key 1 short-press action.
 
virtual void setSK1ShortPress (Action action)
 Sets the side-key 1 short-press action.
 
virtual Action sk1LongPress () const
 Returns the side-key 1 long-press action.
 
virtual void setSK1LongPress (Action action)
 Sets the side-key 1 long-press action.
 
virtual Action sk2ShortPress () const
 Returns the side-key 2 short-press action.
 
virtual void setSK2ShortPress (Action action)
 Sets the side-key 2 short-press action.
 
virtual Action sk2LongPress () const
 Returns the side-key 2 long-press action.
 
virtual void setSK2LongPress (Action action)
 Sets the side-key 2 long-press action.
 
virtual Action tkShortPress () const
 Returns the top-key short-press action.
 
virtual void setTKShortPress (Action action)
 Sets the top-key short-press action.
 
virtual Action tkLongPress () const
 Returns the top-key long-press action.
 
virtual void setTKLongPress (Action action)
 Sets the top-key long-press action.
 
virtual OneTouchAction oneTouchAction (unsigned n) const
 Returns the n-th one-touch action.
 
virtual unsigned oneTouchContact (unsigned n) const
 Returns the n-th one-touch contact index (if action is OneTouchAction::DigitalCall).
 
virtual unsigned oneTouchMessage (unsigned n) const
 Returns the n-th one-touch message index (if action is OneTouchAction::DigitalMessage).
 
virtual void disableOneTouch (unsigned n)
 Disables the n-th one-touch action.
 
virtual void setOneTouchDigitalCall (unsigned n, unsigned index)
 Configures n-th one-touch action as a digital call to contact index.
 
virtual void setOneTouchDigitalMessage (unsigned n, unsigned index)
 Configures n-th one-touch action as a digital message using given index.
 
virtual void setOneTouchAnalogCall (unsigned n)
 Configures n-th one-touch action as a analog call.
 
- 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...
 

Protected Member Functions

 ButtonSettingsElement (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 button settings for all Radioddity codeplugs.

Encoding of button settings (size 0x20b):

     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 | Unknown, set to 0x01          | Long press duration in 250ms  | Short SK1 event               | Long SK1 event                |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
04 | Short SK2 event               | Long press SK2 event          | Short press TK action (GD77)  | Long press TK action (GD77)   |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
08 | One-touch 0 action type       | One-touch 0, contact index                                    | One-touch 0, message index    |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    ...                                                                                                                         ...
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1c | One-touch 5 action type       | One-touch 5, contact index                                    | One-touch 5, message index    |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Member Enumeration Documentation

◆ Action

Possible actions for each button on short and long press.

Enumerator
None 

Disables button.

ToggleMonitor 

Toggle monitor on channel.

OneTouch1 

Performs the first of 6 user-programmable actions (call, message).

OneTouch2 

Performs the second of 6 user-programmable actions (call, message).

OneTouch3 

Performs the third of 6 user-programmable actions (call, message).

OneTouch4 

Performs the fourth of 6 user-programmable actions (call, message).

OneTouch5 

Performs the fifth of 6 user-programmable actions (call, message).

OneTouch6 

Performs the sixt of 6 user-programmable actions (call, message).

◆ OneTouchAction

Possible one-touch actions.

Enumerator
None 

Disabled.

DigitalCall 

Calls a digital contact.

DigitalMessage 

Sends a SMS.

AnalogCall 

Calls an analog contact.


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