1#ifndef OPENGD77BASECALLSIGNDB_HH
2#define OPENGD77BASECALLSIGNDB_HH
5#include "callsigndb.hh"
6#include "userdatabase.hh"
55 static constexpr unsigned int size() {
return 0x000f; }
57 void clear()
override;
60 virtual void setId(
unsigned int id);
62 virtual void setText(
const QString &text);
69 QByteArray
pack(
const QString &text);
73 struct Limit:
public Element::Limit {
75 static constexpr unsigned int textLength() {
return 16; }
80 struct Offset:
public Element::Offset {
82 static constexpr unsigned int dmrID() {
return 0x0000; }
83 static constexpr unsigned int text() {
return 0x0003; }
87 static QVector<QChar> _lut;
110 static constexpr unsigned int size() {
return 0x000c; }
114 void setEntrySize(
unsigned int size);
115 void setEntryCount(
unsigned int count);
119 struct Limit:
public Element::Limit {
127 static constexpr unsigned int magic() {
return 0x0000; }
128 static constexpr unsigned int format() {
return 0x0002; }
129 static constexpr unsigned int entrySize() {
return 0x0003; }
130 static constexpr unsigned int version() {
return 0x0004; }
131 static constexpr unsigned int entryCount() {
return 0x0008; }
151 static constexpr unsigned int blockSize() {
return 32; }
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
CallsignDB(QObject *parent=nullptr)
Hidden constructor.
Definition callsigndb.cc:45
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:65
uint32_t size() const
Returns the total size of the DFU file.
Definition dfufile.cc:52
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
virtual bool fromEntry(const UserDatabase::User &user)
Encodes the given user.
Definition opengd77base_callsigndb.cc:51
virtual void setText(const QString &text)
Encodes the text.
Definition opengd77base_callsigndb.cc:44
QByteArray pack(const QString &text)
Encodes and packs the given string.
Definition opengd77base_callsigndb.cc:70
DatabaseEntryElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition opengd77base_callsigndb.cc:21
virtual void setId(unsigned int id)
Encodes the DMR ID.
Definition opengd77base_callsigndb.cc:39
static constexpr unsigned int size()
The size of the entry.
Definition opengd77base_callsigndb.hh:55
void clear() override
Abstract method to reset the element within the codeplug.
Definition opengd77base_callsigndb.cc:34
virtual ~OpenGD77BaseCallsignDB()
Destructor.
Definition opengd77base_callsigndb.cc:148
virtual bool encode(UserDatabase *calldb, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())=0
Encodes as many entries as possible of the given user-database.
OpenGD77BaseCallsignDB(QObject *parent=nullptr)
Constructor.
Definition opengd77base_callsigndb.cc:142
Represents the user information within the UserDatabase.
Definition userdatabase.hh:32
Auto-updating DMR user database.
Definition userdatabase.hh:24
Some limits.
Definition opengd77base_callsigndb.hh:73
Internal offsets within entry.
Definition opengd77base_callsigndb.hh:80
Some limits for this callsign DB.
Definition opengd77base_callsigndb.hh:149
static constexpr unsigned int blockSize()
Maximum block size.
Definition opengd77base_callsigndb.hh:151
void clear()
Resets the entry.
void fromEntry(const UserDatabase::User &user)
Encodes the given user.
void setName(const QString &name)
Sets the name of the entry, 15b max.
uint32_t number
DMR ID stored in BCD little-endian.
Definition opengd77base_callsigndb.hh:17
QString getName() const
Returns the name of the entry.
uint32_t getNumber() const
Returns the DMR ID number.
userdb_entry_t()
Constructor.
void setNumber(uint32_t number)
Sets the DMR ID number.
char name[15]
Call or name, up to 15 ASCII chars, 0x00 padded.
Definition opengd77base_callsigndb.hh:18