libdrmconf
0.9.0
A library to program DMR radios.
|
Represents the boot-time settings (selected zone and channels) within the code-plug. More...
#include <tyt_codeplug.hh>
Public Member Functions | |
BootSettingsElement (uint8_t *ptr) | |
Constructor. | |
virtual | ~BootSettingsElement () |
Destructor. | |
void | clear () |
Abstract method to reset the element within the codeplug. More... | |
virtual uint | zoneIndex () const |
Returns the boot zone index. | |
virtual void | setZoneIndex (uint idx) |
Sets the boot zone index. | |
virtual uint | channelIndexA () const |
Returns the channel index (within zone) for VFO A. | |
virtual void | setChannelIndexA (uint idx) |
Sets the channel index (within zone) for VFO A. | |
virtual uint | channelIndexB () const |
Returns the channel index (within zone) for VFO B. | |
virtual void | setChannelIndexB (uint idx) |
Sets the channel index (within zone) for VFO B. | |
![]() | |
Element (const Element &other) | |
Copy constructor. | |
virtual | ~Element () |
Destructor. | |
virtual bool | isValid () const |
Returns true if the pointer is not null. | |
bool | getBit (uint offset, uint bit) const |
Reads a specific bit at the given byte-offset. | |
void | setBit (uint offset, uint bit, bool value=true) |
Sets a specific bit at the given byte-offset. | |
void | clearBit (uint offset, uint bit) |
Clears a specific bit at the given byte-offset. | |
uint8_t | getUInt2 (uint offset, uint bit) const |
Reads a 2bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt2 (uint offset, uint bit, uint8_t value) |
Stores a 2bit unsinged integer at the given byte- and bit-offset. | |
uint8_t | getUInt3 (uint offset, uint bit) const |
Reads a 3bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt3 (uint offset, uint bit, uint8_t value) |
Stores a 3bit unsinged integer at the given byte- and bit-offset. | |
uint8_t | getUInt4 (uint offset, uint bit) const |
Reads a 4bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt4 (uint offset, uint bit, uint8_t value) |
Stores a 4bit unsinged integer at the given byte- and bit-offset. | |
uint8_t | getUInt5 (uint offset, uint bit) const |
Reads a 5bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt5 (uint offset, uint bit, uint8_t value) |
Stores a 5bit iunsinged nteger at the given byte- and bit-offset. | |
uint8_t | getUInt6 (uint offset, uint bit) const |
Reads a 6bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt6 (uint offset, uint bit, uint8_t value) |
Stores a 6bit unsinged integer at the given byte- and bit-offset. | |
uint8_t | getUInt8 (uint offset) const |
Reads a 8bit unsinged integer at the given byte- and bit-offset. | |
void | setUInt8 (uint offset, uint8_t value) |
Reads a 8bit unsinged integer at the given byte- and bit-offset. | |
int8_t | getInt8 (uint offset) const |
Reads a 8bit signed integer at the given byte- and bit-offset. | |
void | setInt8 (uint offset, int8_t value) |
Reads a 8bit signed integer at the given byte- and bit-offset. | |
uint16_t | getUInt16_be (uint offset) const |
Reads a 16bit big-endian unsinged integer at the given byte-offset. | |
uint16_t | getUInt16_le (uint offset) const |
Reads a 16bit little-endian unsinged integer at the given byte-offset. | |
void | setUInt16_be (uint offset, uint16_t value) |
Stores a 16bit big-endian unsinged integer at the given byte-offset. | |
void | setUInt16_le (uint offset, uint16_t value) |
Stores a 16bit little-endian unsinged integer at the given byte-offset. | |
uint32_t | getUInt24_be (uint offset) const |
Reads a 24bit big-endian unsinged integer at the given byte-offset. | |
uint32_t | getUInt24_le (uint offset) const |
Reads a 24bit little-endian unsinged integer at the given byte-offset. | |
void | setUInt24_be (uint offset, uint32_t value) |
Stores a 24bit big-endian unsinged integer at the given byte-offset. | |
void | setUInt24_le (uint offset, uint32_t value) |
Stores a 24bit little-endian unsinged integer at the given byte-offset. | |
uint32_t | getUInt32_be (uint offset) const |
Reads a 32bit big-endian unsinged integer at the given byte-offset. | |
uint32_t | getUInt32_le (uint offset) const |
Reads a 32bit little-endian unsinged integer at the given byte-offset. | |
void | setUInt32_be (uint offset, uint32_t value) |
Stores a 32bit big-endian unsinged integer at the given byte-offset. | |
void | setUInt32_le (uint offset, uint32_t value) |
Stores a 32bit little-endian unsinged integer at the given byte-offset. | |
uint8_t | getBCD2 (uint offset) const |
Reads a 2-digit (1-byte/8bit) BDC value in big-endian at the given byte-offset. | |
void | setBCD2 (uint 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 (uint offset) const |
Reads a 4-digit (2-byte/16bit) BDC value in big-endian at the given byte-offset. | |
void | setBCD4_be (uint 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 (uint offset) const |
Reads a 4-digit (2-byte/16bit) BDC value in little-endian at the given byte-offset. | |
void | setBCD4_le (uint 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 (uint offset) const |
Reads a 8-digit (4-byte/32bit) BDC value in big-endian at the given byte-offset. | |
void | setBCD8_be (uint 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 (uint offset) const |
Reads a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset. | |
void | setBCD8_le (uint offset, uint32_t value) |
Stores a 8-digit (4-byte/32bit) BDC value in little-endian at the given byte-offset. | |
QString | readASCII (uint offset, uint maxlen, uint8_t eos=0x00) const |
Reads upto maxlen ASCII chars at the given byte-offset using eos as the string termination char. | |
void | writeASCII (uint offset, const QString &txt, uint maxlen, uint8_t eos=0x00) |
Stores upto maxlen ASCII chars at the given byte-offset using eos as the string termination char. More... | |
QString | readUnicode (uint offset, uint maxlen, uint16_t eos=0x0000) const |
Reads upto maxlen unicode chars at the given byte-offset using eos as the string termination char. | |
void | writeUnicode (uint offset, const QString &txt, uint maxlen, uint16_t eos=0x0000) |
Stores upto maxlen unicode chars at the given byte-offset using eos as the string termination char. More... | |
Protected Member Functions | |
BootSettingsElement (uint8_t *ptr, size_t size) | |
Hidden constructor. | |
![]() | |
Element (uint8_t *ptr, size_t size) | |
Hidden constructor. More... | |
Additional Inherited Members | |
![]() | |
uint8_t * | _data |
Holds the pointer to the element. | |
size_t | _size |
Holds the size of the element. | |
Represents the boot-time settings (selected zone and channels) within the code-plug.
Memory layout of encoded boot 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 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 00 | Unused, set to 0xffffff | Boot zone index +1 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 04 | Boot CH A index +1 (in zone) | Unused, set to 0xff | Boot CH B index +1 (in zone) | Unused set to 0xffff ... +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 08 ... | Unknown index, set to 0x0001, little endian | Unused filled with 0xff ... +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 0c ... | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|
virtual |
Abstract method to reset the element within the codeplug.
Any device specific element should implement this method.
Reimplemented from Codeplug::Element.