libdrmconf  0.11.3
A library to program DMR radios.
Public Types | Public Member Functions | Protected Attributes | Properties | List of all members
DMRChannel Class Reference

Extension to the DigitalChannel class to implement an DMR channel. More...

#include <channel.hh>

Inheritance diagram for DMRChannel:
Inheritance graph
[legend]
Collaboration diagram for DMRChannel:
Collaboration graph
[legend]

Public Types

enum class  Admit { Always , Free , ColorCode }
 Possible admit criteria of digital channels. More...
 
enum class  TimeSlot { TS1 , TS2 }
 Possible timeslots for digital channels. More...
 
- Public Types inherited from Channel
enum class  Power {
  Max , High , Mid , Low ,
  Min
}
 Specifies the prefix for every ID assigned to every channel during serialization. More...
 

Public Member Functions

 DMRChannel (QObject *parent=nullptr)
 Constructs a new empty digital (DMR) channel.
 
 DMRChannel (const DMRChannel &other, QObject *parent=nullptr)
 Copy constructor.
 
ConfigItemclone () const
 Clones this item.
 
void clear ()
 Clears the config object.
 
Admit admit () const
 Returns the admit criterion for the channel.
 
void setAdmit (Admit admit)
 (Re-)Sets the admit criterion for the channel.
 
unsigned colorCode () const
 Returns the color code for the channel.
 
bool setColorCode (unsigned cc)
 (Re-)Sets the color code for the channel.
 
TimeSlot timeSlot () const
 Returns the time slot for the channel.
 
bool setTimeSlot (TimeSlot ts)
 (Re-)Sets the time slot for the channel.
 
const GroupListReferencegroupList () const
 Returns a reference to the group list.
 
GroupListReferencegroupList ()
 Returns a reference to the group list.
 
void setGroupList (GroupListReference *ref)
 Sets the reference to the group list.
 
RXGroupListgroupListObj () const
 Returns the RX group list for the channel.
 
bool setGroupListObj (RXGroupList *rxg)
 (Re-)Sets the RX group list for the channel.
 
const DMRContactReferencecontact () const
 Returns a reference to the transmit contact.
 
DMRContactReferencecontact ()
 Returns a reference to the transmit contact.
 
void setContact (DMRContactReference *ref)
 Sets the reference to the transmit contact.
 
DMRContacttxContactObj () const
 Returns the default TX contact to call on this channel.
 
bool setTXContactObj (DMRContact *c)
 (Re-) Sets the default TX contact for this channel.
 
const PositioningSystemReferenceaprs () const
 Returns a reference to the positioning system.
 
PositioningSystemReferenceaprs ()
 Returns a reference to the positioning system.
 
void setAPRS (PositioningSystemReference *ref)
 Sets the reference to the positioning system.
 
PositioningSystemaprsObj () const
 Returns the GPS system associated with this channel or nullptr if not set.
 
bool setAPRSObj (PositioningSystem *sys)
 Associates the GPS System with this channel.
 
const RoamingZoneReferenceroaming () const
 Returns a reference to the roaming zone.
 
RoamingZoneReferenceroaming ()
 Returns a reference to the roaming zone.
 
void setRoaming (RoamingZoneReference *ref)
 Sets the reference to the roaming zone.
 
RoamingZoneroamingZone () const
 Returns the roaming zone associated with this channel or nullptr if not set.
 
bool setRoamingZone (RoamingZone *zone)
 Associates the given roaming zone with this channel.
 
const DMRRadioIDReferenceradioId () const
 Returns the reference to the radio ID.
 
DMRRadioIDReferenceradioId ()
 Returns the reference to the radio ID.
 
void setRadioId (DMRRadioIDReference *ref)
 Sets the reference to the radio ID.
 
DMRRadioIDradioIdObj () const
 Returns the radio ID associated with this channel.
 
bool setRadioIdObj (DMRRadioID *id)
 Associates the given radio ID with this channel.
 
CommercialChannelExtensioncommercialExtension () const
 Returns the extension for commercial features.
 
void setCommercialExtension (CommercialChannelExtension *ext)
 Sets the commercial channel extension.
 
AnytoneDMRChannelExtensionanytoneChannelExtension () const
 Returns the DMR channel extension for AnyTone devices. More...
 
void setAnytoneChannelExtension (AnytoneDMRChannelExtension *ext)
 Sets the AnyTone DMR channel extension.
 
YAML::Node serialize (const Context &context, const ErrorStack &err=ErrorStack())
 Recursively serializes the configuration to YAML nodes. More...
 
- Public Member Functions inherited from DigitalChannel
 DigitalChannel (const DigitalChannel &other, QObject *parent=nullptr)
 Copy constructor.
 
- Public Member Functions inherited from Channel
bool copy (const ConfigItem &other)
 Copies the given item into this one. More...
 
double rxFrequency () const
 Returns the RX frequency of the channel in MHz.
 
bool setRXFrequency (double freq)
 (Re-)Sets the RX frequency of the channel in MHz.
 
double txFrequency () const
 Returns the TX frequency of the channel in MHz.
 
bool setTXFrequency (double freq)
 (Re-)Sets the TX frequency of the channel in MHz.
 
bool defaultPower () const
 Returns true if the channel uses the global default power setting.
 
Power power () const
 Returns the power setting of the channel if the channel does not use the default power.
 
void setPower (Power power)
 (Re-)Sets the power setting of the channel, overrides default power.
 
void setDefaultPower ()
 Sets the channel to use the default power setting.
 
bool defaultTimeout () const
 Returns true if the transmit timeout is specified by the global default value.
 
bool timeoutDisabled () const
 Returns true if the transmit timeout is disabled.
 
unsigned timeout () const
 Returns the TX timeout (TOT) in seconds.
 
bool setTimeout (unsigned dur)
 (Re-)Sets the TX timeout (TOT) in seconds.
 
void disableTimeout ()
 Disables the transmit timeout.
 
void setDefaultTimeout ()
 Sets the timeout to the global default timeout.
 
bool rxOnly () const
 Returns true, if the channel is RX only.
 
bool setRXOnly (bool enable)
 Set, whether the channel is RX only.
 
bool voxDisabled () const
 Returns true if the VOX is disabled.
 
bool defaultVOX () const
 Returns true if the VOX is specified by the global default value.
 
unsigned vox () const
 Returns the VOX level [0-10].
 
void setVOX (unsigned level)
 Sets the VOX level [0-10].
 
void setVOXDefault ()
 Sets the VOX level to the default value.
 
void disableVOX ()
 Disables the VOX.
 
const ScanListReferencescanListRef () const
 Returns the reference to the scan list.
 
ScanListReferencescanListRef ()
 Returns the reference to the scan list.
 
ScanListscanList () const
 Returns the default scan list for the channel.
 
bool setScanList (ScanList *list)
 (Re-) Sets the default scan list for the channel.
 
OpenGD77ChannelExtensionopenGD77ChannelExtension () const
 Returns the channel extension for the OpenGD77 firmware. More...
 
void setOpenGD77ChannelExtension (OpenGD77ChannelExtension *ext)
 Sets the OpenGD77 channel extension.
 
TyTChannelExtensiontytChannelExtension () const
 Returns the channel extension for TyT devices. More...
 
void setTyTChannelExtension (TyTChannelExtension *ext)
 Sets the TyT channel extension.
 
bool parse (const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
 Parses the given YAML node, updates the given object and updates the given context (IDs). More...
 
bool link (const YAML::Node &node, const Context &ctx, const ErrorStack &err=ErrorStack())
 Links the given object to the rest of the codeplug using the given context.
 
- Public Member Functions inherited from ConfigObject
virtual const QString & name () const
 Returns the name of the object.
 
virtual void setName (const QString &name)
 Sets the name of the object.
 
QString idPrefix () const
 Returns the ID prefix for this object.
 
bool label (Context &context, const ErrorStack &err=ErrorStack())
 Recursively labels the config object. More...
 
bool parse (const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
 Parses the given YAML node, updates the given object and updates the given context (IDs). More...
 
- Public Member Functions inherited from ConfigItem
virtual int compare (const ConfigItem &other) const
 Compares the items. More...
 
virtual ConfigItemallocateChild (QMetaProperty &prop, const YAML::Node &node, const Context &ctx, const ErrorStack &err=ErrorStack())
 Allocates an instance for the given property on the given YAML node. More...
 
virtual const Configconfig () const
 Returns the config, the item belongs to or nullptr if not part of a config.
 
virtual void findItemsOfTypes (const QStringList &typeNames, QSet< ConfigItem * > &items) const
 Searches the config tree to find all instances of the given type names.
 
template<class Object >
bool is () const
 Returns true if this object is of class Object.
 
template<class Object >
const Object * as () const
 Casts this object to the given type.
 
template<class Object >
Object * as ()
 Casts this object to the given type.
 
bool hasDescription () const
 Returns true if there is a class info "description" for this instance.
 
bool hasLongDescription () const
 Returns true if there is a class info "longDescription" for this instance.
 
bool hasDescription (const QMetaProperty &prop) const
 Returns true if there is a class info "[PropertyName]Description" for the given property.
 
bool hasLongDescription (const QMetaProperty &prop) const
 Returns true if there is a class info "[PropertyName]LongDescription" for the given property.
 
QString description () const
 Returns the description of this instance if set by a class info.
 
QString longDescription () const
 Returns the long description of this instance if set by a class info.
 
QString description (const QMetaProperty &prop) const
 Returns the description of property if set by a class info.
 
QString longDescription (const QMetaProperty &prop) const
 Returns the long description of property if set by a class info.
 

Protected Attributes

Admit _admit
 The admit criterion.
 
unsigned _colorCode
 The channel color code.
 
TimeSlot _timeSlot
 The time slot for the channel.
 
GroupListReference _rxGroup
 The RX group list for this channel.
 
DMRContactReference _txContact
 The default TX contact.
 
PositioningSystemReference _posSystem
 The GPS system.
 
RoamingZoneReference _roaming
 Roaming zone for the channel.
 
DMRRadioIDReference _radioId
 Radio ID to use on this channel.
 
CommercialChannelExtension_commercialExtension
 Owns the commercial channel extension.
 
AnytoneDMRChannelExtension_anytoneExtension
 Owns the AnyTone DMR channel extension.
 
- Protected Attributes inherited from Channel
double _rxFreq
 The RX frequency in MHz.
 
double _txFreq
 The TX frequency in MHz.
 
bool _defaultPower
 If true, the channel uses the global power setting.
 
Power _power
 The transmit power setting.
 
unsigned _txTimeOut
 Transmit timeout in seconds.
 
bool _rxOnly
 RX only flag.
 
unsigned _vox
 Holds the VOX level.
 
ScanListReference _scanlist
 Default scan list of the channel.
 
OpenGD77ChannelExtension_openGD77ChannelExtension
 Owns the OpenGD77 channel extension object.
 
TyTChannelExtension_tytChannelExtension
 Owns the TyT channel extension object.
 
- Protected Attributes inherited from ConfigObject
QString _name
 Holds the name of the object.
 

Properties

Admit admit
 The admit criterion of the channel.
 
unsigned colorCode
 The color code of the channel.
 
TimeSlot timeSlot
 The time slot of the channel.
 
DMRRadioIDReferenceradioId
 The radio ID.
 
GroupListReferencegroupList
 The rx group list.
 
DMRContactReferencecontact
 The tx contact.
 
PositioningSystemReferenceaprs
 The positioning system.
 
RoamingZoneReferenceroaming
 The roaming zone.
 
CommercialChannelExtensioncommercial
 The commercial channel extension.
 
AnytoneDMRChannelExtensionanytone
 The AnyTone DMR channel extension.
 
- Properties inherited from Channel
double rxFrequency
 The receive frequency of the channel.
 
double txFrequency
 The transmit frequency of the channel.
 
Power power
 The transmit power.
 
unsigned timeout
 The transmit timeout in seconds.
 
bool rxOnly
 If true, the channel is receive only.
 
ScanListReferencescanListRef
 The scan list.
 
unsigned vox
 The VOX setting.
 
OpenGD77ChannelExtensionopenGD77
 The OpenGD77 channel extension.
 
TyTChannelExtensiontyt
 The TyT channel extension.
 
- Properties inherited from ConfigObject
QString name
 The name of the object.
 

Additional Inherited Members

- Signals inherited from ConfigItem
void modified (ConfigItem *obj)
 Gets emitted once the config object is modified. More...
 
void beginClear ()
 Gets emitted before clearing the item.
 
void endClear ()
 Gets emitted after clearing the item.
 
- Protected Slots inherited from Channel
void onReferenceModified ()
 Gets called whenever a referenced object is changed or deleted.
 
- Protected Member Functions inherited from DigitalChannel
 DigitalChannel (QObject *parent=nullptr)
 Hidden constructor.
 
- Protected Member Functions inherited from Channel
 Channel (QObject *parent=nullptr)
 Hidden constructor. More...
 
 Channel (const Channel &other, QObject *parent=nullptr)
 Copy constructor.
 
bool populate (YAML::Node &node, const Context &context, const ErrorStack &err=ErrorStack())
 Recursively serializes the configuration to YAML nodes. More...
 
- Protected Member Functions inherited from ConfigObject
 ConfigObject (QObject *parent=nullptr)
 Specifies the prefix for every ID assigned to every object during serialization. More...
 
 ConfigObject (const QString &name, QObject *parent=nullptr)
 Hidden constructor. More...
 
- Protected Member Functions inherited from ConfigItem
 ConfigItem (QObject *parent=nullptr)
 Hidden constructor. More...
 
- Static Protected Member Functions inherited from ConfigObject
static QString findIdPrefix (const QMetaObject *meta)
 Helper to find the IdPrefix class info in the class hierarchy.
 

Detailed Description

Extension to the DigitalChannel class to implement an DMR channel.

That is, the admit criterion, color code, time slot, RX group list and TX contact.

Member Enumeration Documentation

◆ Admit

enum DMRChannel::Admit
strong

Possible admit criteria of digital channels.

Enumerator
Always 

No admit criteria, allows one to transmit any time.

Free 

Transmit only if channel is free.

ColorCode 

Transmit only if channel is free and matches given color code.

◆ TimeSlot

enum DMRChannel::TimeSlot
strong

Possible timeslots for digital channels.

Enumerator
TS1 

Time/repeater slot 1.

TS2 

Time/repeater slot 2.

Member Function Documentation

◆ anytoneChannelExtension()

AnytoneDMRChannelExtension * DMRChannel::anytoneChannelExtension ( ) const

Returns the DMR channel extension for AnyTone devices.

If this extension is not set, returns nullptr.

◆ serialize()

YAML::Node DMRChannel::serialize ( const Context context,
const ErrorStack err = ErrorStack() 
)
virtual

Recursively serializes the configuration to YAML nodes.

The complete configuration must be labeled first.

Reimplemented from ConfigItem.


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