|
libdrmconf
0.12.0
A library to program DMR radios.
|
Represents the base class of an digital alarm setting for all AnyTone codeplugs. More...
#include <anytone_codeplug.hh>


Public Types | |
| enum class | Action { None = 0 , Background = 1 , NonLocal = 2 , Local = 3 } |
| Possible alarm types. More... | |
Public Member Functions | |
| DigitalAlarm (uint8_t *ptr) | |
| Constructor. | |
| void | clear () |
| Resets the digital alarm settings. | |
| virtual Action | action () const |
| Returns the alarm action. | |
| virtual void | setAction (Action action) |
| Sets the alarm action. | |
| virtual unsigned | duration () const |
| Returns the alarm duration in seconds. | |
| virtual void | setDuration (unsigned sec) |
| Sets the alarm duration in seconds. | |
| virtual unsigned | txDuration () const |
| Returns the TX duration in seconds. | |
| virtual void | setTXDuration (unsigned sec) |
| Sets the TX duration in seconds. | |
| virtual unsigned | rxDuration () const |
| Returns the RX duration in seconds. | |
| virtual void | setRXDuration (unsigned sec) |
| Sets the RX duration in seconds. | |
| virtual bool | channelIsSelected () const |
Returns true if the alarm channel is the selected channel. | |
| virtual unsigned | channelIndex () const |
| Returns the channel index. | |
| virtual void | setChannelIndex (unsigned idx) |
| Sets the channel index. | |
| virtual void | setChannelSelected () |
| Sets the alarm channel to the selected channel. | |
| virtual bool | repeatContinuously () const |
Returns true if the alarm is repeated continuously. | |
| virtual unsigned | repetitions () const |
| Returns the number of alarm repetitions. | |
| virtual void | setRepetitions (unsigned num) |
| Sets the number of alarm repetitions. | |
| virtual void | setRepatContinuously () |
| Sets the alarm to be repeated continuously. | |
| virtual unsigned | voiceBroadcastDuration () const |
| Returns voice broadcast duration in minutes. | |
| virtual void | setVoiceBroadcastDuration (unsigned min) |
| Sets voice broadcast duration in minutes. | |
| virtual unsigned | areaBroadcastDuration () const |
| Returns area broadcast duration in minutes. | |
| virtual void | setAreaBroadcastDuration (unsigned min) |
| Sets area broadcast duration in minutes. | |
| virtual bool | vox () const |
Returns true if the VOX gets enabled. | |
| virtual void | enableVOX (bool enable) |
| Enables/disables the VOX for alarms. | |
| virtual bool | rxAlarm () const |
Returns true if alarms gets received enabled. | |
| virtual void | enableRXAlarm (bool enable) |
| Enables/disables the reception of alarms. | |
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... | |
Static Public Member Functions | |
| static constexpr unsigned int | size () |
| Returns the size of the element. | |
Protected Member Functions | |
| DigitalAlarm (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. | |
Represents the base class of an digital alarm setting for all AnyTone codeplugs.
Memory representation of a digital alarm setting (size 0x000c 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 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 00 | Action, 0=none | Alarm duration in seconds | TX duration in seconds | RX duration in seconds | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 04 | Channel index, 0-based, little endian | Channel select 1=current | Alarm repeat 0=continuous | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 08 | Voice switch BC dur in min+1 | Area switch BC dur in min+1 | VOX enable | RX alarm enable | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ Field details: - Action: Specifies the alarm action. 0=none, 1=TX and background, 2=TX and non-local alarm, 3=TX and local alarm - Channel select: If 0 use specified channel index else current channel. - Alarm repeat: Number of alarm repetitions, 0=continuous. - Voice switch broadcast duration: Specifies the time in minutes +1. That is 0=1min, 1=2min, ... - Area switch broadcast duration: Specifies the time in minutes +1. That is 0=1min, 1=2min, ...