libdrmconf  0.12.0
A library to program DMR radios.
d868uv_filereader.hh
1 #ifndef D868UVFILEREADER_HH
2 #define D868UVFILEREADER_HH
3 
4 #include "d868uv_codeplug.hh"
5 #include "anytone_filereader.hh"
6 
10 {
11 public:
14  {
15  public:
17  ChannelElement(const uint8_t *ptr);
19  uint16_t index() const;
21  D868UVCodeplug::channel_t::Mode mode() const;
23  double rxFrequency() const;
25  double txFrequency() const;
27  Channel::Power power() const;
29  AnalogChannel::Bandwidth bandwidth() const;
31  bool rxOnly() const;
37  DigitalChannel::Admit admitDigital() const;
39  AnalogChannel::Admit admitAnalog() const;
41  uint8_t colorCode() const;
43  DigitalChannel::TimeSlot timeSlot() const;
45  QString name() const;
46 
47  size_t size() const;
48 
49  protected:
51  size_t _nameLength;
52  };
53 
56  {
57  public:
59  RadioIDElement(const uint8_t *ptr);
60 
62  uint8_t index() const;
64  uint32_t id() const;
66  QString name() const;
67 
68  size_t size() const;
69 
70  protected:
72  size_t _nameLength;
73  };
74 
77  {
78  public:
80  ZoneElement(const uint8_t *ptr);
81 
83  uint8_t index() const;
85  uint16_t channelA() const;
87  uint16_t channelB() const;
89  uint8_t numChannels() const;
91  uint16_t channel(uint8_t index) const;
93  QString name() const;
94 
95  size_t size() const;
96 
97  protected:
99  uint8_t _numChannels;
101  size_t _nameLength;
102  };
103 
106  {
107  public:
109  ScanListElement(const uint8_t *ptr);
110 
112  uint8_t index() const;
114  uint8_t numChannels() const;
118  uint16_t prioChannel1() const;
120  uint16_t prioChannel2() const;
122  uint16_t channel(uint8_t index) const;
124  QString name() const;
125 
126  size_t size() const;
127 
128  protected:
130  uint8_t _numChannels;
132  size_t _nameLength;
133  };
134 
137  {
138  public:
140  AnalogContactElement(const uint8_t *ptr);
141 
143  uint8_t index() const;
145  QString number() const;
147  QString name() const;
148 
149  size_t size() const;
150 
151  protected:
153  uint8_t _numberLength;
155  size_t _nameLength;
156  };
157 
158 
159 public:
161  D868UVFileReader(Config *config, const uint8_t *data, size_t size, QString &message);
162 
163  bool linkHeader();
164  bool readHeader();
165 
166  bool readChannels();
168  virtual bool readChannel();
169  bool linkChannels();
171  virtual bool linkChannel();
172 
173  bool readRadioIDs();
175  virtual bool readRadioID();
176  bool linkRadioIDs();
177 
178  bool readZones();
180  virtual bool readZone();
181  bool linkZones();
182 
183  bool readScanLists();
185  virtual bool readScanList();
186  bool linkScanLists();
187 
188  bool readAnalogContacts();
190  virtual bool readAnalogContact();
191  bool linkAnalogContacts();
192 };
193 
194 #endif // D868UVFILEREADER_HH
PriChannel
Defines all possible priority channel selections.
Definition: anytone_codeplug.hh:609
Base class for all elements in the codeplug file.
Definition: anytone_filereader.hh:16
This class implements a reader of AnyTone codeplug files.
Definition: anytone_filereader.hh:12
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition: channel.hh:61
The config class, representing the codeplug configuration.
Definition: config.hh:70
Represents an analog contact within the manufacturer CPS file.
Definition: d868uv_filereader.hh:137
uint8_t _numberLength
Returns the length of the number.
Definition: d868uv_filereader.hh:153
QString number() const
Returns the number.
Definition: d868uv_filereader.cc:268
size_t size() const
Returns the storage size of the element.
Definition: d868uv_filereader.cc:278
QString name() const
Returns the name.
Definition: d868uv_filereader.cc:273
size_t _nameLength
Returns the length of the name.
Definition: d868uv_filereader.hh:155
AnalogContactElement(const uint8_t *ptr)
Constructor.
Definition: d868uv_filereader.cc:255
uint8_t index() const
Returns the index of the analog contact.
Definition: d868uv_filereader.cc:263
Representsa a channel encoded in the manufacturer CPS file.
Definition: d868uv_filereader.hh:14
DigitalChannel::TimeSlot timeSlot() const
Returns the time slot of the channel (if digital).
Definition: d868uv_filereader.cc:119
Signaling::Code rxSignaling() const
Returns the RX CTCSS/DCS settings.
Definition: d868uv_filereader.cc:77
AnalogChannel::Admit admitAnalog() const
Returns the admit cirterion for the channel (if analog).
Definition: d868uv_filereader.cc:102
size_t size() const
Returns the storage size of the element.
Definition: d868uv_filereader.cc:129
DigitalChannel::Admit admitDigital() const
Returns the admit cirterion for the channel (if digital).
Definition: d868uv_filereader.cc:89
D868UVCodeplug::channel_t::Mode mode() const
Returns the channel mode (Analog, Digital, Mixed...).
Definition: d868uv_filereader.cc:25
uint8_t colorCode() const
Returns the color code of the channel (if digital).
Definition: d868uv_filereader.cc:114
Channel::Power power() const
Returns the power setting.
Definition: d868uv_filereader.cc:52
ChannelElement(const uint8_t *ptr)
Constructor.
Definition: d868uv_filereader.cc:13
size_t _nameLength
The length of the name.
Definition: d868uv_filereader.hh:51
double rxFrequency() const
Return the RX frequency.
Definition: d868uv_filereader.cc:30
double txFrequency() const
Return the TX frequency.
Definition: d868uv_filereader.cc:35
uint16_t index() const
Returns the index of the channel.
Definition: d868uv_filereader.cc:20
QString name() const
Returns the name of the channel.
Definition: d868uv_filereader.cc:124
Signaling::Code txSignaling() const
Returns the TX CTCSS/DCS settings.
Definition: d868uv_filereader.cc:83
bool rxOnly() const
Returns true if the channel is RX only.
Definition: d868uv_filereader.cc:72
AnalogChannel::Bandwidth bandwidth() const
Returns the bandwidth.
Definition: d868uv_filereader.cc:66
Decodes a radio ID from the manufacturer CPS file.
Definition: d868uv_filereader.hh:56
size_t size() const
Returns the storage size of the element.
Definition: d868uv_filereader.cc:160
uint8_t index() const
Returns the index of the ID.
Definition: d868uv_filereader.cc:144
QString name() const
Returns the name of the radio ID.
Definition: d868uv_filereader.cc:155
uint32_t id() const
Returns the ID.
Definition: d868uv_filereader.cc:149
RadioIDElement(const uint8_t *ptr)
Constructor for radio ID element.
Definition: d868uv_filereader.cc:137
size_t _nameLength
Holds the length of the name.
Definition: d868uv_filereader.hh:72
Represents a scan list in the manufacturer CPS file.
Definition: d868uv_filereader.hh:106
size_t _nameLength
Holds the name length.
Definition: d868uv_filereader.hh:132
size_t size() const
Returns the storage size of the element.
Definition: d868uv_filereader.cc:247
QString name() const
Returns the name of the scan list.
Definition: d868uv_filereader.cc:242
uint16_t channel(uint8_t index) const
Returns the i-th channel index.
Definition: d868uv_filereader.cc:237
ScanListElement(const uint8_t *ptr)
Constructor.
Definition: d868uv_filereader.cc:204
uint8_t numChannels() const
Returns the number of channels in the scan list.
Definition: d868uv_filereader.cc:217
uint8_t index() const
Returns the index of the scan list.
Definition: d868uv_filereader.cc:212
uint16_t prioChannel1() const
Returns the priority channel 1 index.
Definition: d868uv_filereader.cc:227
uint16_t prioChannel2() const
Returns the priority channel 2 index.
Definition: d868uv_filereader.cc:232
uint8_t _numChannels
Holds the number of channels.
Definition: d868uv_filereader.hh:130
AnytoneCodeplug::ScanListElement::PriChannel prioChannelSelect() const
Returns the priority channel selection.
Definition: d868uv_filereader.cc:222
Represents a zone within the manufacturer CPS file.
Definition: d868uv_filereader.hh:77
uint8_t _numChannels
Holds the number of channels.
Definition: d868uv_filereader.hh:99
uint16_t channel(uint8_t index) const
Returns the channel index for the i-th entry.
Definition: d868uv_filereader.cc:186
uint8_t index() const
Returns the index of the zone.
Definition: d868uv_filereader.cc:176
uint16_t channelB() const
Returns the number of channels in B.
size_t size() const
Returns the storage size of the element.
Definition: d868uv_filereader.cc:196
uint8_t numChannels() const
Returns the total number of channels in zone.
Definition: d868uv_filereader.cc:181
QString name() const
Returns the name of the zone.
Definition: d868uv_filereader.cc:191
ZoneElement(const uint8_t *ptr)
Constructor.
Definition: d868uv_filereader.cc:168
size_t _nameLength
Holds the name length.
Definition: d868uv_filereader.hh:101
uint16_t channelA() const
Returns the number of channels in A.
Reads manufacturer CPS files.
Definition: d868uv_filereader.hh:10
bool readChannels()
Read all channels.
Definition: d868uv_filereader.cc:307
bool linkRadioIDs()
Link elements.
Definition: d868uv_filereader.cc:398
bool linkHeader()
Link elements.
Definition: d868uv_filereader.cc:300
virtual bool linkChannel()
Links a channel.
Definition: d868uv_filereader.cc:358
virtual bool readScanList()
Reads a scan list.
Definition: d868uv_filereader.cc:470
virtual bool readAnalogContact()
Reads an analog contact.
Definition: d868uv_filereader.cc:538
bool readRadioIDs()
Read all radio IDs.
Definition: d868uv_filereader.cc:367
virtual bool readZone()
Reads a zone.
Definition: d868uv_filereader.cc:420
bool linkZones()
Link elements.
Definition: d868uv_filereader.cc:446
bool readHeader()
Read header of file.
Definition: d868uv_filereader.cc:293
bool linkChannels()
Link elements.
Definition: d868uv_filereader.cc:346
bool readAnalogContacts()
Read all DTMF contacts.
Definition: d868uv_filereader.cc:527
virtual bool readChannel()
Reads a channel.
Definition: d868uv_filereader.cc:319
virtual bool readRadioID()
Reads a radio ID.
Definition: d868uv_filereader.cc:379
D868UVFileReader(Config *config, const uint8_t *data, size_t size, QString &message)
Constructs a file reader for the given manufacturer CPS file (data, size).
Definition: d868uv_filereader.cc:286
bool readZones()
Read all zones.
Definition: d868uv_filereader.cc:409
bool linkAnalogContacts()
Link elements.
Definition: d868uv_filereader.cc:553
bool linkScanLists()
Link elements.
Definition: d868uv_filereader.cc:516
bool readScanLists()
Read all scal lists.
Definition: d868uv_filereader.cc:458
Code
This huge enum lists all possible RX/TX tones that can be associated with analog channels.
Definition: signaling.hh:18