libdrmconf 0.14.1
A library to program DMR radios.
Loading...
Searching...
No Matches
DM32UVCodeplug::ChannelElement Class Reference

Implements encoding channel for the binary codeplug. More...

#include <dm32uv_codeplug.hh>

Inheritance diagram for DM32UVCodeplug::ChannelElement:
Collaboration diagram for DM32UVCodeplug::ChannelElement:

Classes

struct  Limit
 Some limits. More...
struct  Offset
 Some internal offsets. More...

Public Types

enum class  ChannelType { FM = 0 , DMR = 1 , FMFixed = 2 , DMRFixed = 3 }
 Possible channel types.
enum class  Power { Low = 0 , Medium = 1 , High = 2 }
 Possible power settings.
enum class  Admit { Always = 0 , ChannelFree = 1 , ToneOrCCMatch = 2 , ToneMismatch = 3 }
 Possible admit criteria.

Public Member Functions

 ChannelElement (uint8_t *ptr)
 Constructor.
virtual QString name () const
 Returns the channel name.
virtual void setName (const QString &name)
 Sets the channel name.
virtual Frequency rxFrequency () const
 Returns the RX frequency.
virtual void setRXFrequency (const Frequency &freq)
 Set RX frequency.
virtual bool validTXFrequency () const
 Returns true, if a valid TX frequency is stored.
virtual Frequency txFrequency () const
 Returns the TX frequency.
virtual void setTXFrequency (const Frequency &freq)
 Set TX frequency.
virtual void clearTXFrequency ()
 Invalidates the TX frequency.
virtual ChannelType channelType () const
 Returns the channel type.
virtual void setChannelType (ChannelType type)
 Sets the channel type.
virtual Channel::Power power () const
 Returns the channel power setting.
virtual void setPower (Channel::Power power)
 Sets the channel power.
virtual bool loneWorkerEnabled () const
 Returns true, if the lone-worker feature is enabled.
virtual void enableLoneWorker (bool enable)
 Enables/disables lone worker feature.
virtual FMChannel::Bandwidth bandwidth () const
 Returns the bandwidth for FM channels.
virtual void setBandwidth (FMChannel::Bandwidth bw)
 Sets the FM channel bandwidth.
virtual bool validScanListIndex () const
 Returns true, if the scan list index is set.
virtual unsigned int scanListIndex () const
 Returns the 0-based scan list index.
virtual void setScanListIndex (unsigned int idx)
 Sets the scan list index.
virtual void clearScanListIndex ()
 Invalidates the scan list index.
virtual bool talkaroundEnabled () const
 Returns true if talkaround is enabled on this channel.
virtual void enableTalkaround (bool enable)
 Enables/disables talkaround feature on this channel.
virtual Admit admitCriterion () const
 Returns the admit criterion.
virtual void setAdmitCriterion (Admit admit)
 Sets the admit criterion.
virtual bool rxDMRAPRSEnabled () const
 Returns true if DMR APRS reception is enabled.
virtual void enableRXDMRAPRS (bool enable)
 Enables/disables DMR APRS reception.
virtual bool emergencyNotificationEnabled () const
 Retruns true, if the emergency notification is enabled.
virtual void enableEmergencyNotification (bool enable)
 Enables/disables emergency notification.
virtual bool emergencyACKEnabled () const
 Retruns true, if the emergency ACK is enabled.
virtual void enableEmergencyACK (bool enable)
 Enables/disables emergency notification.
virtual bool validEmergencySystemIndex () const
 Returns true if the emergency system index is set.
virtual unsigned int emergencySystemIndex () const
 Returns the emergency system index.
virtual void setEmergencySystemIndex (unsigned int idx)
 Sets the emergency system index.
virtual void clearEmergencySystemIndex ()
 Invalidates the emergency system index.
virtual Level squelchLevel () const
 Returns FM and DMR squelch level.
virtual void setSquelchLevel (Level level)
 Sets the FM and DMR squelch level.
virtual bool rxOnlyEnabled () const
 Returns true if the channel is RX only.
virtual void enableRXOnly (bool enable)
 Enables RX only for the channel.
virtual bool dmrAPRSEnabled () const
 Returns true if DMR APRS is enabled.
virtual void enableDMRAPRS (bool enable)
 Enables DMR APRS for the channel.
virtual bool privateCallACKEnabled () const
 Return true if private calls are confirmed.
virtual void enablePrivateCallACK (bool enable)
 Enables confirmation of private calls.
virtual bool dataACKEnabled () const
 Return true if data is confirmed.
virtual void enableDataACK (bool enable)
 Enables confirmation of data.
virtual bool dcdmEnabled () const
 Return true if DCDM (dual capacity direct mode) is enabled.
virtual void enableDCDM (bool enable)
 Enables DCDM (dual capacity direct mode).
virtual DMRChannel::TimeSlot timeslot () const
 Returns the timeslot of the channel.
virtual void setTimeslot (DMRChannel::TimeSlot ts)
 Sets the timeslot of the channel.
virtual unsigned int colorCode () const
 Returns the color code of the channel.
virtual void setColorCode (unsigned int cc)
 Sets the color code of the channel.
virtual bool encryptionEnabled () const
 Returns true if encryption is enabled.
virtual void enableEncryption (bool enable)
virtual bool validGroupListIndex () const
 Returns true if group list index is valid.
virtual unsigned int groupListIndex () const
 Get group list index.
virtual void setGroupListIndex (unsigned int idx)
 Set group list index.
virtual void clearGroupListIndex ()
 Invalidates group list index.
virtual unsigned int dmrAPRSChannelIndex () const
 Returns DMR APRS report channel index.
virtual void setDMRAPRSChannelIndex (unsigned int idx)
 Sets the DMR APRS report channel index.
virtual SelectiveCall rxTone () const
 Returns the RX tone.
virtual void setRXTone (const SelectiveCall &tone)
 Sets the RX tone.
virtual SelectiveCall txTone () const
 Returns the TX tone.
virtual void setTXTone (const SelectiveCall &tone)
 Sets the TX tone.
virtual bool voxEnabled () const
 Returns true, if the VOX is enabled.
virtual void enableVOX (bool enable)
 Enables the VOX.
virtual unsigned int dmrIdIndex () const
 Returns the DMR radio id index.
virtual void setDMRIdIndex (unsigned int id)
 Sets the dmr ID index.
virtual Channeldecode (Context &ctx, const ErrorStack &err=ErrorStack()) const
 Constructs a channel object.
virtual bool link (Channel *channel, Context &ctx, const ErrorStack &err=ErrorStack()) const
 Links the channel object.
virtual bool encode (const Channel *channel, Context &ctx, const ErrorStack &err=ErrorStack())
 Encodes a channel.
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.
virtual void clear ()
 Abstract method to reset the element within the codeplug.
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::Bit &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::Bit &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.
void clearBit (const Offset::Bit &offset)
 Clears a specific bit.
uint8_t getUInt2 (const Offset::Bit &offset) const
 Reads a 2bit unsigned integer at the given bit-offset.
uint8_t getUInt2 (unsigned offset, unsigned bit) const
 Reads a 2bit unsigned integer at the given byte- and bit-offset.
void setUInt2 (const Offset::Bit &offset, uint8_t value)
 Stores a 2bit unsigned integer at the given 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 (const Offset::Bit &offset) const
 Reads a 3bit unsigned integer at the given bit-offset.
uint8_t getUInt3 (unsigned offset, unsigned bit) const
 Reads a 3bit unsigned integer at the given byte- and bit-offset.
void setUInt3 (const Offset::Bit &offset, uint8_t value)
 Stores a 3bit unsigned integer at the given 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 (const Offset::Bit &offset) const
 Reads a 4bit unsigned integer at the given bit-offset.
uint8_t getUInt4 (unsigned offset, unsigned bit) const
 Reads a 4bit unsigned integer at the given byte- and bit-offset.
void setUInt4 (const Offset::Bit &offset, uint8_t value)
 Stores a 4bit unsigned integer at the given 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 (const Offset::Bit &offset) const
 Reads a 5bit 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 (const Offset::Bit &offset, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
void setUInt5 (unsigned offset, unsigned bit, uint8_t value)
 Stores a 5bit unsigned integer at the given byte- and bit-offset.
uint8_t getUInt6 (const Offset::Bit &offset) const
 Reads a 6bit unsigned integer 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 (const Offset::Bit &offset, uint8_t value)
 Stores 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.
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.

Static Public Member Functions

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

Protected Member Functions

 ChannelElement (uint8_t *ptr, size_t size)
 Hidden constructor.
Protected Member Functions inherited from Codeplug::Element
 Element (uint8_t *ptr, size_t size)
 Hidden constructor.

Static Protected Member Functions

static SelectiveCall decodeSelectiveCall (uint16_t code)
 Helper function to decode selective call.
static uint16_t encodeSelectiveCall (const SelectiveCall &tone)
 Helper function to encode selective call.

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 encoding channel for the binary codeplug.

Member Function Documentation

◆ enableDCDM()

void DM32UVCodeplug::ChannelElement::enableDCDM ( bool enable)
virtual

Enables DCDM (dual capacity direct mode).


The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv_codeplug.hh
  • /builddir/build/BUILD/qdmr-0.14.1-build/qdmr-0.14.1/lib/dm32uv_codeplug.cc