libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
opengd77_codeplug.hh
1#ifndef OPENGD77_CODEPLUG_HH
2#define OPENGD77_CODEPLUG_HH
3
4#include "opengd77base_codeplug.hh"
5#include "opengd77_extension.hh"
6
7
56class OpenGD77Codeplug: public OpenGD77BaseCodeplug
57{
58 Q_OBJECT
59
60public:
62 explicit OpenGD77Codeplug(QObject *parent=nullptr);
63
64public:
65 void clearGeneralSettings();
66 bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
67 bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack());
68
69 void clearDTMFSettings();
70 bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
71 bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack());
72
73 void clearAPRSSettings();
74 bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
75 bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack());
76
77 void clearContacts();
78 bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
79 bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack());
80
81 void clearDTMFContacts();
82 bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
83 bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack());
84
85 void clearChannels();
86 bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
87 bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack());
88 bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack());
89
90 void clearBootSettings();
91 bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
92 bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack());
93
94 void clearVFOSettings();
95
96 void clearZones();
97 bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
98 bool createZones(Context &ctx, const ErrorStack &err=ErrorStack());
99 bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack());
100
101 void clearGroupLists();
102 bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
103 bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
104 bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
105
106public:
108 struct Limit: public Element::Limit {
110 static constexpr unsigned int channelBanks() { return 8; }
111 };
112
113protected:
115 struct ImageIndex {
117 static constexpr unsigned int settings() { return EEPROM; }
118 static constexpr unsigned int dtmfSettings() { return EEPROM; }
119 static constexpr unsigned int aprsSettings() { return EEPROM; }
120 static constexpr unsigned int dtmfContacts() { return EEPROM; }
121 static constexpr unsigned int channelBank0() { return EEPROM; }
122 static constexpr unsigned int bootSettings() { return EEPROM; }
123 static constexpr unsigned int vfoA() { return EEPROM; }
124 static constexpr unsigned int vfoB() { return EEPROM; }
125 static constexpr unsigned int zoneBank() { return EEPROM; }
126 static constexpr unsigned int channelBank1() { return FLASH; }
127 static constexpr unsigned int contacts() { return FLASH; }
128 static constexpr unsigned int groupLists() { return FLASH; }
130 };
131
133 struct Offset {
135 static constexpr unsigned int settings() { return 0x000080; }
136 static constexpr unsigned int dtmfSettings() { return 0x001470; }
137 static constexpr unsigned int aprsSettings() { return 0x001588; }
138 static constexpr unsigned int dtmfContacts() { return 0x002f88; }
139 static constexpr unsigned int channelBank0() { return 0x003780; } // Channels 1-128
140 static constexpr unsigned int bootSettings() { return 0x007518; }
141 static constexpr unsigned int vfoA() { return 0x007590; }
142 static constexpr unsigned int vfoB() { return 0x0075c8; }
143 static constexpr unsigned int zoneBank() { return 0x008010; }
144 static constexpr unsigned int channelBank1() { return 0x07b1b0; } // Channels 129-1024
145 static constexpr unsigned int contacts() { return 0x087620; }
146 static constexpr unsigned int groupLists() { return 0x08d620; }
148 };
149};
150
151#endif // OPENGD77_CODEPLUG_HH
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:41
Represents, encodes and decodes the device specific codeplug for Open GD-77 firmware.
Definition opengd77_codeplug.hh:57
OpenGD77Codeplug(QObject *parent=nullptr)
Constructs an empty codeplug for the GD-77.
Definition opengd77_codeplug.cc:11
Internal used image indices.
Definition opengd77_codeplug.hh:115
Some Limits for this codeplug.
Definition opengd77_codeplug.hh:108
static constexpr unsigned int channelBanks()
Number of channel banks.
Definition opengd77_codeplug.hh:110
Some offsets.
Definition opengd77_codeplug.hh:133