libdrmconf
0.12.0
A library to program DMR radios.
|
Extends the TyTCodeplug::ChannelElement
for the TyT MD-UV390 and Retevis RT3S.
More...
#include <uv390_codeplug.hh>
Public Member Functions | |
ChannelElement (uint8_t *ptr) | |
Constructs a channel from the given memory. | |
void | clear () |
Clears/resets the channel and therefore disables it. | |
virtual TyTChannelExtension::InCallCriterion | inCallCriteria () const |
Returns the in-call criterion for this channel. | |
virtual void | setInCallCriteria (TyTChannelExtension::InCallCriterion crit) |
Sets the in-call criterion for this channel. | |
virtual TyTChannelExtension::KillTone | turnOffFreq () const |
Returns the remote turn-off/kill frequency for this channel. | |
virtual void | setTurnOffFreq (TyTChannelExtension::KillTone freq) |
Sets the remote turn-off/kill frequency for this channel. | |
virtual unsigned | squelch () const |
Returns the squelch level [0-10]. | |
virtual void | setSquelch (unsigned value) |
Sets the squelch level [0-10]. | |
virtual Channel::Power | power () const |
Returns the power of this channel. | |
virtual void | setPower (Channel::Power pwr) |
Sets the power of this channel. | |
virtual bool | allowInterrupt () const |
Returns true if the channel allows interruption enabled. | |
virtual void | enableAllowInterrupt (bool enable) |
Enables/disables interruption for this channel. | |
virtual bool | dualCapacityDirectMode () const |
Returns true if the channel has dual-capacity direct mode enabled. | |
virtual void | enableDualCapacityDirectMode (bool enable) |
Enables/disables dual-capacity direct mode for this channel. | |
virtual bool | dcdmLeader () const |
Returns true if the radio acts as the leader for this DCDM channel. | |
virtual void | enableDCDMLeader (bool enable) |
Enables/disables this radio to be the leader for this DCDM channel. | |
virtual Channel * | toChannelObj (const ErrorStack &err=ErrorStack()) const |
Constructs a generic Channel object from the codeplug channel. | |
virtual void | fromChannelObj (const Channel *c, Context &ctx) |
Initializes this codeplug channel from the given generic configuration. | |
Public Member Functions inherited from TyTCodeplug::ChannelElement | |
ChannelElement (uint8_t *ptr) | |
Constructs a channel from the given memory. | |
virtual | ~ChannelElement () |
Destructor. | |
bool | isValid () const |
Returns true if channel is valid/enabled. | |
virtual Mode | mode () const |
Returns the mode of the channel. | |
virtual void | setMode (Mode setMode) |
Sets the mode of the channel. | |
virtual FMChannel::Bandwidth | bandwidth () const |
Returns the bandwidth of the (analog) channel. | |
virtual void | setBandwidth (FMChannel::Bandwidth bw) |
Sets the bandwidth of the (analog) channel. | |
virtual bool | autoScan () const |
Returns true if the channel has auto scan enabled. | |
virtual void | enableAutoScan (bool enable) |
Enables/disables auto scan for this channel. | |
virtual bool | loneWorker () const |
Returns true if the channel has lone worker enabled. | |
virtual void | enableLoneWorker (bool enable) |
Enables/disables lone worker for this channel. | |
virtual bool | talkaround () const |
Returns true if the channel has talkaround enabled. | |
virtual void | enableTalkaround (bool enable) |
Enables/disables talkaround for this channel. | |
virtual bool | rxOnly () const |
Returns true if the channel has rx only enabled. | |
virtual void | enableRXOnly (bool enable) |
Enables/disables rx only for this channel. | |
virtual DMRChannel::TimeSlot | timeSlot () const |
Returns the time slot of this channel. | |
virtual void | setTimeSlot (DMRChannel::TimeSlot ts) |
Sets the time slot of this channel. | |
virtual uint8_t | colorCode () const |
Returns the color code of this channel. | |
virtual void | setColorCode (uint8_t ts) |
Sets the color code of this channel. | |
virtual uint8_t | privacyIndex () const |
Returns the index of the privacy system (key). | |
virtual void | setPrivacyIndex (uint8_t ts) |
Sets the index of the privacy system (key). | |
virtual PrivacyType | privacyType () const |
Returns the type of the privacy system. | |
virtual void | setPrivacyType (PrivacyType type) |
Sets the type of the privacy system. | |
virtual bool | privateCallConfirm () const |
Returns true if the channel has private call confirmation enabled. | |
virtual void | enablePrivateCallConfirm (bool enable) |
Enables/disables private call confirmation for this channel. | |
virtual bool | dataCallConfirm () const |
Returns true if the channel has data call confirmation enabled. | |
virtual void | enableDataCallConfirm (bool enable) |
Enables/disables data call confirmation for this channel. | |
virtual TyTChannelExtension::RefFrequency | rxRefFrequency () const |
Returns some weird reference frequency setting for reception. | |
virtual void | setRXRefFrequency (TyTChannelExtension::RefFrequency ref) |
Sets some weird reference frequency setting for reception. | |
virtual TyTChannelExtension::RefFrequency | txRefFrequency () const |
Returns some weird reference frequency setting for transmission. | |
virtual void | setTXRefFrequency (TyTChannelExtension::RefFrequency ref) |
Sets some weird reference frequency setting for transmission. | |
virtual bool | emergencyAlarmACK () const |
Returns true if the channel has alarm confirmation enabled. | |
virtual void | enableEmergencyAlarmACK (bool enable) |
Enables/disables alarm confirmation for this channel. | |
virtual bool | displayPTTId () const |
Returns true if the channel has display PTT ID enabled. | |
virtual void | enableDisplayPTTId (bool enable) |
Enables/disables PTT ID display for this channel. | |
virtual bool | vox () const |
Returns true if the channel has VOX enabled. | |
virtual void | enableVOX (bool enable) |
Enables/disables VOX for this channel. | |
virtual Admit | admitCriterion () const |
Returns the admit criterion for this channel. | |
virtual void | setAdmitCriterion (Admit admit) |
Sets the admit criterion for this channel. | |
virtual uint16_t | contactIndex () const |
Returns the transmit contact index (+1) for this channel. | |
virtual void | setContactIndex (uint16_t idx) |
Sets the transmit contact index (+1) for this channel. | |
virtual unsigned | txTimeOut () const |
Returns the transmit time-out in seconds. | |
virtual void | setTXTimeOut (unsigned tot) |
Sets the transmit time-out in seconds. | |
virtual uint8_t | txTimeOutRekeyDelay () const |
Returns the transmit time-out re-key delay in seconds. | |
virtual void | setTXTimeOutRekeyDelay (uint8_t delay) |
Sets the transmit time-out re-key delay in seconds. | |
virtual uint8_t | emergencySystemIndex () const |
Returns the emergency system index (+1) for this channel. | |
virtual void | setEmergencySystemIndex (uint8_t idx) |
Sets the emergency system index (+1) for this channel. | |
virtual uint8_t | scanListIndex () const |
Returns the scan-list index (+1) for this channel. | |
virtual void | setScanListIndex (uint8_t idx) |
Sets the scan-list index (+1) for this channel. | |
virtual uint8_t | groupListIndex () const |
Returns the RX group list index (+1) for this channel. | |
virtual void | setGroupListIndex (uint8_t idx) |
Sets the RX group list index (+1) for this channel. | |
virtual uint8_t | positioningSystemIndex () const |
Returns the positioning system index (+1) for this channel. | |
virtual void | setPositioningSystemIndex (uint8_t idx) |
Sets the positioning system index (+1) for this channel. | |
virtual bool | dtmfDecode (uint8_t idx) const |
Returns true if the channel has DTMF decoding enabled. | |
virtual void | setDTMFDecode (uint8_t idx, bool enable) |
Enables/disables DTMF decoding this channel. | |
virtual uint32_t | rxFrequency () const |
Returns the RX frequency in Hz. | |
virtual void | setRXFrequency (uint32_t Hz) |
Sets the RX frequency in Hz. | |
virtual uint32_t | txFrequency () const |
Returns the TX frequency in Hz. | |
virtual void | setTXFrequency (uint32_t Hz) |
Sets the TX frequency in Hz. | |
virtual Signaling::Code | rxSignaling () const |
Returns the CTCSS/DSC signaling for RX. | |
virtual void | setRXSignaling (Signaling::Code code) |
Sets the CTCSS/DSC signaling for RX. | |
virtual Signaling::Code | txSignaling () const |
Returns the CTCSS/DSC signaling for TX. | |
virtual void | setTXSignaling (Signaling::Code code) |
Sets the CTCSS/DSC signaling for TX. | |
virtual uint8_t | rxSignalingSystemIndex () const |
Returns the signaling system index (+1) for RX. | |
virtual void | setRXSignalingSystemIndex (uint8_t idx) |
Sets the signaling system index (+1) for RX. | |
virtual uint8_t | txSignalingSystemIndex () const |
Returns the signaling system index (+1) for TX. | |
virtual void | setTXSignalingSystemIndex (uint8_t idx) |
Sets the signaling system index (+1) for TX. | |
virtual bool | txGPSInfo () const |
Returns true if the channel transmits GPS information enabled. | |
virtual void | enableTXGPSInfo (bool enable) |
Enables/disables transmission of GPS information for this channel. | |
virtual bool | rxGPSInfo () const |
Returns true if the channel receives GPS information enabled. | |
virtual void | enableRXGPSInfo (bool enable) |
Enables/disables reception of GPS information for this channel. | |
virtual QString | name () const |
Returns the name of this channel. | |
virtual void | setName (const QString &setName) |
Sets the name of this channel. | |
virtual bool | linkChannelObj (Channel *c, Context &ctx, const ErrorStack &err=ErrorStack()) const |
Links a previously constructed channel to the rest of the configuration. | |
Public Member Functions inherited from Codeplug::Element | |
Element (const Element &other) | |
Copy constructor. | |
virtual | ~Element () |
Destructor. | |
Element & | operator= (const Element &other) |
Copy assignment. | |
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 | |
ChannelElement (uint8_t *ptr, size_t size) | |
Constructs a channel from the given memory. | |
Protected Member Functions inherited from TyTCodeplug::ChannelElement | |
ChannelElement (uint8_t *ptr, size_t size) | |
Constructs a channel from the given memory. | |
Protected Member Functions inherited from Codeplug::Element | |
Element (uint8_t *ptr, size_t size) | |
Hidden constructor. More... | |
Additional Inherited Members | |
Public Types inherited from TyTCodeplug::ChannelElement | |
enum | Mode { MODE_ANALOG = 1 , MODE_DIGITAL = 2 } |
Possible modes for the channel, i.e. More... | |
enum | Bandwidth { BW_12_5_KHZ = 0 , BW_20_KHZ = 1 , BW_25_KHZ = 2 } |
Bandwidth of the channel. More... | |
enum | PrivacyType { PRIV_NONE = 0 , PRIV_BASIC = 1 , PRIV_ENHANCED = 2 } |
Possible privacy types. More... | |
enum | Admit { ADMIT_ALWAYS = 0 , ADMIT_CH_FREE = 1 , ADMIT_TONE = 2 , ADMIT_COLOR = 3 } |
TX Admit criterion. More... | |
Protected Attributes inherited from Codeplug::Element | |
uint8_t * | _data |
Holds the pointer to the element. | |
size_t | _size |
Holds the size of the element. | |
Extends the TyTCodeplug::ChannelElement
for the TyT MD-UV390 and Retevis RT3S.
Memory layout of encoded channel:
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 |LWK| 1 1 |ASC| BandW | ChMod | ColorCode |TimeSlt|RXO|ALT|DCC|PCC| PRIV | PrivIdx |DPD| 0 |EAA| 1 1 0 |RXFreqR| +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 04 |AdimtCr| 1 |VOX| 0 1 |TXFreqR|TOffFre|InCallC| 0 0 0 0 | TX Contact name index + 1, little endian | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 08 | 0 0 | Tx Timeout | Tx Timeout Rekey Delay | Emergency System index + 1 | Scan List index + 1 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 0c | RX Group List index + 1 | GPS System index +1 | DTMF decode bitmap | Squelch [0..9] | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 10 | RX Frequency, 8 digits BCD, little endian | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 14 | TX Frequency, 8 digits BCD, little endian | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 18 | RX CTCSS/DCS | TX CTCSS/DCS | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 1c | RX Signaling System index +1 | TX Signaling System index +1 | 1 1 1 1 1 1 | Power | 1 1 1 |LMS|DCD|ALI|RXG|TXG| +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 20 | Name 16 x 16bit unicode characters / Stepsize (byte 0x20) ... +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 3c ... | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ Field description: LWK = Lone Worker, default=0. ASC = Auto scan, default=0. BandW = Bandwidth, 0=12.5kHz, 1=20kHz or 2=25kHz, default = 0. ChMod = Channel Mode, 1=Analog or 2=Digital, default=1. ColorCode = ColorCode [0..15], default=1. TimeSlt = Repeater/time-slot, 2=TS2, 1=TS1, default=1. RXO = RX Only, 0=off, 1=on, default=0. ALT = Allow Talkaround (inverted), default=1 (off). DCC = Data Call Confirmed, default=0; PCC = Private Call Confirmed, default=0. PRIV = Privacy type, 0=None, 1=Basic or 2=Enhanced, default=0 (basic). PrivIdx = Privacy Index, [0,15], default=0. DPD = Display PTT ID (inverted), default = 1. EAA = Emergency Alarm Ack, default = 0. RXFreqR = RX reference frequency, 0=Low, 1=Medium, 2=High, default=0 (low). AdimtCr = Admit Criterion, 0=Always, 1=Channel Free or 2=Correct CTS/DCS, 3=Colorcode, default=0. VOX = VOX Enable, 0=Disable, 1=Enable, default = 0; TXFreqR = TX reference frequency: 0=Low, 1=Medium, 2=High, default=0. TOffFre = Non-QT/DQT Turn-off Freq., 3=none, 0=259.2Hz, 1=55.2Hz, default=3. InCallC = In Call Criteria, 0=Always, 1=Follow Admit Criteria, 2=TX Interrupt, default=0. Tx Timeout = Tx Timeout x 15sec, 0-Infinite, 1=15s, etc, 37=555s, default=0. Power = Power, 0=low, 1=middle, 2=high, default=high. LMS = Leader/MS: Leader or MS, default=1. DCD = DCDM switch (inverted), default=1. ALI = Allow interrupt (inverted), 0=allow, 1=Disabled, default=1. RXG = Receive GSP info (inverted), default=1. TXG = Send GSP info (inverted), default=1.