1 #ifndef D868UVCALLSIGNDB_HH
2 #define D868UVCALLSIGNDB_HH
4 #include "callsigndb.hh"
5 #include "userdatabase.hh"
6 #include "d868uv_codeplug.hh"
69 virtual void setContent(
const QString &name,
const QString &city,
const QString &call,
70 const QString &state,
const QString &country,
const QString &comment);
92 static constexpr
unsigned int size() {
return 0x000186a0; }
97 uint8_t *
entry(
unsigned int i)
const;
116 static constexpr
unsigned int size() {
return 0x0001f400; }
121 uint8_t *
entry(
unsigned int i)
const;
142 virtual unsigned count()
const;
147 virtual unsigned endOfDB()
const;
155 static unsigned size();
171 static constexpr
unsigned int entries() {
return 200000; }
178 static constexpr
unsigned int index() {
return 0x04000000; }
179 static constexpr
unsigned int betweenIndexBanks() {
return 0x00040000; }
180 static constexpr
unsigned int callsigns() {
return 0x04500000; }
181 static constexpr
unsigned int betweenCallsignBanks() {
return 0x00040000; }
182 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:20
Abstract base class of all callsign database implementations.
Definition: callsigndb.hh:14
Represents the abstract base class of all codeplug elements.
Definition: codeplug.hh:51
Represents a bank of call-sign DB entries.
Definition: d868uv_callsigndb.hh:82
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:92
uint8_t * entry(unsigned int i) const
Returns the i-th element of the bank.
Represents the header of an entry in the callsign database.
Definition: d868uv_callsigndb.hh:41
virtual void setNumber(unsigned num)
Sets the DMR ID number.
Definition: d868uv_callsigndb.cc:38
EntryElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition: d868uv_callsigndb.cc:10
virtual void setRingTone(RingTone tone)
Sets the ring tone.
Definition: d868uv_callsigndb.cc:48
virtual void setCallType(DMRContact::Type type)
Sets the call type.
Definition: d868uv_callsigndb.cc:29
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:53
static unsigned size(const UserDatabase::User &user)
Computes the size of the database entry for the given user.
Definition: d868uv_callsigndb.cc:77
virtual void setFriendFlag(bool set)
Set/clear friend flag.
Definition: d868uv_callsigndb.cc:43
RingTone
Notification tones for callsign entry.
Definition: d868uv_callsigndb.hh:44
virtual unsigned fromUser(const UserDatabase::User &user)
Constructs a database entry from the given user.
Definition: d868uv_callsigndb.cc:67
void clear()
Abstract method to reset the element within the codeplug.
Definition: d868uv_callsigndb.cc:23
Represents a bank of index entries.
Definition: d868uv_callsigndb.hh:106
IndexBankElement(uint8_t *ptr, unsigned size)
Hidden constructor.
void clear()
Abstract method to reset the element within the codeplug.
uint8_t * entry(unsigned int i) const
Returns the i-th element of the bank.
static constexpr unsigned int size()
The size of the element.
Definition: d868uv_callsigndb.hh:116
IndexBankElement(uint8_t *ptr)
Constructor.
Stores some basic limits of the callsign db.
Definition: d868uv_callsigndb.hh:129
virtual void setCount(unsigned count)
Sets the number of entries.
Definition: d868uv_callsigndb.cc:115
virtual void setTotalSize(unsigned size)
Sets the total size of the DB (updated end-of-db address).
Definition: d868uv_callsigndb.cc:128
virtual unsigned endOfDB() const
Returns the end-of-db address.
Definition: d868uv_callsigndb.cc:120
void clear()
Resets the limits.
Definition: d868uv_callsigndb.cc:105
static unsigned size()
Returns the size of the encoded element.
Definition: d868uv_callsigndb.cc:133
virtual void setEndOfDB(unsigned addr)
Sets the end-of-db address.
Definition: d868uv_callsigndb.cc:124
virtual unsigned count() const
Returns the number of entries in the DB.
Definition: d868uv_callsigndb.cc:111
LimitsElement(uint8_t *ptr, unsigned size)
Hidden constructor.
Definition: d868uv_callsigndb.cc:92
Represents and encodes the binary format for the call-sign database within a AnyTone AT-D868UV radio.
Definition: d868uv_callsigndb.hh:25
D868UVCodeplug::ContactMapElement IndexEntryElement
Same index entry used by the codeplug to map normal digital contacts to an contact index.
Definition: d868uv_callsigndb.hh:102
bool encode(UserDatabase *db, const Selection &selection=Selection(), const ErrorStack &err=ErrorStack())
Tries to encode as many entries of the given user-database.
Definition: d868uv_callsigndb.cc:148
D868UVCallsignDB(QObject *parent=nullptr)
Constructor, does not allocate any memory yet.
Definition: d868uv_callsigndb.cc:141
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Represents the user information within the UserDatabase.
Definition: userdatabase.hh:28
Auto-updating DMR user database.
Definition: userdatabase.hh:23
Some limits for the call-sign DB.
Definition: d868uv_callsigndb.hh:169
static constexpr unsigned int entries()
Specifies the max number of entries in the DB.
Definition: d868uv_callsigndb.hh:171
Some internal used offsets within the DB.
Definition: d868uv_callsigndb.hh:176