1#ifndef D868UVCALLSIGNDB_HH
2#define D868UVCALLSIGNDB_HH
4#include "callsigndb.hh"
5#include "userdatabase.hh"
6#include "d868uv_codeplug.hh"
48 Private = 0, Group = 1, All = 2
70 virtual void setContent(
const QString &name,
const QString &city,
const QString &call,
71 const QString &state,
const QString &country,
const QString &comment);
84 static constexpr unsigned int nameLength() {
return 16; }
85 static constexpr unsigned int cityLength() {
return 15; }
101 static constexpr unsigned int callType() {
return 0x0000; }
102 static constexpr unsigned int number() {
return 0x0001; }
103 static constexpr Bit friendFlag() {
return {0x0005, 4}; }
104 static constexpr Bit ringTone() {
return { 0x0005, 0}; }
123 static constexpr unsigned int size() {
return 0x000186a0; }
128 uint8_t *
entry(
unsigned int i)
const;
148 static constexpr unsigned int size() {
return 0x0001f400; }
153 uint8_t *
entry(
unsigned int i)
const;
169 static constexpr unsigned int size() {
return 0x0010; }
175 virtual unsigned count()
const;
180 virtual unsigned endOfDB()
const;
190 static constexpr unsigned int count() {
return 0x0000; }
191 static constexpr unsigned int endOfDB() {
return 0x0004; }
209 static constexpr unsigned int entries() {
return 200000; }
216 static constexpr unsigned int index() {
return 0x04000000; }
217 static constexpr unsigned int betweenIndexBanks() {
return 0x00040000; }
218 static constexpr unsigned int callsigns() {
return 0x04500000; }
219 static constexpr unsigned int betweenCallsignBanks() {
return 0x00040000; }
220 static constexpr unsigned int limits() {
return 0x044C0000; }
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
EntryBankElement(uint8_t *ptr)
Constructor.
void clear()
Abstract method to reset the element within the codeplug.
EntryBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
static constexpr unsigned int size()
The size of the element.
Definition d868uv_callsigndb.hh:123
uint8_t * entry(unsigned int i) const
Returns the i-th element of the bank.
virtual void setNumber(unsigned num)
Sets the DMR ID number.
Definition d868uv_callsigndb.cc:39
EntryElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition d868uv_callsigndb.cc:11
virtual void setRingTone(RingTone tone)
Sets the ring tone.
Definition d868uv_callsigndb.cc:49
CallType
Possible call types.
Definition d868uv_callsigndb.hh:47
virtual void setCallType(DMRContact::Type type)
Sets the call type.
Definition d868uv_callsigndb.cc:30
virtual void setContent(const QString &name, const QString &city, const QString &call, const QString &state, const QString &country, const QString &comment)
Sets the entry content.
Definition d868uv_callsigndb.cc:54
virtual void setFriendFlag(bool set)
Set/clear friend flag.
Definition d868uv_callsigndb.cc:44
RingTone
Notification tones for callsign entry.
Definition d868uv_callsigndb.hh:41
virtual unsigned fromUser(const UserDatabase::User &user)
Constructs a database entry from the given user.
Definition d868uv_callsigndb.cc:68
void clear()
Abstract method to reset the element within the codeplug.
Definition d868uv_callsigndb.cc:24
IndexBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
uint8_t * entry(unsigned int i) const
Returns the i-th element of the bank.
void clear()
Abstract method to reset the element within the codeplug.
static constexpr unsigned int size()
The size of the element.
Definition d868uv_callsigndb.hh:148
IndexBankElement(uint8_t *ptr)
Constructor.
virtual void setCount(unsigned count)
Sets the number of entries.
Definition d868uv_callsigndb.cc:116
virtual void setTotalSize(unsigned size)
Sets the total size of the DB (updated end-of-db address).
Definition d868uv_callsigndb.cc:129
virtual unsigned endOfDB() const
Returns the end-of-db address.
Definition d868uv_callsigndb.cc:121
void clear()
Resets the limits.
Definition d868uv_callsigndb.cc:106
static constexpr unsigned int size()
Size of the element.
Definition d868uv_callsigndb.hh:169
virtual void setEndOfDB(unsigned addr)
Sets the end-of-db address.
Definition d868uv_callsigndb.cc:125
virtual unsigned count() const
Returns the number of entries in the DB.
Definition d868uv_callsigndb.cc:112
LimitsElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition d868uv_callsigndb.cc:93
D868UVCodeplug::ContactMapElement IndexEntryElement
Same index entry used by the codeplug to map normal digital contacts to an contact index.
Definition d868uv_callsigndb.hh:134
D868UVCallsignDB(QObject *parent=nullptr)
Constructor, does not allocate any memory yet.
Definition d868uv_callsigndb.cc:137
bool encode(UserDatabase *db, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())
Tries to encode as many entries of the given user-database.
Definition d868uv_callsigndb.cc:144
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
Represents the user information within the UserDatabase.
Definition userdatabase.hh:32
Auto-updating DMR user database.
Definition userdatabase.hh:24
Some limits for the entry.
Definition d868uv_callsigndb.hh:82
static constexpr unsigned int headerLength()
Header length (fixed).
Definition d868uv_callsigndb.hh:83
static constexpr unsigned int countryLength()
Maximum country length.
Definition d868uv_callsigndb.hh:88
static constexpr unsigned int cityLength()
Maximum city length.
Definition d868uv_callsigndb.hh:85
static constexpr unsigned int stateLength()
Maximum state length.
Definition d868uv_callsigndb.hh:87
static constexpr unsigned int commentLength()
Maximum comment length.
Definition d868uv_callsigndb.hh:89
static constexpr unsigned int callLength()
Maximum call length.
Definition d868uv_callsigndb.hh:86
static constexpr unsigned int nameLength()
Maximum name length.
Definition d868uv_callsigndb.hh:84
static constexpr unsigned int totalLength()
Maximum entry size.
Definition d868uv_callsigndb.hh:91
Some internal offsets.
Definition d868uv_callsigndb.hh:99
Some limits for the call-sign DB.
Definition d868uv_callsigndb.hh:207
static constexpr unsigned int entries()
Specifies the max number of entries in the DB.
Definition d868uv_callsigndb.hh:209
Some internal offsets.
Definition d868uv_callsigndb.hh:188
Some internal used offsets within the DB.
Definition d868uv_callsigndb.hh:214