libdrmconf 0.14.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
57{
58 Q_OBJECT
59
60public:
62 explicit OpenGD77Codeplug(QObject *parent=nullptr);
63
64public:
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 bool linkAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack());
77
78 void clearContacts();
79 bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
80 bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack());
81
82 void clearDTMFContacts();
83 bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
84 bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack());
85
86 void clearChannels();
87 bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
88 bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack());
89 bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack());
90
91 void clearBootSettings();
92 bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
93 bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack());
94
95 void clearVFOSettings();
96
97 void clearZones();
98 bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
99 bool createZones(Context &ctx, const ErrorStack &err=ErrorStack());
100 bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack());
101
102 void clearGroupLists();
103 bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
104 bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
105 bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
106
107public:
109 struct Limit: public Element::Limit {
111 static constexpr unsigned int channelBanks() { return 8; }
112 };
113
114protected:
116 struct ImageIndex {
118 static constexpr unsigned int settings() { return EEPROM; }
119 static constexpr unsigned int dtmfSettings() { return EEPROM; }
120 static constexpr unsigned int aprsSettings() { return EEPROM; }
121 static constexpr unsigned int dtmfContacts() { return EEPROM; }
122 static constexpr unsigned int channelBank0() { return EEPROM; }
123 static constexpr unsigned int bootSettings() { return EEPROM; }
124 static constexpr unsigned int vfoA() { return EEPROM; }
125 static constexpr unsigned int vfoB() { return EEPROM; }
126 static constexpr unsigned int zoneBank() { return EEPROM; }
127 static constexpr unsigned int additionalSettings() { return FLASH; }
128 static constexpr unsigned int channelBank1() { return FLASH; }
129 static constexpr unsigned int contacts() { return FLASH; }
130 static constexpr unsigned int groupLists() { return FLASH; }
132 };
133
135 struct Offset {
137 static constexpr unsigned int settings() { return 0x000080; }
138 static constexpr unsigned int dtmfSettings() { return 0x001470; }
139 static constexpr unsigned int aprsSettings() { return 0x001588; }
140 static constexpr unsigned int dtmfContacts() { return 0x002f88; }
141 static constexpr unsigned int channelBank0() { return 0x003780; } // Channels 1-128
142 static constexpr unsigned int bootSettings() { return 0x007518; }
143 static constexpr unsigned int vfoA() { return 0x007590; }
144 static constexpr unsigned int vfoB() { return 0x0075c8; }
145 static constexpr unsigned int zoneBank() { return 0x008010; }
146 static constexpr unsigned int additionalSettings() { return 0x000000; }
147 static constexpr unsigned int channelBank1() { return 0x07b1b0; } // Channels 129-1024
148 static constexpr unsigned int contacts() { return 0x087620; }
149 static constexpr unsigned int groupLists() { return 0x08d620; }
151 };
152};
153
154#endif // OPENGD77_CODEPLUG_HH
Base class for all codeplug contexts.
Definition codeplug.hh:331
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
OpenGD77BaseCodeplug(QObject *parent=nullptr)
Default hidden constructor.
Definition opengd77base_codeplug.cc:2560
bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes APRS settings.
Definition opengd77_codeplug.cc:68
void clearZones()
Clears all zones.
Definition opengd77_codeplug.cc:244
bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition opengd77_codeplug.cc:115
bool linkAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Links the APRS settings.
Definition opengd77_codeplug.cc:83
bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all defined channels to the configuration.
Definition opengd77_codeplug.cc:180
void clearDTMFSettings()
Clears the DTMF settings.
Definition opengd77_codeplug.cc:45
void clearBootSettings()
Clear boot settings.
Definition opengd77_codeplug.cc:232
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition opengd77_codeplug.cc:25
bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Creates all group lists.
Definition opengd77_codeplug.cc:277
bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the APRS settings.
Definition opengd77_codeplug.cc:77
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all channels.
Definition opengd77_codeplug.cc:206
OpenGD77Codeplug(QObject *parent=nullptr)
Constructs an empty codeplug for the GD-77.
Definition opengd77_codeplug.cc:11
bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists.
Definition opengd77_codeplug.cc:271
void clearChannels()
Clear all channels.
Definition opengd77_codeplug.cc:141
bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes DTMF settings.
Definition opengd77_codeplug.cc:50
void clearContacts()
Clears all contacts in the codeplug.
Definition opengd77_codeplug.cc:104
void clearGroupLists()
Clears all group lists.
Definition opengd77_codeplug.cc:266
bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the DTMF settings.
Definition opengd77_codeplug.cc:56
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all zones within the configuration.
Definition opengd77_codeplug.cc:261
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all group lists.
Definition opengd77_codeplug.cc:283
bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Adds all DTMF contacts to the configuration.
Definition opengd77_codeplug.cc:133
bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition opengd77_codeplug.cc:39
bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DTMF contacts.
Definition opengd77_codeplug.cc:126
void clearVFOSettings()
Clears the VFO settings.
Definition opengd77_codeplug.cc:238
void clearDTMFContacts()
Clears all DTMF contacts in the codeplug.
Definition opengd77_codeplug.cc:121
bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition opengd77_codeplug.cc:30
void clearAPRSSettings()
Clears the APRS settings.
Definition opengd77_codeplug.cc:63
bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encode all channels.
Definition opengd77_codeplug.cc:152
bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the boot settings.
Definition opengd77_codeplug.cc:97
bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes zones.
Definition opengd77_codeplug.cc:249
bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())
Adds zones to the configuration.
Definition opengd77_codeplug.cc:255
bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes boot settings.
Definition opengd77_codeplug.cc:90
bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition opengd77_codeplug.cc:109
Internal used image indices.
Definition opengd77_codeplug.hh:116
Some Limits for this codeplug.
Definition opengd77_codeplug.hh:109
static constexpr unsigned int channelBanks()
Number of channel banks.
Definition opengd77_codeplug.hh:111
Some offsets.
Definition opengd77_codeplug.hh:135