libdrmconf 0.14.0
A library to program DMR radios.
Loading...
Searching...
No Matches
gd77_callsigndb.hh
1#ifndef GD77CALLSIGNDB_HH
2#define GD77CALLSIGNDB_HH
3
4#include "callsigndb.hh"
5#include "userdatabase.hh"
6
25{
26 Q_OBJECT
27
28public:
30 struct __attribute__((packed)) userdb_entry_t {
31 uint32_t number;
32 char name[8];
33
37 void clear();
38
40 uint32_t getNumber() const;
42 void setNumber(uint32_t number);
43
45 QString getName() const;
47 void setName(const QString &name);
48
50 void fromEntry(const UserDatabase::User &user);
51 };
52
58 struct __attribute__((packed)) userdb_t {
59 char magic[8];
60 uint32_t count;
61
63 userdb_t();
65 void clear();
66
68 void setSize(uint32_t n);
69 };
70
71
72public:
74 explicit GD77CallsignDB(QObject *parent=nullptr);
76 virtual ~GD77CallsignDB();
77
79 virtual bool encode(UserDatabase *calldb, const Flags &selection=Flags(),
80 const ErrorStack &err=ErrorStack());
81};
82
83#endif // GD77CALLSIGNDB_HH
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
Abstract base class of all callsign database implementations.
Definition callsigndb.hh:16
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Represents and encodes the binary format for the call-sign database within the radio.
Definition gd77_callsigndb.hh:25
virtual ~GD77CallsignDB()
Destructor.
Definition gd77_callsigndb.cc:81
virtual bool encode(UserDatabase *calldb, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())
Encodes as many entries as possible of the given user-database.
Definition gd77_callsigndb.cc:86
Represents the user information within the UserDatabase.
Definition userdatabase.hh:32
Auto-updating DMR user database.
Definition userdatabase.hh:24
Represents a user-db entry within the binary codeplug.
Definition gd77_callsigndb.hh:30
uint32_t number
DMR ID stored in BCD little-endian.
Definition gd77_callsigndb.hh:31
Represents the binary call-sign database header.
Definition gd77_callsigndb.hh:58
uint32_t count
Number of contacts in DB, 32bit little-endian.
Definition gd77_callsigndb.hh:60