libdrmconf
0.12.0
A library to program DMR radios.
|
Implements the base class of menu settings for all Radioddity codeplugs. More...
#include <radioddity_codeplug.hh>
Public Types | |
enum class | ChannelDisplayMode { Number = 0 , Name = 1 , Frequency = 2 } |
Possible channel display modes. More... | |
enum class | DualWatchMode { DualDual = 1 , DualSingle = 2 } |
Possible dual-watch modes. | |
Public Member Functions | |
MenuSettingsElement (uint8_t *ptr) | |
Constructor. | |
virtual | ~MenuSettingsElement () |
Destructor. | |
void | clear () |
Resets the menu settings. | |
virtual unsigned | menuHangTime () const |
Returns the menu hang-time in seconds. | |
virtual void | setMenuHangTime (unsigned sec) |
Sets the menu hang time in seconds. | |
virtual bool | message () const |
Returns true if the message menu is shown. | |
virtual void | enableMessage (bool enable) |
Enables/disables the message menu. | |
virtual bool | scanStart () const |
Returns true if the scan-start menu is shown. | |
virtual void | enableScanStart (bool enable) |
Enables/disables the scan-start menu. | |
virtual bool | editScanList () const |
Returns true if the edit scan-list menu is shown. | |
virtual void | enableEditScanList (bool enable) |
Enables/disables the edit scan-list menu. | |
virtual bool | callAlert () const |
Returns true if the call-alert menu is shown. | |
virtual void | enableCallAlert (bool enable) |
Enables/disables the call-alert menu. | |
virtual bool | editContact () const |
Returns true if the edit-contact menu is shown. | |
virtual void | enableEditContact (bool enable) |
Enables/disables the edit-contact menu. | |
virtual bool | manualDial () const |
Returns true if the manual-dial menu is shown. | |
virtual void | enableManualDial (bool enable) |
Enables/disables the manual-dial menu. | |
virtual bool | radioCheck () const |
Returns true if the radio-check menu is shown. | |
virtual void | enableRadioCheck (bool enable) |
Enables/disables the radioCheck menu. | |
virtual bool | remoteMonitor () const |
Returns true if the remote-monitor menu is shown. | |
virtual void | enableRemoteMonitor (bool enable) |
Enables/disables the message menu. | |
virtual bool | radioEnable () const |
Returns true if the radio-enable menu is shown. | |
virtual void | enableRadioEnable (bool enable) |
Enables/disables the radio-enable menu. | |
virtual bool | radioDisable () const |
Returns true if the radio-disable menu is shown. | |
virtual void | enableRadioDisable (bool enable) |
Enables/disables the radio-disable menu. | |
virtual bool | progPassword () const |
Returns true if the programming-password menu is shown. | |
virtual void | enableProgPassword (bool enable) |
Enables/disables the programming-password menu. | |
virtual bool | talkaround () const |
Returns true if the talkaround menu is shown. | |
virtual void | enableTalkaround (bool enable) |
Enables/disables the talkaround menu. | |
virtual bool | tone () const |
Returns true if the tone menu is shown. | |
virtual void | enableTone (bool enable) |
Enables/disables the tone menu. | |
virtual bool | power () const |
Returns true if the power menu is shown. | |
virtual void | enablePower (bool enable) |
Enables/disables the power menu. | |
virtual bool | backlight () const |
Returns true if the backlight menu is shown. | |
virtual void | enableBacklight (bool enable) |
Enables/disables the backlight menu. | |
virtual bool | introScreen () const |
Returns true if the intro-screen menu is shown. | |
virtual void | enableIntroScreen (bool enable) |
Enables/disables the message menu. | |
virtual bool | keypadLock () const |
Returns true if the keypad-lock menu is shown. | |
virtual void | enableKeypadLock (bool enable) |
Enables/disables the keypad-lock menu. | |
virtual bool | ledIndicator () const |
Returns true if the LED-indicator menu is shown. | |
virtual void | enableLEDIndicator (bool enable) |
Enables/disables the LED-indicator menu. | |
virtual bool | squelch () const |
Returns true if the squelch menu is shown. | |
virtual void | enableSquelch (bool enable) |
Enables/disables the squelch menu. | |
virtual bool | privacy () const |
Returns true if the privacy menu is shown. | |
virtual void | enablePrivacy (bool enable) |
Enables/disables the privacy menu. | |
virtual bool | vox () const |
Returns true if the VOX menu is shown. | |
virtual void | enableVOX (bool enable) |
Enables/disables the VOX menu. | |
virtual bool | passwordLock () const |
Returns true if the password-lock menu is shown. | |
virtual void | enablePasswordLock (bool enable) |
Enables/disables the password-lock menu. | |
virtual bool | missedCalls () const |
Returns true if the missed-calls menu is shown. | |
virtual void | enableMissedCalls (bool enable) |
Enables/disables the missed-calls menu. | |
virtual bool | answeredCalls () const |
Returns true if the answered-calls menu is shown. | |
virtual void | enableAnsweredCalls (bool enable) |
Enables/disables the answered-calls menu. | |
virtual bool | outgoingCalls () const |
Returns true if the outgoing-calls menu is shown. | |
virtual void | enableOutgoingCalls (bool enable) |
Enables/disables the outgoing-calls menu. | |
virtual bool | channelDisplay () const |
Returns true if the channel display-mode menu is shown. | |
virtual void | enableChannelDisplay (bool enable) |
Enables/disables the channel display mode menu. | |
virtual bool | dualWatch () const |
Returns true if the dual-watch menu is shown. | |
virtual void | enableDualWatch (bool enable) |
Enables/disables the dual-watch menu. | |
virtual unsigned | keypadLockTime () const |
Returns the keypad lock time in seconds. | |
virtual void | setKeypadLockTime (unsigned sec) |
Sets the keypad lock time in seconds. | |
virtual unsigned | backlightTime () const |
Retunrns the backlight time in seconds. | |
virtual void | setBacklightTime (unsigned sec) |
Sets the backlight time in seconds. | |
virtual ChannelDisplayMode | channelDisplayMode () const |
Returns the channel display mode. | |
virtual void | setChannelDisplayMode (ChannelDisplayMode mode) |
Sets the channel display mode. | |
virtual bool | keyTone () const |
Returns true if the keytone is enabled. | |
virtual void | enableKeyTone (bool enable) |
Enables/disables the keytone. | |
virtual DualWatchMode | dualWatchMode () const |
Returns the dual-watch mode. | |
virtual void | setDualWatchMode (DualWatchMode mode) |
Sets the dual-watch mode. | |
Public Member Functions inherited from Codeplug::Element | |
Element (const Element &other) | |
Copy constructor. | |
virtual | ~Element () |
Destructor. | |
Element & | operator= (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 | |
MenuSettingsElement (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. | |
Implements the base class of menu settings for all Radioddity codeplugs.
Encoding of Menu settings (size 0x08b):
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 | Menu hang time in sec |RMO|RCK|MND|ECN|CAL|ESL|SCS|MSG|INS|BKL|PWR|TON|TLK|PRG|RDI|REN|ANC|MIC|PLK|VOX|PRV|SQL|LED|KPL| +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 04 | 1 1 1 0 0 |DBL|DSM|OTC| Unknown, set to 0xff |ChanDis| 0 0 |BKLTime|KeyLock|DblWait|KYT| 1 | 0 0 0 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ RMO = Remote monitor menu enable, RCK = Radio check menu enable, MND = Manual dial menu enable, ECN = Edit contact menu enable, CAL = Call alert menu enable, ESL = Edit scan list enable, SCS = Scan start enable, MSG = Message menu enable, INS = Intro screen menu enable, BKL = Backlight menu enable, PWR = Power setting enable, TON = Tone menu enable, TLK = Talkaround menu enable, PRG = Program-password menu enable, RDI = Radio-disable menu, REN = Radio-enable menu, ANC = Answered calls menu enable, MIC = Missed calls menu enable, PLK = Password and lock menu enable, VOX = VOX menu enable, PRV = Privacy menu enable, SQL = Squelch menu enable, LED = LED indicator menu enable, KPL = Keyboard lock menu enable, DBL = Double-wait menu enable, DSM = Display mode menu enable, OTC = Outgoing calls menu enable, BKLTime = Backlight time, DblWait = Double wait mode, KYT = Key tone enable,