libdrmconf 0.15.0
A library to program DMR radios.
Loading...
Searching...
No Matches
d168uv_codeplug.hh
1#ifndef D168UV_CODEPLUG_HH
2#define D168UV_CODEPLUG_HH
3
4#include <QDateTime>
5
6#include "d878uv_codeplug.hh"
7#include "d878uv_codeplug.hh"
8#include "d878uv_codeplug.hh"
9#include "d878uv_codeplug.hh"
10
11class Channel;
12class DMRContact;
13class Zone;
14class RXGroupList;
15class ScanList;
16class DMRAPRSSystem;
17
18
26{
27 Q_OBJECT
28
29public:
32 {
33 public:
35 ChannelElement(uint8_t *ptr);
36
38 virtual bool dmrCRCDisabled() const;
40 virtual void disableDMRCRC(bool disable);
41
43 Channel *toChannelObj(Context &ctx) const override;
45 bool fromChannelObj(const Channel *c, Context &ctx) override;
46
47 protected:
51 static constexpr Bit disableDMRCRC() { return {34, 3}; }
53 };
54 };
55
56
60 {
61 protected:
62 /** Device specific time zones. */
63 struct TimeZone {
64 public:
66 static uint8_t encode(const QTimeZone& zone);
68 static QTimeZone decode(uint8_t code);
69
70 protected:
72 static QVector<QTimeZone> _timeZones;
73 };
74
75 public:
77 GeneralSettingsElement(uint8_t *ptr);
78
79 QTimeZone gpsTimeZone() const override;
80 void setGPSTimeZone(const QTimeZone &zone) override;
81 };
82
86 {
87 protected:
89 enum class TalkerAliasType {
90 RadioName = 0, CustomText = 1
91 };
92
93 public:
95 ExtendedSettingsElement(uint8_t *ptr);
96
97 // Size changed
98 static constexpr unsigned int size() { return 0x100; }
99
100 bool fromConfig(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) override;
101
102 protected:
105 static constexpr unsigned int talkerAliasType() { return 0x0001; }
107 };
108 };
109
113 {
114 public:
116 explicit FixedLocationNamesElement(uint8_t *ptr);
117
119 static constexpr unsigned int size() { return 0x0090; }
120
121 void clear() override;
122
124 virtual QString name(unsigned int n) const;
126 virtual void setName(unsigned int n, const QString &name);
127
128 public:
132 static constexpr unsigned int nameCount() { return 8; }
133 static constexpr unsigned int nameLength() { return 16; }
134 };
135
136 protected:
140 static constexpr unsigned int names() { return 0x0003; }
141 static constexpr unsigned int betweenNames() { return Limit::nameLength() + 1; }
143 };
144 };
145
146protected:
148 explicit D168UVCodeplug(const QString &label, QObject *parent = nullptr);
149
150public:
152 explicit D168UVCodeplug(QObject *parent = nullptr);
153
154protected:
155 void allocateUpdated() override;
156
157 bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err) override;
158 bool createChannels(Context &ctx, const ErrorStack &err) override;
159 bool linkChannels(Context &ctx, const ErrorStack &err) override;
160
161 bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) override;
162 bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack()) override;
163 bool linkGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack()) override;
164
165protected:
169 static constexpr unsigned int fixedLocationNames() { return 0x02504800; }
170 static constexpr unsigned int unknown_25c2000() { return 0x025c2000; }
171 static constexpr unsigned int unknown_25c2c80() { return 0x025c2c80; }
173 };
174};
175
176#endif // D168UV_CODEPLUG_HH
virtual void clear()
Clears and resets the complete codeplug to some default values.
Definition anytone_codeplug.cc:4533
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:38
Base class for all codeplug contexts.
Definition codeplug.hh:331
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:65
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
Channel * toChannelObj(Context &ctx) const override
Constructs a Channel object from this element.
Definition d168uv_codeplug.cc:28
bool fromChannelObj(const Channel *c, Context &ctx) override
Encodes the given channel object.
Definition d168uv_codeplug.cc:44
ChannelElement(uint8_t *ptr)
Constructor.
Definition d168uv_codeplug.cc:10
virtual bool dmrCRCDisabled() const
Returns true if the CRC check for DMR channels is disabled.
Definition d168uv_codeplug.cc:17
virtual void disableDMRCRC(bool disable)
Disables DMR CRC check.
Definition d168uv_codeplug.cc:22
TalkerAliasType
Encoding of possible talker-alias types.
Definition d168uv_codeplug.hh:89
ExtendedSettingsElement(uint8_t *ptr)
Constructor.
Definition d168uv_codeplug.cc:110
bool fromConfig(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) override
Encodes the settings from the config.
Definition d168uv_codeplug.cc:117
virtual QString name(unsigned int n) const
Returns the n-th name.
Definition d168uv_codeplug.cc:144
static constexpr unsigned int size()
Size of the element.
Definition d168uv_codeplug.hh:119
virtual void setName(unsigned int n, const QString &name)
Sets the n-th name.
Definition d168uv_codeplug.cc:151
FixedLocationNamesElement(uint8_t *ptr)
Constructor.
Definition d168uv_codeplug.cc:131
void setGPSTimeZone(const QTimeZone &zone) override
Sets the GPS time zone.
Definition d168uv_codeplug.cc:101
QTimeZone gpsTimeZone() const override
Returns the GPS time zone.
Definition d168uv_codeplug.cc:96
GeneralSettingsElement(uint8_t *ptr)
Constructor.
Definition d168uv_codeplug.cc:88
bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err) override
Encode channels into codeplug.
Definition d168uv_codeplug.cc:189
bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack()) override
Encodes the general settings section.
Definition d168uv_codeplug.cc:258
bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack()) override
Decodes the general settings section.
Definition d168uv_codeplug.cc:268
D168UVCodeplug(const QString &label, QObject *parent=nullptr)
Hidden constructor.
Definition d168uv_codeplug.cc:162
void allocateUpdated() override
Allocate all code-plug elements that must be written back to the device to maintain a working codeplu...
Definition d168uv_codeplug.cc:176
bool createChannels(Context &ctx, const ErrorStack &err) override
Create channels from codeplug.
Definition d168uv_codeplug.cc:207
bool linkGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack()) override
Link the general settings.
Definition d168uv_codeplug.cc:278
bool linkChannels(Context &ctx, const ErrorStack &err) override
Link channels.
Definition d168uv_codeplug.cc:233
Represents the actual channel encoded within the binary D878UV codeplug.
Definition d878uv_codeplug.hh:93
General settings extension element for the D878UV.
Definition d878uv_codeplug.hh:914
static constexpr unsigned int size()
Returns the size of the element.
Definition d878uv_codeplug.hh:937
Represents the general config of the radio within the D878UV binary codeplug.
Definition d878uv_codeplug.hh:322
D878UVCodeplug(const QString &label, QObject *parent=nullptr)
Hidden constructor.
Definition d878uv_codeplug.cc:3935
This class represents a DMR position reporting system within the codeplug.
Definition gpssystem.hh:69
Represents a digital contact, that is a DMR number.
Definition contact.hh:141
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Generic representation of a RX group list.
Definition rxgrouplist.hh:14
Generic representation of a scan list.
Definition scanlist.hh:15
Represents a zone within the generic configuration.
Definition zone.hh:15
Some internal offsets.
Definition d168uv_codeplug.hh:49
Definition d168uv_codeplug.hh:103
Some limits.
Definition d168uv_codeplug.hh:130
static constexpr unsigned int nameCount()
Number of names.
Definition d168uv_codeplug.hh:132
Some internal offsets.
Definition d168uv_codeplug.hh:138
Device specific time zones.
Definition d168uv_codeplug.hh:63
static QTimeZone decode(uint8_t code)
Decodes time zone.
Definition d168uv_codeplug.cc:72
static QVector< QTimeZone > _timeZones
Vector of possible time-zones.
Definition d168uv_codeplug.hh:62
static uint8_t encode(const QTimeZone &zone)
Encodes time zone.
Definition d168uv_codeplug.cc:78
Internal used offsets within the codeplug.
Definition d168uv_codeplug.hh:167
Internal used offsets within the channel element.
Definition d878uv_codeplug.hh:234
Some limits.
Definition d878uv_codeplug.hh:1991
Internal offsets within the codeplug.
Definition d878uv_codeplug.hh:2001