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

Base class for all call-sign DBs of TyT/Retevis devices. More...

#include <tyt_callsigndb.hh>

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

Classes

class  EntryElement
 Represents an entry within the call-sign database. More...
 
class  IndexElement
 Represents a search index over the complete call-sign database. More...
 

Public Member Functions

virtual ~TyTCallsignDB ()
 Destructor.
 
bool encode (UserDatabase *db, const Selection &selection, const ErrorStack &err=ErrorStack())
 Encodes the given user db into the device specific callsign db.
 
- Public Member Functions inherited from CallsignDB
virtual ~CallsignDB ()
 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

 TyTCallsignDB (QObject *parent=nullptr)
 Hidden constructor. More...
 
virtual void allocate (unsigned n)
 Allocates required space for index and n call-signs.
 
virtual void clearIndex ()
 Clears the call-sign DB index.
 
virtual void setNumEntries (unsigned n)
 Sets the number of entries in the DB.
 
virtual void setIndexEntry (unsigned n, unsigned id, unsigned index)
 Sets the given index entry.
 
virtual void setEntry (unsigned n, const UserDatabase::User &user)
 Sets a given call-sign entry.
 
- Protected Member Functions inherited from CallsignDB
 CallsignDB (QObject *parent=nullptr)
 Hidden constructor.
 

Additional Inherited Members

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

Detailed Description

Base class for all call-sign DBs of TyT/Retevis devices.

Callsign database structure

Start End Size Content
Callsign database 0x0200000-0x1000000
0x200000 0x204004 0x04004 Callsign database index table, see TyTCallsignDB::IndexEntryElement
0x204004 0xffffdc 0xdfbfd8 max 122197 callsign database entries, see TyTCallsignDB::EntryElement.
0xffffdc 0x1000000 0x00025 Padding, filled with 0xff.

Constructor & Destructor Documentation

◆ TyTCallsignDB()

TyTCallsignDB::TyTCallsignDB ( QObject *  parent = nullptr)
explicitprotected

Hidden constructor.

Use one of the device specific call-sign DB classes.


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