libdrmconf  0.11.3
A library to program DMR radios.
Classes | Public Member Functions | Protected Member Functions | List of all members
TyTCodeplug Class Referenceabstract

Base class of all TyT codeplugs. More...

#include <tyt_codeplug.hh>

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

Classes

class  ButtonSettingsElement
 Represents all button settings within the codeplug on the radio. More...
 
class  ChannelElement
 Represents a single channel (analog or digital) within the TyT codeplug. More...
 
class  ContactElement
 Represents a digital (DMR) contact within the codeplug. More...
 
class  EmergencySettingsElement
 Represents the emergency settings within the codeplug on the radio. More...
 
class  EmergencySystemElement
 Represents a single emergency system within the radio. More...
 
class  EncryptionElement
 Represents all encryption keys and settings within the codeplug on the device. More...
 
class  GeneralSettingsElement
 Codeplug representation of the general settings. More...
 
class  GPSSystemElement
 Represents a single GPS system within the codeplug. More...
 
class  GroupListElement
 Representation of an RX group list within the codeplug. More...
 
class  MenuSettingsElement
 Represents all menu settings within the codeplug on the radio. More...
 
class  OneTouchSettingElement
 Represents a single one-touch setting within the codeplug on the radio. More...
 
class  ScanListElement
 Represents a scan list within the codeplug. More...
 
class  TimestampElement
 Codeplug representation of programming time-stamp and CPS version. More...
 
class  ZoneElement
 Represents a zone within the codeplug. More...
 

Public Member Functions

virtual ~TyTCodeplug ()
 Destructor.
 
virtual void clear ()
 Clears and resets the complete codeplug to some default values.
 
bool index (Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const
 Indexes all elements of the codeplug. More...
 
bool decode (Config *config, const ErrorStack &err=ErrorStack())
 Decodes the binary codeplug and stores its content in the given generic configuration.
 
bool encode (Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack())
 Encodes the given generic configuration as a binary codeplug.
 
virtual bool decodeElements (Context &ctx, const ErrorStack &err=ErrorStack())
 Decodes the binary codeplug and stores its content in the given generic configuration using the given context.
 
virtual bool encodeElements (const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
 Encodes the given generic configuration as a binary codeplug using the given context.
 
virtual void clearTimestamp ()=0
 Clears the time-stamp in the codeplug.
 
virtual bool encodeTimestamp ()=0
 Sets the time-stamp.
 
virtual void clearGeneralSettings ()=0
 Clears the general settings in the codeplug.
 
virtual bool encodeGeneralSettings (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Updates the general settings from the given configuration.
 
virtual bool decodeGeneralSettings (Config *config, const ErrorStack &err=ErrorStack())=0
 Updates the given configuration from the general settings.
 
virtual void clearContacts ()=0
 Clears all contacts in the codeplug.
 
virtual bool encodeContacts (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all digital contacts in the configuration into the codeplug.
 
virtual bool createContacts (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a digital contact to the configuration for each one in the codeplug.
 
virtual void clearGroupLists ()=0
 Clears all RX group lists in the codeplug.
 
virtual bool encodeGroupLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all group lists in the configuration into the codeplug.
 
virtual bool createGroupLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a RX group list to the configuration for each one in the codeplug.
 
virtual bool linkGroupLists (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Links all added RX group lists within the configuration.
 
virtual void clearChannels ()=0
 Clears all channels in the codeplug.
 
virtual bool encodeChannels (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all channels in the configuration into the codeplug.
 
virtual bool createChannels (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a channel to the configuration for each one in the codeplug.
 
virtual bool linkChannels (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Links all added channels within the configuration.
 
virtual void clearZones ()=0
 Clears all zones in the codeplug.
 
virtual bool encodeZones (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all zones in the configuration into the codeplug.
 
virtual bool createZones (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a zone to the configuration for each one in the codeplug.
 
virtual bool linkZones (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Links all added zones within the configuration.
 
virtual void clearScanLists ()=0
 Clears all scan lists in the codeplug.
 
virtual bool encodeScanLists (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all scan lists in the configuration into the codeplug.
 
virtual bool createScanLists (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a scan list to the configuration for each one in the codeplug.
 
virtual bool linkScanLists (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Links all added scan lists within the configuration.
 
virtual void clearPositioningSystems ()=0
 Clears all positioning systems in the codeplug.
 
virtual bool encodePositioningSystems (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes all DMR positioning systems in the configuration into the codeplug.
 
virtual bool createPositioningSystems (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Adds a GPS positioning system to the configuration for each one in the codeplug.
 
virtual bool linkPositioningSystems (Context &ctx, const ErrorStack &err=ErrorStack())=0
 Links all added positioning systems within the configuration.
 
virtual void clearButtonSettings ()=0
 Clears the button settings in the codeplug.
 
virtual bool encodeButtonSettings (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes the button settings.
 
virtual bool decodeButtonSetttings (Config *config, const ErrorStack &err=ErrorStack())=0
 Decodes the button settings.
 
virtual void clearPrivacyKeys ()=0
 Clears all encryption keys in the codeplug.
 
virtual bool encodePrivacyKeys (Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Encodes the encryption keys.
 
virtual bool decodePrivacyKeys (Config *config, Context &ctx, const ErrorStack &err=ErrorStack())=0
 Decodes the encryption keys.
 
virtual void clearMenuSettings ()=0
 Clears the menu settings in the codeplug.
 
virtual void clearTextMessages ()=0
 Clears all text messages in the codeplug.
 
virtual void clearEmergencySystems ()=0
 Clears all emergency systems in the codeplug.
 
- Public Member Functions inherited from Codeplug
virtual ~Codeplug ()
 Destructor.
 
- Public Member Functions inherited from DFUFile
 DFUFile (QObject *parent=nullptr)
 Constructs an empty DFU file object.
 
uint32_t size () const
 Returns the total size of the DFU file.
 
uint32_t memSize () const
 Returns the total memory size stored in the DFU file.
 
int numImages () const
 Returns the number of images within the DFU file.
 
const Imageimage (int i) const
 Returns a reference to the i-th image of the file.
 
Imageimage (int i)
 Returns a reference to the i-th image of the file.
 
void addImage (const QString &name, uint8_t altSettings=1)
 Adds a new image to the file.
 
void addImage (const Image &img)
 Adds an image to the file.
 
void remImage (int i)
 Deletes the i-th image from the file.
 
bool isAligned (unsigned blocksize) const
 Checks if all image addresses and sizes is aligned with the given block size.
 
bool read (const QString &filename, const ErrorStack &err=ErrorStack())
 Reads the specified DFU file. More...
 
bool read (QFile &file, const ErrorStack &err=ErrorStack())
 Reads the specified DFU file. More...
 
bool write (const QString &filename, const ErrorStack &err=ErrorStack())
 Writes to the specified file. More...
 
bool write (QFile &file, const ErrorStack &err=ErrorStack())
 Writes to the specified file. More...
 
void dump (QTextStream &stream) const
 Dumps a text representation of the DFU file structure to the specified text stream.
 
virtual bool isAllocated (uint32_t offset, uint32_t img=0) const
 Returns true if the specified address (and image) is allocated.
 
virtual unsigned char * data (uint32_t offset, uint32_t img=0)
 Returns a pointer to the encoded raw data at the specified offset.
 
virtual const unsigned char * data (uint32_t offset, uint32_t img=0) const
 Returns a const pointer to the encoded raw data at the specified offset.
 

Protected Member Functions

 TyTCodeplug (QObject *parent=nullptr)
 Empty constructor.
 
- Protected Member Functions inherited from Codeplug
 Codeplug (QObject *parent=nullptr)
 Hidden default constructor.
 

Additional Inherited Members

- Protected Attributes inherited from DFUFile
QVector< Image_images
 The list of images.
 

Detailed Description

Base class of all TyT codeplugs.

This class implements the majority of all codeplug elements present in all TyT codeplugs. This eases the support of several TyT radios, as only the differences in the codeplug to this base class must be implemented.

Member Function Documentation

◆ index()

bool TyTCodeplug::index ( Config config,
Context ctx,
const ErrorStack err = ErrorStack() 
) const
virtual

Indexes all elements of the codeplug.

This method must be implemented by any device or vendor specific codeplug to map config objects to indices used within the binary codeplug to address each element (e.g., channels, contacts etc.).

Implements Codeplug.


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