libdrmconf 0.13.3
A library to program DMR radios.
Loading...
Searching...
No Matches
openuv380_callsigndb.hh
1#ifndef OPENUV380CALLSIGNDB_HH
2#define OPENUV380CALLSIGNDB_HH
3
4#include "opengd77base_callsigndb.hh"
5#include "userdatabase.hh"
6
20{
21 Q_OBJECT
22
23public:
25 {
26 public:
28 DatabaseEntryElement(uint8_t *ptr);
29
31 static constexpr unsigned int size() { return 0x001b; }
32
33 void clear() override;
34
36 void setText(const QString &text) override;
37
38 public:
40 struct Limit: public Element::Limit {
41 // The length of the text.
42 static constexpr unsigned int textLength() { return 32; }
43 };
44 };
45
46public:
49 explicit OpenUV380CallsignDB(bool extended, QObject *parent=nullptr);
50
51 static constexpr unsigned int size0() { return 0x040000; }
52 static constexpr unsigned int size1() { return 0xd28000; }
53
55 bool encode(UserDatabase *calldb, const Flags &selection=Flags(),
56 const ErrorStack &err=ErrorStack());
57
58public:
62 static constexpr unsigned int entries0() {
63 return (size0()-DatabaseHeaderElement::size())/DatabaseEntryElement::size();
64 }
65
66 static constexpr unsigned int entries1() {
67 return size1()/DatabaseEntryElement::size();
68 }
69 static constexpr unsigned int entries() {
70 return entries0() + entries1();
71 }
72 };
73
74protected:
76 struct Offset {
78 static constexpr unsigned int header() { return 0x050000; }
79 static constexpr unsigned int entries0() { return header() + DatabaseHeaderElement::size(); }
80 static constexpr unsigned int entries1() { return 0x0d8000; }
82 };
83};
84
85#endif // OPENGD77CALLSIGNDB_HH
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
Represents a single encoded database entry.
Definition opengd77base_callsigndb.hh:45
OpenGD77BaseCallsignDB(QObject *parent=nullptr)
Constructor.
Definition opengd77base_callsigndb.cc:142
DatabaseEntryElement(uint8_t *ptr)
Constructor.
Definition openuv380_callsigndb.cc:11
static constexpr unsigned int size()
The size of the entry.
Definition openuv380_callsigndb.hh:31
void setText(const QString &text) override
Encodes the text.
Definition openuv380_callsigndb.cc:23
void clear() override
Abstract method to reset the element within the codeplug.
Definition openuv380_callsigndb.cc:18
OpenUV380CallsignDB(bool extended, QObject *parent=nullptr)
Constructor.
Definition openuv380_callsigndb.cc:34
bool encode(UserDatabase *calldb, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())
Encodes as many entries as possible of the given user-database.
Definition openuv380_callsigndb.cc:44
Some limits for this callsign DB.
Definition opengd77base_callsigndb.hh:149
Some limits.
Definition openuv380_callsigndb.hh:40
Some limits of the callsign DB.
Definition openuv380_callsigndb.hh:60
static constexpr unsigned int entries1()
Number of entries, segment 1.
Definition openuv380_callsigndb.hh:66
static constexpr unsigned int entries0()
Number of entries, segment 0.
Definition openuv380_callsigndb.hh:62
Some internal offsets within the callsign db.
Definition openuv380_callsigndb.hh:76