LibDMRConf  0.5.2
A library to program DMR radios.
Public Types | Public Member Functions | Public Attributes | List of all members
D878UVCodeplug::channel_t Struct Reference

Represents the actual channel encoded within the binary code-plug. More...

#include <d878uv_codeplug.hh>

Public Types

enum  Mode { MODE_ANALOG = 0, MODE_DIGITAL = 1, MODE_MIXED_A_D = 2, MODE_MIXED_D_A = 3 }
 Defines all possible channel modes, see channel_mode. More...
 
enum  Power { POWER_LOW = 0, POWER_MIDDLE = 1, POWER_HIGH = 2, POWER_TURBO = 3 }
 Defines all possible power settings. More...
 
enum  Bandwidth { BW_12_5_KHZ = 0, BW_25_KHZ = 1 }
 Defines all band-width settings for analog channel. More...
 
enum  RepeaterMode { RM_SIMPLEX = 0, RM_TXPOS = 1, RM_TXNEG = 2 }
 Defines all possible repeater modes. More...
 
enum  PTTId { PTTID_OFF = 0, PTTID_START = 1, PTTID_END = 2, PTTID_START_END = 3 }
 Defines all possible PTT-ID settings. More...
 
enum  SquelchMode { SQ_CARRIER = 0, SQ_TONE = 1 }
 Defines all possible squelch settings. More...
 
enum  Admit { ADMIT_ALWAYS = 0, ADMIT_CH_FREE = 1, ADMIT_CC_DIFF = 2, ADMIT_CC_SAME = 3 }
 Defines all possible admit criteria. More...
 
enum  OptSignaling { OPTSIG_OFF = 0, OPTSIG_DTMF = 1, OPTSIG_2TONE = 2, OPTSIG_5TONE = 3 }
 Defines all possible optional signalling settings. More...
 
enum  APRSReport { APRS_REPORT_OFF = 0, APRS_REPORT_ANALOG = 1, APRS_REPORT_DIGITAL = 2 }
 Defines all possible APRS reporting modes. More...
 

Public Member Functions

 channel_t ()
 Constructor, also clears the struct.
 
void clear ()
 Clears and invalidates the channel.
 
bool isValid () const
 Returns true if the channel is valid.
 
double getRXFrequency () const
 Returns the RX frequency in MHz.
 
void setRXFrequency (double f)
 Sets the RX frequency in MHz.
 
double getTXFrequency () const
 Returns the TX frequency in MHz.
 
void setTXFrequency (double f)
 Sets the TX frequency in MHz. More...
 
QString getName () const
 Returns the name of the radio.
 
void setName (const QString &name)
 Sets the name of the radio.
 
Signaling::Code getRXTone () const
 Returns the RX CTCSS/DCS tone.
 
void setRXTone (Signaling::Code code)
 Sets the RX CTCSS/DCS tone.
 
Signaling::Code getTXTone () const
 Returns the TX CTCSS/DCS tone.
 
void setTXTone (Signaling::Code code)
 Sets the TX CTCSS/DCS tone.
 
ChanneltoChannelObj () const
 Constructs a generic Channel object from the codeplug channel.
 
bool linkChannelObj (Channel *c, const CodeplugContext &ctx) const
 Links a previously constructed channel to the rest of the configuration.
 
void fromChannelObj (const Channel *c, const Config *conf)
 Initializes this codeplug channel from the given generic configuration.
 

Public Attributes

uint32_t rx_frequency
 RX Frequency, 8 digits BCD, big-endian.
 
uint32_t tx_offset
 TX Offset, 8 digits BCD, big-endian, sign in repeater_mode.
 
uint8_t channel_mode: 2
 Mode: Analog or Digital.
 
uint8_t power: 2
 Power: Low, Middle, High, Turbo.
 
uint8_t bandwidth: 1
 Bandwidth: 12.5 or 25 kHz.
 
uint8_t _unused8: 1
 Unused, set to 0.
 
uint8_t repeater_mode: 2
 Sign of TX frequency offset.
 
uint8_t rx_ctcss: 1
 CTCSS decode enable.
 
uint8_t rx_dcs: 1
 DCS decode enable.
 
uint8_t tx_ctcss: 1
 CTCSS encode enable.
 
uint8_t tx_dcs: 1
 DCS encode enable.
 
uint8_t reverse: 1
 CTCSS phase-reversal.
 
uint8_t rx_only: 1
 TX prohibit.
 
uint8_t call_confirm: 1
 Call confirmation enable.
 
uint8_t talkaround: 1
 Talk-around enable.
 
uint8_t ctcss_transmit
 TX CTCSS tone, 0=62.5, 50=254.1, 51=custom CTCSS tone.
 
uint8_t ctcss_receive
 RX CTCSS tone: 0=62.5, 50=254.1, 51=custom CTCSS tone.
 
uint16_t dcs_transmit
 TX DCS code: 0=D000N, 511=D777N, 512=D000I, 1023=D777I, DCS code-number in octal, little-endian.
 
uint16_t dcs_receive
 RX DCS code: 0=D000N, 511=D777N, 512=D000I, 1023=D777I, DCS code-number in octal, little-endian.
 
uint16_t custom_ctcss
 Custom CTCSS tone frequency: 0x09cf=251.1, 0x0a28=260, big-endian?.
 
uint8_t tone2_decode
 2-Tone decode: 0x00=1, 0x0f=16
 
uint8_t _unused19
 Unused, set to 0.
 
uint32_t contact_index
 Contact index, zero-based, little-endian.
 
uint8_t id_index
 Index to radio-ID table.
 
uint8_t ptt_id: 2
 PTT ID, see PTTId.
 
uint8_t _unused25_1: 2
 Unused, set to 0.
 
uint8_t squelch_mode: 1
 Squelch mode, see SquelchMode.
 
uint8_t _unused25_2: 3
 Unused, set to 0.
 
uint8_t tx_permit: 2
 TX permit, see Admin.
 
uint8_t _unused26_1: 2
 Unused, set to 0.
 
uint8_t opt_signal: 2
 Optional signaling, see OptSignaling.
 
uint8_t _unused26_2: 2
 Unused, set to 0.
 
uint8_t scan_list_index
 Scan list index, 0xff=None, 0-based.
 
uint8_t group_list_index
 RX group-list, 0xff=None, 0-based.
 
uint8_t id_2tone
 2-Tone ID, 0=1, 0x17=24.
 
uint8_t id_5tone
 5-Tone ID, 0=1, 0x63=100.
 
uint8_t id_dtmf
 DTMF ID, 0=1, 0x0f=16.
 
uint8_t color_code
 Color code, 0-15.
 
uint8_t slot2: 1
 Timeslot, 0=TS1, 1=TS2.
 
uint8_t _unused33_1: 1
 Unused, set to 0.
 
uint8_t simplex_tdma: 1
 Simplex TDMA enabled.
 
uint8_t _unused33_2: 1
 Unused, set to 0.
 
uint8_t tdma_adaptive: 1
 TDMA adaptive enable.
 
uint8_t rx_gps: 1
 Receive digital GPS messages.
 
uint8_t enh_encryption: 1
 Enable enhanced encryption.
 
uint8_t work_alone: 1
 Work alone, 0=off, 1=on.
 
uint8_t encryption
 Digital encryption, 1-32, 0=off.
 
uint8_t name [16]
 Channel name, ASCII, zero filled.
 
uint8_t _unused51
 Unused, set to 0.
 
uint8_t ranging: 1
 Ranging enabled.
 
uint8_t through_mode: 1
 Through-mode enabled.
 
uint8_t excl_from_roaming: 1
 Exclude channel from roaming.
 
uint8_t _unused52: 5
 Unused, set to 0.
 
uint8_t aprs_report: 2
 Enable APRS report.
 
uint8_t _unused53: 6
 Unused, set to 0.
 
uint8_t analog_aprs_ptt
 Enable analog APRS PTT, 0=off, 1=start of transmission, 2=end of transmission.
 
uint8_t digi_aprs_ptt
 Enable digital APRS PTT, 0=off, 1=on.
 
uint8_t gps_system
 Index of DMR GPS report system, 0-7;.
 
uint8_t _unused57 [7]
 Unused, set to 0.ยด
 

Detailed Description

Represents the actual channel encoded within the binary code-plug.

Memmory layout of encoded channel (64byte):

     0                               8                               16                              24
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
00 | RX Frequency 32bit BCD encoded in little-endian as MMMkkkhh                                                                   |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
04 | Tx Frequency Offset 32bit BCD encoded in little-endian as MMMkkkhh                                                            |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
08 | RMode | 0 |BWd|  PWR  | CMode |TAr|CaC|RXO|CTR|TDC|TCT|RDC|RCT| CTCSS transmit                | CTCSS receive                 |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0c | DCS transmit                                                  | DCS receive                                                   |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
10 | Custom CTCSS                                                  | 2-tone decode                 | Unused, set to 0x00           |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
14 | Contact index 0-based, little endian                          | Unused, set to 0x0000                                         |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
18 | Radio ID table index.         | 0   0   0 |SQM| 0   0 |PTT-ID | 0   0 |OptSig | 0   0 | TxPer | Scan list index               |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
1c | RX Group list index           | 2-tone ID                     | 5-tone ID                     | DTMF ID                       |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
20 | Color code                    |LWK|EEE|RGP|EAT| 0 |EST| 0 |TSL| Encryption key                | Name 16 x ASCII 0-padded   ...
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
30  ...                                                                                            | Unused set to 0x00            |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
34 | 0   0   0   0   0 |XFR|ETM|RNG| 0   0   0   0   0   0 |APRSRep| Unused, set to 0x00           | Unused, set to 0x00           |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
38 | GPS System Index              | 7 bytes unused set to 0                                                                    ...
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
3c  ...                                                                                                                            |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

with
RMode = Repater mode, BWd = Band width, PWR = Power, CMode = Channel mode, TAr=Talkaround, CaC = Call confirm, RXO = RX only,
CTR = CTCSS phase reversal, TDC = TX DCS code, TCT = TX CTCSS tone, RDC = RX DCS code, RCT = RX CTCSS tone, SQM = Squelch mode,
OptSig = Optional signalling, TxPer = TX permit, LWK = Lone worker, EEE = Enable enhanced encryption, RGP = Enable RX GPS,
EAT = Enable adative TDMA, EST = Enable simplex TDMA, TSL = Time slot, XFR = Exlcude from roaming, ETM = Enable through mode,
RNG = Ranging, APRSRep = Enable APRS/GPS report.

Member Enumeration Documentation

◆ Admit

Defines all possible admit criteria.

Enumerator
ADMIT_ALWAYS 

Admit TX always.

ADMIT_CH_FREE 

Admit TX on channel free.

ADMIT_CC_DIFF 

Admit TX on mismatching color-code.

ADMIT_CC_SAME 

Admit TX on matching color-code.

◆ APRSReport

Defines all possible APRS reporting modes.

Enumerator
APRS_REPORT_OFF 

No APRS (GPS) reporting at all.

APRS_REPORT_ANALOG 

Use analog, actual APRS reporting.

APRS_REPORT_DIGITAL 

Use digital reporting.

◆ Bandwidth

Defines all band-width settings for analog channel.

Enumerator
BW_12_5_KHZ 

Narrow band-width (12.5kHz).

BW_25_KHZ 

High band-width (25kHz).

◆ Mode

Defines all possible channel modes, see channel_mode.

Enumerator
MODE_ANALOG 

Analog channel.

MODE_DIGITAL 

Digital (DMR) channel.

MODE_MIXED_A_D 

Mixed, transmit analog and receive digital.

MODE_MIXED_D_A 

Mixed, transmit digital and receive analog.

◆ OptSignaling

Defines all possible optional signalling settings.

Enumerator
OPTSIG_OFF 

None.

OPTSIG_DTMF 

Use DTMF.

OPTSIG_2TONE 

Use 2-tone.

OPTSIG_5TONE 

Use 5-tone.

◆ Power

Defines all possible power settings.

Enumerator
POWER_LOW 

Low power, usually 1W.

POWER_MIDDLE 

Medium power, usually 2.5W.

POWER_HIGH 

High power, usually 5W.

POWER_TURBO 

Higher power, usually 7W on VHF and 6W on UHF.

◆ PTTId

Defines all possible PTT-ID settings.

Enumerator
PTTID_OFF 

Never send PTT-ID.

PTTID_START 

Send PTT-ID at start.

PTTID_END 

Send PTT-ID at end.

PTTID_START_END 

Send PTT-ID at start and end.

◆ RepeaterMode

Defines all possible repeater modes.

Enumerator
RM_SIMPLEX 

Simplex mode, that is TX frequency = RX frequency. tx_offset is ignored.

RM_TXPOS 

Repeater mode with positive tx_offset.

RM_TXNEG 

Repeater mode with negative tx_offset.

◆ SquelchMode

Defines all possible squelch settings.

Enumerator
SQ_CARRIER 

Open squelch on carrier.

SQ_TONE 

Open squelch on matching CTCSS tone or DCS code.

Member Function Documentation

◆ setTXFrequency()

void D878UVCodeplug::channel_t::setTXFrequency ( double  f)

Sets the TX frequency in MHz.

Note
As the TX frequency is stored as difference to the RX frequency, the RX frequency should be set first.

The documentation for this struct was generated from the following files: