libdrmconf  0.12.0
A library to program DMR radios.
gd73_codeplug.hh
1 #ifndef GD73CODEPLUG_HH
2 #define GD73CODEPLUG_HH
3 
4 #include "codeplug.hh"
5 #include "interval.hh"
6 #include "ranges.hh"
7 #include "contact.hh"
8 #include "rxgrouplist.hh"
9 #include "channel.hh"
10 #include "zone.hh"
11 #include "radioddity_extensions.hh"
12 
13 
14 class SMSTemplate;
15 class SMSExtension;
16 
52 class GD73Codeplug : public Codeplug
53 {
54  Q_OBJECT
55 
56 public:
62  {
63  protected:
65  InformationElement(uint8_t *ptr, size_t size);
66 
67  public:
69  InformationElement(uint8_t *ptr);
70 
72  static constexpr unsigned int size() { return 0x0061; }
73 
77  void setFrequencyRange(const FrequencyRange &range);
78 
80  QDateTime timestamp() const;
82  void setTimestamp(const QDateTime &timestamp);
83 
85  QString serial() const;
87  QString modelName() const;
89  QString deviceID() const;
91  QString modelNumber() const;
93  QString softwareVersion() const;
94 
95  public:
97  struct Limit {
99  static constexpr unsigned int serial() { return 16; }
101  static constexpr unsigned int modelName() { return 16; }
103  static constexpr unsigned int deviceID() { return 16; }
105  static constexpr unsigned int modelNumber() { return 16; }
107  static constexpr unsigned int softwareVersion() { return 16; }
108  };
109 
110  protected:
112  struct Offset {
114  static constexpr unsigned int frequencyRange() { return 0x0000; }
115  static constexpr unsigned int dateCentury() { return 0x0001; }
116  static constexpr unsigned int dateYear() { return 0x0002; }
117  static constexpr unsigned int dateMonth() { return 0x0003; }
118  static constexpr unsigned int dateDay() { return 0x0004; }
119  static constexpr unsigned int dateHour() { return 0x0005; }
120  static constexpr unsigned int dateMinute() { return 0x0006; }
121  static constexpr unsigned int dateSecond() { return 0x0007; }
122  static constexpr unsigned int serial() { return 0x0011; }
123  static constexpr unsigned int modelName() { return 0x0021; }
124  static constexpr unsigned int deviceID() { return 0x0031; }
125  static constexpr unsigned int modelNumber() { return 0x0041; }
126  static constexpr unsigned int softwareVersion() { return 0x0051; }
128  };
129  };
130 
131 
137  {
138  public:
140  enum class Action {
141  Call = 0, Message = 1
142  };
143 
144  protected:
146  OneTouchSettingElement(uint8_t *ptr, size_t size);
147 
148  public:
150  OneTouchSettingElement(uint8_t *ptr);
151 
153  static constexpr unsigned int size() { return 0x0005; }
154 
155  protected:
157  struct Offset {
159  static constexpr unsigned int contact() { return 0x0001; }
160  static constexpr unsigned int action() { return 0x0003; }
161  static constexpr unsigned int message() { return 0x0001; }
163  };
164  };
165 
166 
172  class SettingsElement: public Element
173  {
174  public:
176  enum class ChannelDisplayMode {
177  Name = 0, Frequency = 1
178  };
180  enum class BootDisplayMode {
181  Off = 0, Text = 1, Image = 2, Both = 3
182  };
184  struct KeyFunction {
185  public:
186  static uint8_t encode(RadioddityButtonSettingsExtension::Function func);
187  static RadioddityButtonSettingsExtension::Function decode(uint8_t code);
188  protected:
189  enum Code {
190  None=0, RadioEnable=1, RadioCheck=2, RadioDisable=3, PowerLevel=4,
191  Monitor=5, EmergencyOn=6, EmergencyOff=7, ZoneSwitch=8, ToggleScan=9, ToggleVOX=10,
192  OneTouch1=11, OneTouch2=12, OneTouch3=13, OneTouch4=14, OneTouch5=15, ToggleTalkaround=16,
193  LoneWorker=17, TBST=18, CallSwell=19
194  };
195  };
197  enum class Language {
198  Chinese=0, English=1
199  };
200 
201  protected:
203  SettingsElement(uint8_t *ptr, size_t size);
204 
205  public:
207  SettingsElement(uint8_t *ptr);
208 
210  static constexpr unsigned int size() { return 0x00aa; }
211 
213  QString name() const;
215  void setName(const QString &name);
216 
218  unsigned int dmrID() const;
220  void setDMRID(unsigned int id);
221 
223  Language language() const;
225  void setLanguage(Language lang);
226 
228  unsigned int vox() const;
230  void setVOX(unsigned int level);
231 
233  unsigned int squelch() const;
235  void setSquelch(unsigned int level);
236 
238  bool totIsSet() const;
240  Interval tot() const;
242  void setTOT(const Interval &interval);
244  void clearTOT();
245 
247  bool txInterruptedEnabled() const;
249  void enableTXInterrupt(bool enable);
250 
252  bool powerSaveEnabled() const;
254  void enablePowerSave(bool enable);
256  Interval powerSaveTimeout() const;
258  void setPowerSaveTimeout(const Interval &interval);
259 
261  bool readLockEnabled() const;
263  void enableReadLock(bool enable);
265  QString readLockPin() const;
267  void setReadLockPin(const QString &pin);
268 
270  bool writeLockEnabled() const;
272  void enableWriteLock(bool enable);
274  QString writeLockPin() const;
276  void setWriteLockPin(const QString &pin);
277 
282 
284  unsigned int dmrMicGain() const;
286  void setDMRMicGain(unsigned int gain);
288  unsigned int fmMicGain() const;
290  void setFMMicGain(unsigned int gain);
291 
295  void setLoneWorkerResponseTimeout(const Interval &interval);
299  void setLoneWorkerRemindPeriod(const Interval &interval);
300 
306  QString bootTextLine1() const;
308  void setBootTextLine1(const QString &line);
310  QString bootTextLine2() const;
312  void setBootTextLine2(const QString &line);
313 
315  bool keyToneEnabled() const;
317  void enableKeyTone(bool enable);
319  unsigned int keyToneVolume() const;
321  void setKeyToneVolume(unsigned int vol);
323  bool lowBatteryToneEnabled() const;
325  void enableLowBatteryTone(bool enable);
327  unsigned int lowBatteryToneVolume() const;
329  void setLowBatteryToneVolume(unsigned int vol);
330 
332  Interval longPressDuration() const;
334  void setLongPressDuration(const Interval &interval);
352  OneTouchSettingElement oneTouch(unsigned int n);
353 
355  bool updateConfig(Context &ctx, const ErrorStack &err=ErrorStack());
357  bool encode(Context &ctx, const ErrorStack &err=ErrorStack());
358 
359  public:
361  struct Limit {
363  static constexpr unsigned int name() { return 16; }
365  static constexpr TimeRange tot() {
367  }
369  static constexpr TimeRange powerSaveTimeout() {
371  }
373  static constexpr unsigned int pin() { return 6; }
375  static constexpr TimeRange loneWorkerResponse() {
377  }
379  static constexpr TimeRange loneWorkerRemindPeriod() {
381  }
383  static constexpr unsigned int bootTextLine() { return 16; }
385  static constexpr IntRange toneVolume() { return IntRange{0,13}; }
387  static constexpr TimeRange longPressDuration() {
389  }
390  };
391 
392  protected:
394  struct Offset {
396  static constexpr unsigned int name() { return 0x0000; }
397  static constexpr unsigned int dmrId() { return 0x0020; }
398  static constexpr unsigned int language() { return 0x0024; }
399  static constexpr unsigned int voxLevel() { return 0x0026; }
400  static constexpr unsigned int squelchLevel() { return 0x0027; }
401  static constexpr unsigned int tot() { return 0x0028; }
402  static constexpr unsigned int txInterrupt() { return 0x0029; }
403  static constexpr unsigned int powerSave() { return 0x002a; }
404  static constexpr unsigned int powerSaveTimeout() { return 0x002b; }
405  static constexpr unsigned int readLockEnable() { return 0x002c; }
406  static constexpr unsigned int writeLockEnable() { return 0x002d; }
407  static constexpr unsigned int channelDisplayMode() { return 0x002f; }
408  static constexpr unsigned int readLockPin() { return 0x0030; }
409  static constexpr unsigned int writeLockPin() { return 0x0036; }
410  static constexpr unsigned int dmrMicGain() { return 0x003d; }
411  static constexpr unsigned int fmMicGain() { return 0x003f; }
412  static constexpr unsigned int loneWorkerResponseTimeout() { return 0x0040; }
413  static constexpr unsigned int loneWorkerReminderPeriod() { return 0x0042; }
414  static constexpr unsigned int bootDisplayMode() { return 0x0043; }
415  static constexpr unsigned int bootTextLine1() { return 0x0044; }
416  static constexpr unsigned int bootTextLine2() { return 0x0064; }
417  static constexpr unsigned int keyToneEnable() { return 0x0084; }
418  static constexpr unsigned int keyToneVolume() { return 0x0085; }
419  static constexpr unsigned int lowBatToneEnable() { return 0x0086; }
420  static constexpr unsigned int lowBatToneVolume() { return 0x0087; }
421  static constexpr unsigned int longPressDuration() { return 0x0088; }
422  static constexpr unsigned int progFuncKey1ShortPress() { return 0x008b; }
423  static constexpr unsigned int progFuncKey1LongPress() { return 0x008c; }
424  static constexpr unsigned int progFuncKey2ShortPress() { return 0x008d; }
425  static constexpr unsigned int progFuncKey2LongPress() { return 0x008e; }
426  static constexpr unsigned int oneTouchSettings() { return 0x0090; }
427  static constexpr unsigned int betweenOneTouchSettings() { return OneTouchSettingElement::size(); }
429  };
430  };
431 
432 
437  class ZoneElement: public Element
438  {
439  protected:
441  ZoneElement(uint8_t *ptr, size_t size);
442 
443  public:
445  ZoneElement(uint8_t *ptr);
446 
448  static constexpr unsigned int size() { return 0x0031; }
449 
451  QString name() const;
453  void setName(const QString &name);
454 
456  Zone *toZone(Context &ctx, const ErrorStack &err=ErrorStack());
458  bool linkZone(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack());
460  bool encode(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack());
461 
462  public:
464  struct Limit {
466  static constexpr unsigned int nameLength() { return 8; }
468  static constexpr unsigned int channelCount() { return 16; }
469  };
470 
471  protected:
473  struct Offset {
475  static constexpr unsigned int name() { return 0x0000; }
476  static constexpr unsigned int channeCount() { return 0x0010; }
477  static constexpr unsigned int channelIndices() { return 0x0011; }
478  static constexpr unsigned int betweenChannelIndices() { return 0x0002; }
480  };
481  };
482 
483 
490  class ZoneBankElement: public Element
491  {
492  protected:
494  ZoneBankElement(uint8_t *ptr, size_t size);
495 
496  public:
498  ZoneBankElement(uint8_t *ptr);
499 
501  static constexpr unsigned int size() { return 0x0c41; }
502 
504  bool createZones(Context &ctx, const ErrorStack &err);
506  bool linkZones(Context &ctx, const ErrorStack &err);
508  bool encode(Context &ctx, const ErrorStack &err);
509 
510  public:
512  struct Limit {
514  static constexpr unsigned int zoneCount() { return 64; }
515  };
516 
517  protected:
519  struct Offset {
521  static constexpr unsigned int zoneCount() { return 0x0000; }
522  static constexpr unsigned int zones() { return 0x0001; }
523  static constexpr unsigned int betweenZones() { return ZoneElement::size(); }
525  };
526  };
527 
528 
533  class ChannelElement: public Element
534  {
535  protected:
537  ChannelElement(uint8_t *ptr, size_t size);
538 
539  public:
541  enum class Type {
542  FM = 0, DMR = 1
543  };
545  enum class Admit {
546  Always = 0, CC_CTCSS = 1, Free=2
547  };
548 
549  public:
551  ChannelElement(uint8_t *ptr);
552 
554  static constexpr unsigned int size() { return 0x0046; }
555 
557  QString name() const;
559  void setName(const QString &name);
560 
565 
567  bool hasScanListIndex() const;
569  unsigned int scanListIndex() const;
571  void setScanListIndex(unsigned int idx);
573  void clearScanListIndex();
574 
576  Type type() const;
578  void setType(Type type);
579 
581  bool talkaroundEnabled() const;
583  void enableTalkaround(bool enable);
584 
586  bool rxOnly() const;
588  void enableRXOnly(bool enable);
589 
591  bool scanAutoStartEnabled() const;
593  void enableScanAutoStart(bool enable);
594 
596  Frequency rxFrequency() const;
598  void setRXFrequency(const Frequency &f);
600  Frequency txFrequency() const;
602  void setTXFrequency(const Frequency &f);
603 
605  bool hasDTMFPTTSettingsIndex() const;
607  unsigned int dtmfPTTSettingsIndex() const;
609  void setDTMFPTTSettingsIndex(unsigned int idx);
612 
613 
615  Channel::Power power() const;
618 
620  Admit admit() const;
622  void setAdmit(Admit admit);
623 
625  Signaling::Code rxTone() const;
627  void setRXTone(Signaling::Code code);
629  Signaling::Code txTone() const;
631  void setTXTone(Signaling::Code code);
632 
637 
639  unsigned int colorCode() const;
641  void setColorCode(unsigned int cc);
642 
644  bool groupListMatchesContact() const;
646  bool groupListAllMatch() const;
648  unsigned int groupListIndex() const;
650  void setGroupListIndex(unsigned int idx);
652  void setGroupListAllMatch();
655 
657  bool hasTXContact() const;
659  unsigned int txContactIndex() const;
661  void setTXContactIndex(unsigned int idx);
663  void clearTXContactIndex();
664 
666  bool hasEmergencySystemIndex() const;
668  unsigned int emergencySystemIndex() const;
670  void setEmergencySystemIndex(unsigned int idx);
673 
675  bool hasEncryptionKeyIndex() const;
677  unsigned int encryptionKeyIndex() const;
679  void setEncryptionKeyIndex(unsigned int idx);
682 
684  Channel *toChannel(Context &ctx, const ErrorStack &err=ErrorStack());
686  bool linkChannel(Channel *ch, Context &ctx, const ErrorStack &err=ErrorStack());
688  bool encode(Channel *ch, Context &ctx, const ErrorStack &err=ErrorStack());
689 
690  public:
692  struct Limit {
694  static constexpr unsigned int nameLength() { return 16; }
695  };
696 
697  protected:
699  struct Offset {
701  static constexpr unsigned int name() { return 0x0000; }
702  static constexpr unsigned int bandwidth() { return 0x0020; }
703  static constexpr unsigned int scanList() { return 0x0021; }
704  static constexpr unsigned int channelType() { return 0x0022; }
705  static constexpr unsigned int talkaround() { return 0x0023; }
706  static constexpr unsigned int rxOnly() { return 0x0024; }
707  static constexpr unsigned int scanAutoStart() { return 0x0026; }
708  static constexpr unsigned int rxFrequency() { return 0x0027; }
709  static constexpr unsigned int txFrequency() { return 0x002b; }
710  static constexpr unsigned int dtmfPTTSettingsIndex() { return 0x002f; }
711  static constexpr unsigned int power() { return 0x0030; }
712  static constexpr unsigned int admid() { return 0x0031; }
713  static constexpr unsigned int rxToneMode() { return 0x0034; }
714  static constexpr unsigned int rxCTCSS() { return 0x0035; }
715  static constexpr unsigned int rxDCS() { return 0x0036; }
716  static constexpr unsigned int txToneMode() { return 0x0037; }
717  static constexpr unsigned int txCTCSS() { return 0x0038; }
718  static constexpr unsigned int txDCS() { return 0x0039; }
719  static constexpr unsigned int timeslot() { return 0x003c; }
720  static constexpr unsigned int colorcode() { return 0x003d; }
721  static constexpr unsigned int groupListIndex() { return 0x003e; }
722  static constexpr unsigned int contactIndex() { return 0x0040; }
723  static constexpr unsigned int emergencySystemIndex() { return 0x0042; }
724  static constexpr unsigned int encryptionKeyIndex() { return 0x0044; }
726  };
727  };
728 
729 
737  {
738  protected:
740  ChannelBankElement(uint8_t *ptr, size_t size);
741 
742  public:
744  ChannelBankElement(uint8_t *ptr);
745 
747  static constexpr unsigned int size() { return 0x11802; }
748 
750  bool createChannels(Context &ctx, const ErrorStack &err);
752  bool linkChannels(Context &ctx, const ErrorStack &err);
754  bool encode(Context &ctx, const ErrorStack &err);
755 
756  public:
758  struct Limit {
760  static constexpr unsigned int channelCount() { return 1024; }
761  };
762 
763  protected:
765  struct Offset {
767  static constexpr unsigned int channelCount() { return 0x0000; }
768  static constexpr unsigned int channels() { return 0x0002; }
769  static constexpr unsigned int betweenChannels() { return ChannelElement::size(); }
771  };
772  };
773 
774 
779  class ContactElement: public Element
780  {
781  protected:
783  ContactElement(uint8_t *ptr, size_t size);
784 
785  public:
787  ContactElement(uint8_t *ptr);
788 
790  static constexpr unsigned int size() { return 0x025; }
791 
793  QString name() const;
795  void setName(const QString &name);
796 
798  DMRContact::Type type() const;
801 
803  unsigned int id() const;
805  void setID(unsigned int id);
806 
808  DMRContact *toContact(Context &ctx, const ErrorStack &err=ErrorStack());
810  bool encode(const DMRContact *contact, Context &ctx, const ErrorStack &err=ErrorStack());
811 
812  public:
814  struct Limit {
816  static constexpr unsigned int nameLength() { return 16; }
817  };
818 
819  protected:
821  struct Offset {
823  static constexpr unsigned int name() { return 0x0000; }
824  static constexpr unsigned int type() { return 0x0020; }
825  static constexpr unsigned int id() { return 0x0021; }
827  };
828  };
829 
830 
838  {
839  protected:
841  ContactBankElement(uint8_t *ptr, size_t size);
842 
843  public:
845  ContactBankElement(uint8_t *ptr);
846 
848  static constexpr unsigned int size() { return 0x9c02; }
849 
851  bool createContacts(Context &ctx, const ErrorStack &err);
853  bool encode(Context &ctx, const ErrorStack &err);
854 
855  public:
857  struct Limit {
859  static constexpr unsigned int contactCount() { return 1024; }
860  };
861 
862  protected:
864  struct Offset {
866  static constexpr unsigned int contactCount() { return 0x0000; }
867  static constexpr unsigned int contacts() { return 0x0802; }
868  static constexpr unsigned int betweenContacts() { return ContactElement::size(); }
870  };
871  };
872 
873 
878  class GroupListElement: public Element
879  {
880  protected:
882  GroupListElement(uint8_t *ptr, size_t size);
883 
884  public:
886  GroupListElement(uint8_t *ptr);
887 
889  static constexpr unsigned int size() { return 0x0053; }
890 
892  QString name() const;
894  void setName(const QString &name);
895 
897  unsigned int members() const;
899  bool hasMember(unsigned int i) const;
901  unsigned int memberIndex(unsigned int i) const;
902 
904  RXGroupList *toGroupList(Context &ctx, const ErrorStack &err=ErrorStack());
906  bool linkGroupList(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack());
908  bool encode(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack());
909 
910  public:
912  struct Limit {
914  static constexpr unsigned int nameLength() { return 8; }
916  static constexpr unsigned int memberCount() { return 33; }
917  };
918 
919  protected:
921  struct Offset {
923  static constexpr unsigned int name() { return 0x0000; }
924  static constexpr unsigned int memberCount() { return 0x0010; }
925  static constexpr unsigned int members() { return 0x0011; }
926  static constexpr unsigned int betweenMembers() { return 0x0002; }
928  };
929  };
930 
931 
939  {
940  protected:
942  GroupListBankElement(uint8_t *ptr, size_t size);
943 
944  public:
946  GroupListBankElement(uint8_t *ptr);
947 
949  static constexpr unsigned int size() { return 0x510f; }
950 
952  bool createGroupLists(Context &ctx, const ErrorStack &err);
954  bool linkGroupLists(Context &ctx, const ErrorStack &err);
956  bool encode(Context &ctx, const ErrorStack &err);
957 
958  public:
960  struct Limit {
962  static constexpr unsigned int memberCount() { return 250; }
963  };
964 
965  protected:
967  struct Offset {
969  static constexpr unsigned int memberCount() { return 0x0000; }
970  static constexpr unsigned int members() { return 0x0001; }
971  static constexpr unsigned int betweenMembers() { return GroupListElement::size(); }
973  };
974  };
975 
976 
981  class ScanListElement: public Element
982  {
983  public:
985  enum class ChannelMode {
986  None=0, Fixed=1, Selected=2
987  };
988 
989  protected:
991  ScanListElement(uint8_t *ptr, size_t size);
992 
993  public:
995  ScanListElement(uint8_t *ptr);
996 
998  static constexpr unsigned int size() { return 0x005f; }
999 
1001  QString name() const;
1003  void setName(const QString &name);
1004 
1010  bool hasPrimaryZoneIndex() const;
1012  unsigned int primaryZoneIndex() const;
1014  void setPrimaryZoneIndex(unsigned int idx);
1016  void clearPrimaryZoneIndex();
1018  bool hasPrimaryChannelIndex() const;
1020  unsigned int primaryChannelIndex() const;
1022  void setPrimaryChannelIndex(unsigned int idx);
1024  void clearPrimaryChannelIndex();
1025 
1031  bool hasSecondaryZoneIndex() const;
1033  unsigned int secondaryZoneIndex() const;
1035  void setSecondaryZoneIndex(unsigned int idx);
1037  void clearSecondaryZoneIndex();
1039  bool hasSecondaryChannelIndex() const;
1041  unsigned int secondaryChannelIndex() const;
1043  void setSecondaryChannelIndex(unsigned int idx);
1046 
1050  void setRevertChannelMode(ChannelMode mode);
1052  bool hasRevertZoneIndex() const;
1054  unsigned int revertZoneIndex() const;
1056  void setRevertZoneIndex(unsigned int idx);
1058  void clearRevertZoneIndex();
1060  bool hasRevertChannelIndex() const;
1062  unsigned int revertChannelIndex() const;
1064  void setRevertChannelIndex(unsigned int idx);
1066  void clearRevertChannelIndex();
1067 
1069  Interval rxHoldTime() const;
1071  void setRXHoldTime(const Interval &interval);
1073  Interval txHoldTime() const;
1075  void setTXHoldTime(const Interval &interval);
1076 
1078  ScanList *toScanList(Context &ctx, const ErrorStack &err=ErrorStack());
1080  bool linkScanList(ScanList *lst, Context&ctx, const ErrorStack &err=ErrorStack());
1082  bool encode(ScanList *lst, Context&ctx, const ErrorStack &err=ErrorStack());
1083 
1084  public:
1086  struct Limit {
1088  static constexpr unsigned int nameLength() { return 8; }
1090  static constexpr unsigned int memberCount() { return 32; }
1092  static TimeRange holdTime() {
1094  }
1095  };
1096 
1097  protected:
1099  struct Offset {
1101  static constexpr unsigned int name() { return 0x0000; }
1102  static constexpr unsigned int memberCount() { return 0x0010; }
1103  static constexpr unsigned int members() { return 0x0011; }
1104  static constexpr unsigned int betweenMembers() { return 0x0002; }
1105  static constexpr unsigned int priChannel1Mode() { return 0x0051; }
1106  static constexpr unsigned int priChannel2Mode() { return 0x0052; }
1107  static constexpr unsigned int priChannel1Zone() { return 0x0053; }
1108  static constexpr unsigned int priChannel2Zone() { return 0x0054; }
1109  static constexpr unsigned int priChannel1Channel() { return 0x0055; }
1110  static constexpr unsigned int priChannel2Channel() { return 0x0057; }
1111  static constexpr unsigned int txChannelMode() { return 0x0059; }
1112  static constexpr unsigned int txChannelZone() { return 0x005a; }
1113  static constexpr unsigned int txChannelChannel() { return 0x005b; }
1114  static constexpr unsigned int holdTime() { return 0x005d; }
1115  static constexpr unsigned int txHoldTime() { return 0x005e; }
1117  };
1118  };
1119 
1120 
1128  {
1129  protected:
1131  ScanListBankElement(uint8_t *ptr, size_t size);
1132 
1133  public:
1135  ScanListBankElement(uint8_t *ptr);
1136 
1138  static constexpr unsigned int size() { return 0x601; }
1139 
1141  bool createScanLists(Context &ctx, const ErrorStack &err);
1143  bool linkScanLists(Context &ctx, const ErrorStack &err);
1145  bool encode(Context &ctx, const ErrorStack &err);
1146 
1147  public:
1149  struct Limit {
1151  static constexpr unsigned int memberCount() { return 16; }
1152  };
1153 
1154  protected:
1156  struct Offset {
1158  static constexpr unsigned int memberCount() { return 0x0000; }
1159  static constexpr unsigned int members() { return 0x0011; }
1160  static constexpr unsigned int betweenMembers() { return ScanListElement::size(); }
1162  };
1163  };
1164 
1165 
1171  {
1172  protected:
1174  DMRSettingsElement(uint8_t *ptr, size_t size);
1175 
1176  public:
1178  DMRSettingsElement(uint8_t *ptr);
1179 
1181  static constexpr unsigned int size() { return 0x000e; }
1182 
1184  Interval callHangTime() const;
1186  void setCallHangTime(const Interval &intv);
1187 
1189  Interval activeWaitTime() const;
1191  void setActiveWaitTime(const Interval &interval);
1193  unsigned int activeRetries() const;
1195  void setActiveRetries(unsigned int count);
1196 
1198  unsigned int txPreambles() const;
1200  void setTXPreambles(unsigned int count);
1201 
1203  bool decodeDisableRadioEnabled() const;
1205  void enableDecodeDisableRadio(bool enable);
1207  bool decodeRadioCheckEnabled() const;
1209  void enableDecodeRadioCheck(bool enable);
1211  bool decodeEnableRadioEnabled() const;
1213  void enableDecodeEnableRadio(bool enable);
1214 
1216  bool updateConfig(Context &ctx, const ErrorStack &err=ErrorStack());
1218  bool encode(Context &ctx, const ErrorStack &err=ErrorStack());
1219 
1220  public:
1222  struct Limit {
1224  static constexpr TimeRange callHangTime() { return TimeRange{
1226  }; }
1228  static constexpr TimeRange activeWaitTime() { return TimeRange{
1230  }; }
1232  static constexpr IntRange activeRetires() { return IntRange{ 1, 10}; }
1234  static constexpr IntRange txPreambles() { return IntRange{ 0, 63}; }
1235  };
1236 
1237  protected:
1239  struct Offset {
1241  static constexpr unsigned int callHangTime() { return 0x0000; }
1242  static constexpr unsigned int activeWaitTime() { return 0x0001; }
1243  static constexpr unsigned int activeRetries() { return 0x0002; }
1244  static constexpr unsigned int txPreambles() { return 0x0003; }
1245  static constexpr unsigned int decodeDisableRadio() { return 0x0004; }
1246  static constexpr unsigned int decodeCheckRadio() { return 0x0005; }
1247  static constexpr unsigned int decodeEnableRadio() { return 0x0006; }
1249  };
1250  };
1251 
1252 
1258  {
1259  protected:
1261  EncryptionKeyElement(uint8_t *ptr, size_t size);
1262 
1263  public:
1265  EncryptionKeyElement(uint8_t *ptr);
1266 
1268  static constexpr unsigned int size() { return 0x005; }
1269 
1270  void clear();
1271  bool isValid() const;
1272 
1274  unsigned int keySize() const;
1276  void setKeySize(unsigned int size);
1277 
1278  BasicEncryptionKey *createEncryptionKey(const ErrorStack &err=ErrorStack()) const;
1279  bool encodeEncryptionKey(BasicEncryptionKey *key, const ErrorStack &err=ErrorStack());
1280 
1281  protected:
1283  struct Offset {
1285  static constexpr unsigned int size() { return 0x0000; }
1286  static constexpr unsigned int key() { return 0x0001; }
1288  };
1289  };
1290 
1291 
1297  {
1298  protected:
1300  EncryptionKeyBankElement(uint8_t *ptr, size_t size);
1301 
1302  public:
1304  EncryptionKeyBankElement(uint8_t *ptr);
1305 
1307  static constexpr unsigned int size() { return 0x0050; }
1308 
1310  bool createEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack());
1312  bool encodeEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack());
1313 
1314  public:
1316  struct Limit {
1318  static constexpr unsigned int keys() { return 16; }
1319  };
1320 
1321  protected:
1323  struct Offset {
1325  static constexpr unsigned int keys() { return 0x0000; }
1326  static constexpr unsigned int betweenKeys() { return EncryptionKeyElement::size(); }
1328  };
1329  };
1330 
1331 
1335  class MessageElement: public Element
1336  {
1337  protected:
1339  MessageElement(uint8_t *ptr, size_t size);
1340 
1341  public:
1343  MessageElement(uint8_t *ptr);
1344 
1346  static constexpr unsigned int size() { return 0x051; }
1347 
1349  QString text() const;
1351  void setText(const QString &message);
1352 
1354  bool encode(SMSTemplate *message, const ErrorStack &err=ErrorStack());
1356  SMSTemplate *decode(const ErrorStack &err=ErrorStack());
1357 
1358  public:
1360  struct Limit {
1362  static constexpr unsigned int messageLength() { return 40; }
1363  };
1364 
1365  protected:
1367  struct Offset {
1369  static constexpr unsigned int size() { return 0x0000; }
1370  static constexpr unsigned int text() { return 0x0001; }
1372  };
1373  };
1374 
1375 
1383  {
1384  protected:
1386  MessageBankElement(uint8_t *ptr, size_t size);
1387 
1388  public:
1390  MessageBankElement(uint8_t *ptr);
1391 
1393  static constexpr unsigned int size() { return 0x511; }
1394 
1396  unsigned int memberCount() const;
1398  void setMemberCount(unsigned int count);
1399 
1401  MessageElement message(unsigned int i);
1402 
1404  bool decode(SMSExtension *ext, const ErrorStack &err=ErrorStack());
1406  bool encode(const SMSExtension *ext, const ErrorStack &err=ErrorStack());
1407 
1408  public:
1410  struct Limit {
1412  static constexpr unsigned int memberCount() { return 16; }
1413  };
1414 
1415  protected:
1417  struct Offset {
1419  static constexpr unsigned int memberCount() { return 0x0000; }
1420  static constexpr unsigned int members() { return 0x0001; }
1421  static constexpr unsigned int betweenMembers() { return MessageElement::size(); }
1423  };
1424  };
1425 
1426 
1431  {
1432  protected:
1434  DTMFSystemElement(uint8_t *ptr, size_t size);
1435 
1436  public:
1438  DTMFSystemElement(uint8_t *ptr);
1439 
1441  static constexpr unsigned int size() { return 0x005; }
1442 
1443  public:
1445  struct Limit {
1447  static constexpr Interval preambleDuration() { return Interval::fromMilliseconds(1000); }
1449  static constexpr TimeRange toneDuration() { return TimeRange{
1451  }; }
1453  static constexpr TimeRange pauseDuration() { return TimeRange{
1455  }; }
1457  static constexpr TimeRange deadTime() { return TimeRange{
1459  }; }
1460  };
1461 
1462  protected:
1464  struct Offset {
1466  static constexpr unsigned int sidetone() { return 0x0000; }
1467  static constexpr unsigned int preambleDuration() { return 0x0001; }
1468  static constexpr unsigned int toneDuration() { return 0x0002; }
1469  static constexpr unsigned int pauseDuration() { return 0x0003; }
1470  static constexpr unsigned int deadTime() { return 0x0004; }
1472  };
1473  };
1474 
1475 
1479  {
1480  protected:
1482  DTMFSystemBankElement(uint8_t *ptr, size_t size);
1483 
1484  public:
1486  DTMFSystemBankElement(uint8_t *ptr);
1487 
1489  static constexpr unsigned int size() { return 0x0014; }
1490 
1491  public:
1493  struct Limit {
1495  static constexpr unsigned int memberCount() { return 4; }
1496  };
1497 
1498  protected:
1500  struct Offset {
1502  static constexpr unsigned int members() { return 0x0000; }
1503  static constexpr unsigned int betweenMembers() { return DTMFSystemElement::size(); }
1505  };
1506  };
1507 
1508 
1513  {
1514  protected:
1516  DTMFNumberElement(uint8_t *ptr, size_t size);
1517 
1518  public:
1520  DTMFNumberElement(uint8_t *ptr);
1521 
1523  static constexpr unsigned int size() { return 0x000a; }
1524 
1525  public:
1527  struct Limit {
1529  static constexpr unsigned int digits() { return 16; }
1530  };
1531 
1532  protected:
1534  struct Offset {
1536  static constexpr unsigned int count() { return 0x0000; }
1537  static constexpr unsigned int digits() { return 0x0001; }
1539  };
1540  };
1541 
1542 
1546  {
1547  protected:
1549  DTMFNumberBankElement(uint8_t *ptr, size_t size);
1550 
1551  public:
1553  DTMFNumberBankElement(uint8_t *ptr);
1554 
1556  static constexpr unsigned int size() { return 0x0090; }
1557 
1558  public:
1560  struct Limit {
1562  static constexpr unsigned int memberCount() { return 16; }
1563  };
1564 
1565  protected:
1567  struct Offset {
1569  static constexpr unsigned int members() { return 0x0000; }
1570  static constexpr unsigned int betweenMembers() { return DTMFNumberElement::size(); }
1572  };
1573  };
1574 
1575 
1580  {
1581  protected:
1583  DTMFPTTSettingElement(uint8_t *ptr, size_t size);
1584 
1585  public:
1587  DTMFPTTSettingElement(uint8_t *ptr);
1588 
1590  static constexpr unsigned int size() { return 0x0005; }
1591 
1592  protected:
1594  struct Offset {
1596  static constexpr unsigned int systemIndex() { return 0x0000; }
1597  static constexpr unsigned int pttIDType() { return 0x0001; }
1598  static constexpr unsigned int pttIDMode() { return 0x0002; }
1599  static constexpr unsigned int connectIDIndex() { return 0x0003; }
1600  static constexpr unsigned int disconnectIDIndex() { return 0x0004; }
1602  };
1603  };
1604 
1605 
1609  {
1610  protected:
1612  DTMFPTTSettingBankElement(uint8_t *ptr, size_t size);
1613 
1614  public:
1617 
1619  static constexpr unsigned int size() { return 0x00a0; }
1620 
1621  public:
1623  struct Limit {
1625  static constexpr unsigned int memberCount() { return 32; }
1626  };
1627 
1628  protected:
1630  struct Offset {
1632  static constexpr unsigned int members() { return 0x0000; }
1633  static constexpr unsigned int betweenMembers() { return DTMFPTTSettingElement::size(); }
1635  };
1636  };
1637 
1638 public:
1640  explicit GD73Codeplug(QObject *parent = nullptr);
1641 
1642  Config *preprocess(Config *config, const ErrorStack &err=ErrorStack()) const;
1643  bool postprocess(Config *config, const ErrorStack &err=ErrorStack()) const;
1644 
1645  bool index(Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const;
1646  bool decode(Config *config, const ErrorStack &err=ErrorStack());
1647  bool encode(Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack());
1648 
1649 protected:
1651  virtual bool decodeTimestamp(Context &ctx, const ErrorStack &err=ErrorStack());
1653  virtual bool encodeTimestamp(Context &ctx, const ErrorStack &err=ErrorStack());
1654 
1656  virtual bool createMessages(Context &ctx, const ErrorStack &err=ErrorStack());
1658  virtual bool encodeMessages(Context &ctx, const ErrorStack &err=ErrorStack());
1659 
1661  virtual bool decodeSettings(Context &ctx, const ErrorStack &err=ErrorStack());
1663  virtual bool encodeSettings(Context &ctx, const ErrorStack &err=ErrorStack());
1664 
1666  virtual bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack());
1668  virtual bool encodeContacts(Context &ctx, const ErrorStack &err=ErrorStack());
1669 
1671  virtual bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack());
1672 
1674  virtual bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
1676  virtual bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
1678  virtual bool encodeGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
1679 
1681  virtual bool createEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack());
1683  virtual bool encodeEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack());
1684 
1686  virtual bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack());
1688  virtual bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack());
1690  virtual bool encodeChannels(Context &ctx, const ErrorStack &err=ErrorStack());
1691 
1693  virtual bool createZones(Context &ctx, const ErrorStack &err=ErrorStack());
1695  virtual bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack());
1697  virtual bool encodeZones(Context &ctx, const ErrorStack &err=ErrorStack());
1698 
1700  virtual bool createScanLists(Context &ctx, const ErrorStack &err=ErrorStack());
1702  virtual bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack());
1704  virtual bool encodeScanLists(Context &ctx, const ErrorStack &err=ErrorStack());
1705 
1706 protected:
1708  struct Offset {
1710  static constexpr unsigned int timestamp() { return 0x00000; }
1711  static constexpr unsigned int settings() { return 0x00061; }
1712  static constexpr unsigned int zones() { return 0x0010b; }
1713  static constexpr unsigned int channels() { return 0x00d4c; }
1714  static constexpr unsigned int contacts() { return 0x125ff; }
1715  static constexpr unsigned int groupLists() { return 0x1c201; }
1716  static constexpr unsigned int scanLists() { return 0x21310; }
1717  static constexpr unsigned int dmrSettings() { return 0x21911; }
1718  static constexpr unsigned int encryptionKeys() { return 0x2191f; }
1719  static constexpr unsigned int messages() { return 0x2196f; }
1720  static constexpr unsigned int dtmfSystems() { return 0x21e80; }
1721  static constexpr unsigned int dtmfNumbers() { return 0x21e94; }
1722  static constexpr unsigned int dtmfPTTSettings() { return 0x21f24; }
1724  };
1725 };
1726 
1727 
1728 #endif // GD73CODEPLUG_HH
Represents a DMR (basic) encryption key.
Definition: encryptionextension.hh:47
The base class of all channels (analog and digital) of a codeplug configuration.
Definition: channel.hh:34
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition: channel.hh:61
Base class for all codeplug contexts.
Definition: codeplug.hh:238
Represents the abstract base class of all codeplug elements.
Definition: codeplug.hh:51
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition: codeplug.hh:25
This class defines the interface all device-specific code-plugs must implement.
Definition: codeplug.hh:19
The config class, representing the codeplug configuration.
Definition: config.hh:70
Represents a single image within a DFUFile.
Definition: dfufile.hh:121
TimeSlot
Possible timeslots for digital channels.
Definition: channel.hh:389
Represents a digital contact, that is a DMR number.
Definition: contact.hh:141
Type
Possible call types for a contact.
Definition: contact.hh:155
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Bandwidth
Possible bandwidth of an analog channel.
Definition: channel.hh:240
Implements the bank of channels within the binary codeplug.
Definition: gd73_codeplug.hh:737
bool linkChannels(Context &ctx, const ErrorStack &err)
Link all decoded channels.
Definition: gd73_codeplug.cc:1274
static constexpr unsigned int size()
Returns the size of the channel bank.
Definition: gd73_codeplug.hh:747
ChannelBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1245
bool encode(Context &ctx, const ErrorStack &err)
Encodes all indexed channels.
Definition: gd73_codeplug.cc:1288
bool createChannels(Context &ctx, const ErrorStack &err)
Creates the encoded channels, also updates context.
Definition: gd73_codeplug.cc:1258
Implements an FM/DMR channel.
Definition: gd73_codeplug.hh:534
bool scanAutoStartEnabled() const
Returns true if scan auto-start is enabled.
Definition: gd73_codeplug.cc:1388
unsigned int txContactIndex() const
Returns the tx contact index.
Definition: gd73_codeplug.cc:1590
Admit admit() const
Returns the admit criterion.
Definition: gd73_codeplug.cc:1455
Channel * toChannel(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the channel.
Definition: gd73_codeplug.cc:1637
Frequency txFrequency() const
Returns the TX frequency.
Definition: gd73_codeplug.cc:1406
void setColorCode(unsigned int cc)
Sets the color code.
Definition: gd73_codeplug.cc:1556
void setEmergencySystemIndex(unsigned int idx)
Sets the emergency system index.
Definition: gd73_codeplug.cc:1611
void setName(const QString &name)
Sets the channel name.
Definition: gd73_codeplug.cc:1323
Channel::Power power() const
Returns the power setting.
Definition: gd73_codeplug.cc:1432
bool talkaroundEnabled() const
Returns true if talkaround is enabled.
Definition: gd73_codeplug.cc:1370
void setAdmit(Admit admit)
Sets the admit criterion.
Definition: gd73_codeplug.cc:1459
bool hasDTMFPTTSettingsIndex() const
Returns true if channel has DTMF PTT settings index.
Definition: gd73_codeplug.cc:1415
bool groupListAllMatch() const
Returns true, if no group list match is needed (monitor).
Definition: gd73_codeplug.cc:1565
void setGroupListIndex(unsigned int idx)
Sets the group list index.
Definition: gd73_codeplug.cc:1573
Type
Possible channel types.
Definition: gd73_codeplug.hh:541
Type type() const
Returns the channel type.
Definition: gd73_codeplug.cc:1361
void clearEncryptionKeyIndex()
Clears the encryption key index.
Definition: gd73_codeplug.cc:1632
void clearScanListIndex()
Clears the scan list index.
Definition: gd73_codeplug.cc:1356
Signaling::Code txTone() const
Returns the TX tone.
Definition: gd73_codeplug.cc:1498
void enableTalkaround(bool enable)
Enable/disable talkaround.
Definition: gd73_codeplug.cc:1374
QString name() const
Returns the name of the channel.
Definition: gd73_codeplug.cc:1319
void setRXTone(Signaling::Code code)
Sets the RX tone.
Definition: gd73_codeplug.cc:1480
unsigned int groupListIndex() const
Returns the group list index.
Definition: gd73_codeplug.cc:1569
bool hasTXContact() const
Returns true, if the transmit contact is set.
Definition: gd73_codeplug.cc:1586
unsigned int dtmfPTTSettingsIndex() const
Returns the DTMF PTT settings index.
Definition: gd73_codeplug.cc:1419
bool hasScanListIndex() const
Returns true, if a scan list index is set.
Definition: gd73_codeplug.cc:1344
unsigned int colorCode() const
Returns the color code.
Definition: gd73_codeplug.cc:1552
void setScanListIndex(unsigned int idx)
Sets the scan list index.
Definition: gd73_codeplug.cc:1352
FMChannel::Bandwidth bandwidth() const
Returns the bandwidth of the channel.
Definition: gd73_codeplug.cc:1328
unsigned int emergencySystemIndex() const
Returns the emergency system index.
Definition: gd73_codeplug.cc:1607
void setType(Type type)
Sets the channel type.
Definition: gd73_codeplug.cc:1365
void clearEmergencySystemIndex()
Clears the emergency system index.
Definition: gd73_codeplug.cc:1615
void setDTMFPTTSettingsIndex(unsigned int idx)
Sets the DTMF PTT settings index.
Definition: gd73_codeplug.cc:1423
unsigned int scanListIndex() const
Returns the index of the scan list.
Definition: gd73_codeplug.cc:1348
Admit
Possible admit criteria.
Definition: gd73_codeplug.hh:545
void clearTXContactIndex()
Clears the transmit contact index.
Definition: gd73_codeplug.cc:1598
void setTimeSlot(DMRChannel::TimeSlot ts)
Sets the time slot.
Definition: gd73_codeplug.cc:1544
void clearDTMFPTTSettingsIndex()
Resets the DTMF PTT settings index.
Definition: gd73_codeplug.cc:1427
void setBandwidth(FMChannel::Bandwidth bandwidth)
Sets the bandwidth.
Definition: gd73_codeplug.cc:1336
bool groupListMatchesContact() const
Returns true, if group list matches current TX contact.
Definition: gd73_codeplug.cc:1561
unsigned int encryptionKeyIndex() const
Returns the encryption key index.
Definition: gd73_codeplug.cc:1624
void setGroupListAllMatch()
Enables, that no group list match is needed (monitor).
Definition: gd73_codeplug.cc:1577
bool hasEmergencySystemIndex() const
Returns true if an emergency system index is set.
Definition: gd73_codeplug.cc:1603
bool rxOnly() const
Returns true if RX only is enabled.
Definition: gd73_codeplug.cc:1379
void enableScanAutoStart(bool enable)
Enables/disables scan auto-start.
Definition: gd73_codeplug.cc:1392
void setTXContactIndex(unsigned int idx)
Sets the transmit contact index.
Definition: gd73_codeplug.cc:1594
bool hasEncryptionKeyIndex() const
Returns true if an encryption key index is set.
Definition: gd73_codeplug.cc:1620
DMRChannel::TimeSlot timeSlot() const
Returns the time slot.
Definition: gd73_codeplug.cc:1532
void setPower(Channel::Power power)
Sets the power.
Definition: gd73_codeplug.cc:1440
Frequency rxFrequency() const
Returns the RX frequency.
Definition: gd73_codeplug.cc:1397
void setTXFrequency(const Frequency &f)
Sets the TX frequency.
Definition: gd73_codeplug.cc:1410
void setRXFrequency(const Frequency &f)
Sets the RX frequency.
Definition: gd73_codeplug.cc:1401
void setEncryptionKeyIndex(unsigned int idx)
Sets the encryption key index.
Definition: gd73_codeplug.cc:1628
void setTXTone(Signaling::Code code)
Sets the TX tone.
Definition: gd73_codeplug.cc:1514
ChannelElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1306
Signaling::Code rxTone() const
Returns the RX tone.
Definition: gd73_codeplug.cc:1464
static constexpr unsigned int size()
Returns the size of the channel element.
Definition: gd73_codeplug.hh:554
bool linkChannel(Channel *ch, Context &ctx, const ErrorStack &err=ErrorStack())
Links decoded channel.
Definition: gd73_codeplug.cc:1675
bool encode(Channel *ch, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the given channel.
Definition: gd73_codeplug.cc:1722
void setGroupListMatchesContact()
Enables, that the group list matches the current TX contact.
Definition: gd73_codeplug.cc:1581
void enableRXOnly(bool enable)
Enables/disables RX only.
Definition: gd73_codeplug.cc:1383
Implements the contact bank within the codeplug.
Definition: gd73_codeplug.hh:838
ContactBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:979
bool createContacts(Context &ctx, const ErrorStack &err)
Adds all encoded contacts, also updates the context.
Definition: gd73_codeplug.cc:992
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:848
bool encode(Context &ctx, const ErrorStack &err)
Encodes all defined contacts.
Definition: gd73_codeplug.cc:1008
Implements the contact element.
Definition: gd73_codeplug.hh:780
DMRContact::Type type() const
Returns the contact type.
Definition: gd73_codeplug.cc:1056
void setName(const QString &name)
Sets the name of the contact.
Definition: gd73_codeplug.cc:1051
unsigned int id() const
Returns the DMR ID.
Definition: gd73_codeplug.cc:1074
void setType(DMRContact::Type type)
Sets the contact type.
Definition: gd73_codeplug.cc:1065
ContactElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1034
DMRContact * toContact(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the contact.
Definition: gd73_codeplug.cc:1083
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:790
QString name() const
Returns the name of the contact.
Definition: gd73_codeplug.cc:1047
void setID(unsigned int id)
Sets the DMR ID.
Definition: gd73_codeplug.cc:1078
bool encode(const DMRContact *contact, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the given contact.
Definition: gd73_codeplug.cc:1089
Implements the DMR settings element.
Definition: gd73_codeplug.hh:1171
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1181
bool decodeRadioCheckEnabled() const
Returns true, if decoding of 'radio check' is enabled.
Definition: gd73_codeplug.cc:708
bool updateConfig(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the settings within the config.
Definition: gd73_codeplug.cc:725
bool decodeEnableRadioEnabled() const
Returns true, if decoding of 'enable radio' is enabled.
Definition: gd73_codeplug.cc:716
void setCallHangTime(const Interval &intv)
Sets the call hang time (private & group).
Definition: gd73_codeplug.cc:669
Interval callHangTime() const
Returns the call hang time (private & group).
Definition: gd73_codeplug.cc:665
unsigned int txPreambles() const
Retruns the number of TX preambles.
Definition: gd73_codeplug.cc:691
unsigned int activeRetries() const
Retruns the number of active reties.
Definition: gd73_codeplug.cc:682
void setActiveRetries(unsigned int count)
Sets the number of active retries.
Definition: gd73_codeplug.cc:686
void setActiveWaitTime(const Interval &interval)
Sets the active wait time.
Definition: gd73_codeplug.cc:677
bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the settings from the given config.
Definition: gd73_codeplug.cc:740
bool decodeDisableRadioEnabled() const
Returns true, if decoding of 'disable radio' is enabled.
Definition: gd73_codeplug.cc:700
Interval activeWaitTime() const
Returns the active wait time.
Definition: gd73_codeplug.cc:673
void enableDecodeDisableRadio(bool enable)
Enables/disables decoding of 'disable radio'.
Definition: gd73_codeplug.cc:704
void enableDecodeEnableRadio(bool enable)
Enables/disables decoding of 'enable radio'.
Definition: gd73_codeplug.cc:720
DMRSettingsElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:652
void setTXPreambles(unsigned int count)
Sets the number of TX preambles.
Definition: gd73_codeplug.cc:695
void enableDecodeRadioCheck(bool enable)
Enables/disables decoding of 'radio check'.
Definition: gd73_codeplug.cc:712
Implements the bank of 16 DTMF numbers.
Definition: gd73_codeplug.hh:1546
DTMFNumberBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
DTMFNumberBankElement(uint8_t *ptr)
Constructor.
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1556
Implements a single DTMF number.
Definition: gd73_codeplug.hh:1513
DTMFNumberElement(uint8_t *ptr, size_t size)
Hidden constructor.
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1523
DTMFNumberElement(uint8_t *ptr)
Constructor.
Implements the bank of 32 DTMF PTT settings.
Definition: gd73_codeplug.hh:1609
DTMFPTTSettingBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
DTMFPTTSettingBankElement(uint8_t *ptr)
Constructor.
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1619
Implements a single DTMF PTT setting.
Definition: gd73_codeplug.hh:1580
DTMFPTTSettingElement(uint8_t *ptr)
Constructor.
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1590
DTMFPTTSettingElement(uint8_t *ptr, size_t size)
Hidden constructor.
Implements the bank of 4 DTMF systems.
Definition: gd73_codeplug.hh:1479
DTMFSystemBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1489
DTMFSystemBankElement(uint8_t *ptr)
Constructor.
Implements a single DTMF system.
Definition: gd73_codeplug.hh:1431
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1441
DTMFSystemElement(uint8_t *ptr, size_t size)
Hidden constructor.
DTMFSystemElement(uint8_t *ptr)
Constructor.
Implements the encryption key-bank.
Definition: gd73_codeplug.hh:1297
bool encodeEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes encryption keys.
Definition: gd73_codeplug.cc:851
EncryptionKeyBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:820
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1307
bool createEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes and create encryption keys.
Definition: gd73_codeplug.cc:833
Implements the encryption key element.
Definition: gd73_codeplug.hh:1258
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1268
void clear()
Abstract method to reset the element within the codeplug.
Definition: gd73_codeplug.cc:769
unsigned int keySize() const
Returns the key size in bits.
Definition: gd73_codeplug.cc:779
void setKeySize(unsigned int size)
Sets the key size in bits.
Definition: gd73_codeplug.cc:783
EncryptionKeyElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:756
bool isValid() const
Returns true if the pointer is not null.
Definition: gd73_codeplug.cc:774
Encodes the bank of group lists.
Definition: gd73_codeplug.hh:939
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:949
GroupListBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1101
bool linkGroupLists(Context &ctx, const ErrorStack &err)
Link all decoded group lists.
Definition: gd73_codeplug.cc:1130
bool createGroupLists(Context &ctx, const ErrorStack &err)
Create all encoded group lists, also update context.
Definition: gd73_codeplug.cc:1114
bool encode(Context &ctx, const ErrorStack &err)
Encode group lists.
Definition: gd73_codeplug.cc:1144
Encodes a group list.
Definition: gd73_codeplug.hh:879
QString name() const
Returns the name of the group list.
Definition: gd73_codeplug.cc:1179
RXGroupList * toGroupList(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the group list.
Definition: gd73_codeplug.cc:1201
bool encode(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the group list.
Definition: gd73_codeplug.cc:1225
unsigned int memberIndex(unsigned int i) const
Returns the i-th member index.
Definition: gd73_codeplug.cc:1196
unsigned int members() const
Returns the number of entries in the group list.
Definition: gd73_codeplug.cc:1188
bool hasMember(unsigned int i) const
Returns true, if the i-th member is set.
Definition: gd73_codeplug.cc:1192
void setName(const QString &name)
Sets the name of the group list.
Definition: gd73_codeplug.cc:1183
bool linkGroupList(RXGroupList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Links the given RX group list.
Definition: gd73_codeplug.cc:1207
GroupListElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1166
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:889
Implements the information element.
Definition: gd73_codeplug.hh:62
QString deviceID() const
Returns the device id.
Definition: gd73_codeplug.cc:105
void setTimestamp(const QDateTime &timestamp)
Sets the timestamp of the last programming.
Definition: gd73_codeplug.cc:84
FrequencyRange frequencyRange() const
Returns the frequency range, supported by the radio.
Definition: gd73_codeplug.cc:54
QString serial() const
Returns the serial number as a string.
Definition: gd73_codeplug.cc:95
QDateTime timestamp() const
Returns the timestamp of the last programming.
Definition: gd73_codeplug.cc:75
void setFrequencyRange(const FrequencyRange &range)
Overrides the frequency range settings.
Definition: gd73_codeplug.cc:64
QString softwareVersion() const
Returns the software version as a string.
Definition: gd73_codeplug.cc:115
QString modelNumber() const
Returns the model number as a string.
Definition: gd73_codeplug.cc:110
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:72
InformationElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:41
QString modelName() const
Returns the model name.
Definition: gd73_codeplug.cc:100
Implements the message bank element.
Definition: gd73_codeplug.hh:1383
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1393
unsigned int memberCount() const
Returns the member count.
Definition: gd73_codeplug.cc:930
bool encode(const SMSExtension *ext, const ErrorStack &err=ErrorStack())
Encodes all messages defined within the SMS extension.
Definition: gd73_codeplug.cc:961
void setMemberCount(unsigned int count)
Sets the member count.
Definition: gd73_codeplug.cc:934
MessageElement message(unsigned int i)
Returns the i-th message.
Definition: gd73_codeplug.cc:939
bool decode(SMSExtension *ext, const ErrorStack &err=ErrorStack())
Updates the SMS extension by decoding all defined messages.
Definition: gd73_codeplug.cc:945
MessageBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:917
Implements a message.
Definition: gd73_codeplug.hh:1336
MessageElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:870
SMSTemplate * decode(const ErrorStack &err=ErrorStack())
Creates a SMS template from this message.
Definition: gd73_codeplug.cc:904
QString text() const
Returns the message text.
Definition: gd73_codeplug.cc:883
void setText(const QString &message)
Set message text.
Definition: gd73_codeplug.cc:889
bool encode(SMSTemplate *message, const ErrorStack &err=ErrorStack())
Sets a message element from an SMS message.
Definition: gd73_codeplug.cc:896
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1346
Implements one of the 5 one-touch settings elements.
Definition: gd73_codeplug.hh:137
Action
Possible one-touch actions.
Definition: gd73_codeplug.hh:140
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:153
OneTouchSettingElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:636
Implements the bank of scan lists.
Definition: gd73_codeplug.hh:1128
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:1138
ScanListBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1900
bool createScanLists(Context &ctx, const ErrorStack &err)
Creates all encoded scan lists, also updates context.
Definition: gd73_codeplug.cc:1913
bool linkScanLists(Context &ctx, const ErrorStack &err)
Links all decoded scan lists.
Definition: gd73_codeplug.cc:1929
bool encode(Context &ctx, const ErrorStack &err)
Encodes all scan lists.
Definition: gd73_codeplug.cc:1943
Implements a scan list.
Definition: gd73_codeplug.hh:982
void clearSecondaryZoneIndex()
Clears the secondary zone index.
Definition: gd73_codeplug.cc:2044
void setSecondaryChannelIndex(unsigned int idx)
Sets the secondary channel index.
Definition: gd73_codeplug.cc:2056
void setPrimaryChannelMode(ChannelMode mode)
Sets the primary channel mode.
Definition: gd73_codeplug.cc:1987
bool hasPrimaryZoneIndex() const
Returns true, if a primary zone is set.
Definition: gd73_codeplug.cc:1991
void setRevertChannelIndex(unsigned int idx)
Sets the revert channel index.
Definition: gd73_codeplug.cc:2097
bool encode(ScanList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the scan list.
Definition: gd73_codeplug.cc:2179
void clearSecondaryChannelIndex()
Clears the secondary channel index.
Definition: gd73_codeplug.cc:2060
bool hasPrimaryChannelIndex() const
Returns true, if a primary channel is set.
Definition: gd73_codeplug.cc:2007
unsigned int revertChannelIndex() const
Returns the revert channel index.
Definition: gd73_codeplug.cc:2093
QString name() const
Returns the name of the scan list.
Definition: gd73_codeplug.cc:1974
void setSecondaryZoneIndex(unsigned int idx)
Sets the secondary zone index.
Definition: gd73_codeplug.cc:2040
void clearRevertZoneIndex()
Clears the revert zone index.
Definition: gd73_codeplug.cc:2085
Interval txHoldTime() const
Returns the TX hold time.
Definition: gd73_codeplug.cc:2115
void setTXHoldTime(const Interval &interval)
Sets the TX hold time.
Definition: gd73_codeplug.cc:2119
void clearPrimaryChannelIndex()
Clears the primary channel index.
Definition: gd73_codeplug.cc:2019
unsigned int revertZoneIndex() const
Returns the revert zone index.
Definition: gd73_codeplug.cc:2077
void setRevertZoneIndex(unsigned int idx)
Sets the revert zone index.
Definition: gd73_codeplug.cc:2081
void setSecondaryChannelMode(ChannelMode mode)
Sets the secondary channel mode.
Definition: gd73_codeplug.cc:2028
void clearRevertChannelIndex()
Clears the revert channel index.
Definition: gd73_codeplug.cc:2101
ChannelMode secondaryChannelMode() const
Returns the secondary channel mode.
Definition: gd73_codeplug.cc:2024
ChannelMode primaryChannelMode() const
Returns the primary channel mode.
Definition: gd73_codeplug.cc:1983
bool hasRevertZoneIndex() const
Returns true, if a revert zone is set.
Definition: gd73_codeplug.cc:2073
unsigned int secondaryChannelIndex() const
Returns the secondary channel index.
Definition: gd73_codeplug.cc:2052
unsigned int secondaryZoneIndex() const
Returns the secondary zone index.
Definition: gd73_codeplug.cc:2036
bool linkScanList(ScanList *lst, Context &ctx, const ErrorStack &err=ErrorStack())
Links a decoded scan list.
Definition: gd73_codeplug.cc:2130
void clearPrimaryZoneIndex()
Clears the primary zone index.
Definition: gd73_codeplug.cc:2003
ChannelMode
Possible priority/revert channel modes.
Definition: gd73_codeplug.hh:985
void setRevertChannelMode(ChannelMode mode)
Sets the revert channel mode.
Definition: gd73_codeplug.cc:2069
void setPrimaryChannelIndex(unsigned int idx)
Sets the primary channel index.
Definition: gd73_codeplug.cc:2015
Interval rxHoldTime() const
Returns the RX hold time.
Definition: gd73_codeplug.cc:2106
bool hasSecondaryChannelIndex() const
Returns true, if a secondary channel is set.
Definition: gd73_codeplug.cc:2048
ChannelMode revertChannelMode() const
Returns the revert channel mode.
Definition: gd73_codeplug.cc:2065
static constexpr unsigned int size()
Returns the size of the element.
Definition: gd73_codeplug.hh:998
void setRXHoldTime(const Interval &interval)
Sets the RX hold time.
Definition: gd73_codeplug.cc:2110
unsigned int primaryZoneIndex() const
Returns the primary zone index.
Definition: gd73_codeplug.cc:1995
void setName(const QString &name)
Sets the name of the scan list.
Definition: gd73_codeplug.cc:1978
unsigned int primaryChannelIndex() const
Returns the primary channel index.
Definition: gd73_codeplug.cc:2011
bool hasRevertChannelIndex() const
Returns true, if a revert channel is set.
Definition: gd73_codeplug.cc:2089
void setPrimaryZoneIndex(unsigned int idx)
Sets the primary zone index.
Definition: gd73_codeplug.cc:1999
ScanList * toScanList(Context &ctx, const ErrorStack &err=ErrorStack())
Constructs a ScanList from this elemet.
Definition: gd73_codeplug.cc:2124
ScanListElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1961
bool hasSecondaryZoneIndex() const
Returns true, if a secondary zone is set.
Definition: gd73_codeplug.cc:2032
Implements the radio settings.
Definition: gd73_codeplug.hh:173
void enableWriteLock(bool enable)
Enables/disables write lock.
Definition: gd73_codeplug.cc:311
Interval tot() const
Returns the transmit time-out.
Definition: gd73_codeplug.cc:244
RadioddityButtonSettingsExtension::Function keyFunctionShortPressP2() const
Short-press function of programmable key 2.
Definition: gd73_codeplug.cc:461
void enableReadLock(bool enable)
Enables/disables read lock.
Definition: gd73_codeplug.cc:294
unsigned int dmrID() const
Returns the radio ID.
Definition: gd73_codeplug.cc:204
void setName(const QString &name)
Sets the radio name.
Definition: gd73_codeplug.cc:199
void setDMRID(unsigned int id)
Sets the radio ID.
Definition: gd73_codeplug.cc:208
void setKeyFunctionLongPressP2(RadioddityButtonSettingsExtension::Function function)
Sets the long-press function of the programmable key 2.
Definition: gd73_codeplug.cc:457
QString bootTextLine1() const
Returns the first line of the boot text.
Definition: gd73_codeplug.cc:377
void setDMRMicGain(unsigned int gain)
Sets the DMR microphone gain [1,10].
Definition: gd73_codeplug.cc:337
void setKeyFunctionShortPressP1(RadioddityButtonSettingsExtension::Function function)
Sets the short-press function of the programmable key 1.
Definition: gd73_codeplug.cc:449
void setBootTextLine1(const QString &line)
Sets the first line of the boot text.
Definition: gd73_codeplug.cc:381
unsigned int squelch() const
Returns the squelch level [0,10].
Definition: gd73_codeplug.cc:231
unsigned int fmMicGain() const
Returns the FM microphone gain [1,10].
Definition: gd73_codeplug.cc:341
bool updateConfig(Context &ctx, const ErrorStack &err=ErrorStack())
Updates the given config.
Definition: gd73_codeplug.cc:475
void setReadLockPin(const QString &pin)
Sets the read-lock pin (1-6 digits as ASCII).
Definition: gd73_codeplug.cc:302
QString bootTextLine2() const
Returns the second line of the boot text.
Definition: gd73_codeplug.cc:385
bool writeLockEnabled() const
Returns true, if the write lock is enabled.
Definition: gd73_codeplug.cc:307
Interval longPressDuration() const
Returns the long-press duration.
Definition: gd73_codeplug.cc:428
QString readLockPin() const
Returns the read-lock pin (1-6 digits as ASCII).
Definition: gd73_codeplug.cc:298
void setVOX(unsigned int level)
Sets the VOX level [0,10].
Definition: gd73_codeplug.cc:226
unsigned int vox() const
Returns the VOX level [0,10].
Definition: gd73_codeplug.cc:222
void setKeyFunctionLongPressP1(RadioddityButtonSettingsExtension::Function function)
Sets the long-press function of the programmable key 1.
Definition: gd73_codeplug.cc:441
Interval loneWorkerResponseTimeout() const
Returns the lone-worker response time-out.
Definition: gd73_codeplug.cc:350
unsigned int keyToneVolume() const
Returns the key-tone volume [0-13].
Definition: gd73_codeplug.cc:402
RadioddityButtonSettingsExtension::Function keyFunctionShortPressP1() const
Short-press function of programmable key 1.
Definition: gd73_codeplug.cc:445
RadioddityButtonSettingsExtension::Function keyFunctionLongPressP1() const
Long-press function of programmable key 1.
Definition: gd73_codeplug.cc:437
void setPowerSaveTimeout(const Interval &interval)
Sets the power-save time-out.
Definition: gd73_codeplug.cc:284
void setWriteLockPin(const QString &pin)
Sets the write-lock pin (1-6 digits as ASCII).
Definition: gd73_codeplug.cc:319
Language
Possible languages.
Definition: gd73_codeplug.hh:197
void setTOT(const Interval &interval)
Sets the transmit time-out.
Definition: gd73_codeplug.cc:251
void setKeyToneVolume(unsigned int vol)
Sets the key-tone volume.
Definition: gd73_codeplug.cc:406
bool totIsSet() const
Returns true, if a transmit time-out is set.
Definition: gd73_codeplug.cc:240
bool powerSaveEnabled() const
Returns true if power save is enabled.
Definition: gd73_codeplug.cc:272
void enableKeyTone(bool enable)
Enables/disables the key tones.
Definition: gd73_codeplug.cc:398
OneTouchSettingElement oneTouch(unsigned int n)
Returns the n-th one-touch setting.
Definition: gd73_codeplug.cc:469
void setSquelch(unsigned int level)
Sets the squelch level [0,10].
Definition: gd73_codeplug.cc:235
static constexpr unsigned int size()
Returns the size of the settings element.
Definition: gd73_codeplug.hh:210
Language language() const
Retruns the menu language.
Definition: gd73_codeplug.cc:213
bool txInterruptedEnabled() const
Returns true if the TX interrupt is enabled.
Definition: gd73_codeplug.cc:263
void enableTXInterrupt(bool enable)
Enables/disables the TX interrupt.
Definition: gd73_codeplug.cc:267
void setBootTextLine2(const QString &line)
Sets the second line of the boot text.
Definition: gd73_codeplug.cc:389
Interval powerSaveTimeout() const
Returns the power-save time-out.
Definition: gd73_codeplug.cc:280
void setLoneWorkerResponseTimeout(const Interval &interval)
Sets the lone-worker response time-out.
Definition: gd73_codeplug.cc:354
void enablePowerSave(bool enable)
Enables/disables power save.
Definition: gd73_codeplug.cc:276
RadioddityButtonSettingsExtension::Function keyFunctionLongPressP2() const
Long-press function of programmable key 2.
Definition: gd73_codeplug.cc:453
void setLanguage(Language lang)
Sets the menu language.
Definition: gd73_codeplug.cc:217
QString writeLockPin() const
Returns the write-lock pin (1-6 digits as ASCII).
Definition: gd73_codeplug.cc:315
unsigned int dmrMicGain() const
Returns the DMR microphone gain [1,10].
Definition: gd73_codeplug.cc:333
void setLoneWorkerRemindPeriod(const Interval &interval)
Sets the lone-worker remind period.
Definition: gd73_codeplug.cc:363
void setBootDisplayMode(BootDisplayMode mode)
Sets the boot display mode.
Definition: gd73_codeplug.cc:373
void enableLowBatteryTone(bool enable)
Enables/disables the low-battery warn tone.
Definition: gd73_codeplug.cc:415
void setLongPressDuration(const Interval &interval)
Sets the long-press duration.
Definition: gd73_codeplug.cc:432
ChannelDisplayMode
Possible channel display modes.
Definition: gd73_codeplug.hh:176
void setChannelDisplayMode(ChannelDisplayMode mode)
Sets the channel display mode.
Definition: gd73_codeplug.cc:328
Interval loneWorkerRemindPeriod() const
Returns the lone-worker remind period.
Definition: gd73_codeplug.cc:359
BootDisplayMode bootDisplayMode() const
Returns the boot display mode.
Definition: gd73_codeplug.cc:369
ChannelDisplayMode channelDisplayMode() const
Returns the channel display mode.
Definition: gd73_codeplug.cc:324
unsigned int lowBatteryToneVolume() const
Returns the low-battery warn-tone volume [0-13].
Definition: gd73_codeplug.cc:419
void setKeyFunctionShortPressP2(RadioddityButtonSettingsExtension::Function function)
Sets the short-press function of the programmable key 2.
Definition: gd73_codeplug.cc:465
void clearTOT()
Disables transmit time-out.
Definition: gd73_codeplug.cc:258
bool readLockEnabled() const
Returns true, if the read lock is enabled.
Definition: gd73_codeplug.cc:290
bool lowBatteryToneEnabled() const
Returns true if the low-battery warn tone is enabled.
Definition: gd73_codeplug.cc:411
SettingsElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:182
BootDisplayMode
Possible boot display modes.
Definition: gd73_codeplug.hh:180
bool encode(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the settings from the given config.
Definition: gd73_codeplug.cc:550
QString name() const
Returns the radio name.
Definition: gd73_codeplug.cc:195
void setLowBatteryToneVolume(unsigned int vol)
Sets the low-battery warn-tone volume.
Definition: gd73_codeplug.cc:423
bool keyToneEnabled() const
Returns true if the key tones are enabled.
Definition: gd73_codeplug.cc:394
void setFMMicGain(unsigned int gain)
Sets the FM microphone gain [1,10].
Definition: gd73_codeplug.cc:345
Implements the bank of zones.
Definition: gd73_codeplug.hh:491
bool createZones(Context &ctx, const ErrorStack &err)
Creates all encoded zones, also updates the context.
Definition: gd73_codeplug.cc:1785
static constexpr unsigned int size()
Returns the size of the zone bank element.
Definition: gd73_codeplug.hh:501
bool encode(Context &ctx, const ErrorStack &err)
Encodess all zones.
Definition: gd73_codeplug.cc:1815
ZoneBankElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1772
bool linkZones(Context &ctx, const ErrorStack &err)
Links all decoded zones.
Definition: gd73_codeplug.cc:1801
Implements a single zone within the binary codeplug.
Definition: gd73_codeplug.hh:438
Zone * toZone(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the zone element.
Definition: gd73_codeplug.cc:1855
void setName(const QString &name)
Sets the name of the zone.
Definition: gd73_codeplug.cc:1850
bool encode(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the given zone.
Definition: gd73_codeplug.cc:1878
QString name() const
Returns the name of the zone.
Definition: gd73_codeplug.cc:1846
bool linkZone(Zone *zone, Context &ctx, const ErrorStack &err=ErrorStack())
Links the decoded zone.
Definition: gd73_codeplug.cc:1861
ZoneElement(uint8_t *ptr, size_t size)
Hidden constructor.
Definition: gd73_codeplug.cc:1833
static constexpr unsigned int size()
Returns the size of the zone element.
Definition: gd73_codeplug.hh:448
Represents, encodes and decodes the device specific codeplug for a Radioddity GD-73.
Definition: gd73_codeplug.hh:53
virtual bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Create channels.
Definition: gd73_codeplug.cc:2606
bool encode(Config *config, const Flags &flags=Flags(), const ErrorStack &err=ErrorStack())
Encodes a given abstract configuration (config) to the device specific binary code-plug.
Definition: gd73_codeplug.cc:2321
virtual bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Link zones.
Definition: gd73_codeplug.cc:2642
virtual bool encodeContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Encode contacts.
Definition: gd73_codeplug.cc:2544
virtual bool createEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack())
Create encryption keys.
Definition: gd73_codeplug.cc:2588
virtual bool encodeGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Encode group lists.
Definition: gd73_codeplug.cc:2579
virtual bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Create group lists.
Definition: gd73_codeplug.cc:2561
virtual bool encodeEncryptionKeys(Context &ctx, const ErrorStack &err=ErrorStack())
Encode encryption keys.
Definition: gd73_codeplug.cc:2597
virtual bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Link group lists.
Definition: gd73_codeplug.cc:2570
virtual bool encodeScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Encode zones.
Definition: gd73_codeplug.cc:2678
virtual bool createZones(Context &ctx, const ErrorStack &err=ErrorStack())
Create zones.
Definition: gd73_codeplug.cc:2633
virtual bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Creates contacts.
Definition: gd73_codeplug.cc:2534
virtual bool decodeSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the settings fields (generic & DMR).
Definition: gd73_codeplug.cc:2504
bool decode(Config *config, const ErrorStack &err=ErrorStack())
Decodes a binary codeplug to the given abstract configuration config.
Definition: gd73_codeplug.cc:2381
virtual bool encodeChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Encode channels.
Definition: gd73_codeplug.cc:2624
virtual bool encodeMessages(Context &ctx, const ErrorStack &err=ErrorStack())
Encode messages.
Definition: gd73_codeplug.cc:2494
bool index(Config *config, Context &ctx, const ErrorStack &err=ErrorStack()) const
Indexes all elements of the codeplug.
Definition: gd73_codeplug.cc:2265
virtual bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Link channels.
Definition: gd73_codeplug.cc:2615
virtual bool encodeZones(Context &ctx, const ErrorStack &err=ErrorStack())
Encode zones.
Definition: gd73_codeplug.cc:2651
virtual bool createScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Create scan lists.
Definition: gd73_codeplug.cc:2660
virtual bool decodeTimestamp(Context &ctx, const ErrorStack &err=ErrorStack())
Decodes the time-stamp field.
Definition: gd73_codeplug.cc:2459
virtual bool encodeSettings(Context &ctx, const ErrorStack &err=ErrorStack())
Encode settings fields (generic & DMR settings).
Definition: gd73_codeplug.cc:2519
GD73Codeplug(QObject *parent=nullptr)
Default constructor.
Definition: gd73_codeplug.cc:2223
virtual bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Link zones.
Definition: gd73_codeplug.cc:2669
bool postprocess(Config *config, const ErrorStack &err=ErrorStack()) const
Retruns a post-processed configuration of the decoded config.
Definition: gd73_codeplug.cc:2248
Config * preprocess(Config *config, const ErrorStack &err=ErrorStack()) const
Retruns a prepared configuration for this particular radio.
Definition: gd73_codeplug.cc:2231
virtual bool createMessages(Context &ctx, const ErrorStack &err=ErrorStack())
Creates messages.
Definition: gd73_codeplug.cc:2484
virtual bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack())
Creates DTMF contacts.
Definition: gd73_codeplug.cc:2555
virtual bool encodeTimestamp(Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the time-stamp field.
Definition: gd73_codeplug.cc:2473
Represents a time interval.
Definition: interval.hh:11
static constexpr Interval fromMinutes(unsigned long long min)
Definition: interval.hh:63
static constexpr Interval fromSeconds(unsigned long long s)
Definition: interval.hh:60
static constexpr Interval fromMilliseconds(unsigned long long ms)
Definition: interval.hh:57
Generic representation of a RX group list.
Definition: rxgrouplist.hh:14
Function
Possible function key actions.
Definition: radioddity_extensions.hh:31
Simple range class representing some range in some data type.
Definition: ranges.hh:14
Extension collecting all settings associated with SMS messages.
Definition: smsextension.hh:55
Represents a SMS message template (pre defined message).
Definition: smsextension.hh:11
Generic representation of a scan list.
Definition: scanlist.hh:15
Code
This huge enum lists all possible RX/TX tones that can be associated with analog channels.
Definition: signaling.hh:18
Represents a zone within the generic configuration.
Definition: zone.hh:15
Helper type to encode frequencies without any rounding error.
Definition: frequency.hh:11
Some limits for the channel bank.
Definition: gd73_codeplug.hh:758
static constexpr unsigned int channelCount()
Maximum number of channels.
Definition: gd73_codeplug.hh:760
Internal offsets within the bank.
Definition: gd73_codeplug.hh:765
Some limits for the channel.
Definition: gd73_codeplug.hh:692
static constexpr unsigned int nameLength()
Maximum name length.
Definition: gd73_codeplug.hh:694
Internal used offsets within the element.
Definition: gd73_codeplug.hh:699
Some limits.
Definition: gd73_codeplug.hh:857
static constexpr unsigned int contactCount()
The maximum number of contacts.
Definition: gd73_codeplug.hh:859
Some internal offsets within the contact bank.
Definition: gd73_codeplug.hh:864
Some limits.
Definition: gd73_codeplug.hh:814
static constexpr unsigned int nameLength()
The maximum name length.
Definition: gd73_codeplug.hh:816
Some internal offsets within the contact.
Definition: gd73_codeplug.hh:821
Some limits.
Definition: gd73_codeplug.hh:1222
static constexpr TimeRange callHangTime()
The range of call hang times.
Definition: gd73_codeplug.hh:1224
static constexpr IntRange activeRetires()
The range of active retries.
Definition: gd73_codeplug.hh:1232
static constexpr IntRange txPreambles()
The maximum number of TX preambles.
Definition: gd73_codeplug.hh:1234
static constexpr TimeRange activeWaitTime()
The range of active wait times.
Definition: gd73_codeplug.hh:1228
Some internal offsets within the scan list bank.
Definition: gd73_codeplug.hh:1239
Some limits.
Definition: gd73_codeplug.hh:1560
static constexpr unsigned int memberCount()
The number of members.
Definition: gd73_codeplug.hh:1562
Some internal offsets within the number bank.
Definition: gd73_codeplug.hh:1567
Some limits.
Definition: gd73_codeplug.hh:1527
static constexpr unsigned int digits()
Maximum number of digita.
Definition: gd73_codeplug.hh:1529
Internal used offsets within the bank.
Definition: gd73_codeplug.hh:1534
Some limits.
Definition: gd73_codeplug.hh:1623
static constexpr unsigned int memberCount()
The number of members.
Definition: gd73_codeplug.hh:1625
Some internal offsets within the number bank.
Definition: gd73_codeplug.hh:1630
Internal used offsets within the element.
Definition: gd73_codeplug.hh:1594
Some limits.
Definition: gd73_codeplug.hh:1493
static constexpr unsigned int memberCount()
The number of members.
Definition: gd73_codeplug.hh:1495
Some internal offsets within the message bank.
Definition: gd73_codeplug.hh:1500
Some limits.
Definition: gd73_codeplug.hh:1445
static constexpr TimeRange toneDuration()
Range for tone duration.
Definition: gd73_codeplug.hh:1449
static constexpr TimeRange pauseDuration()
Range for pause duration.
Definition: gd73_codeplug.hh:1453
static constexpr TimeRange deadTime()
Rang of dead time.
Definition: gd73_codeplug.hh:1457
static constexpr Interval preambleDuration()
Maximum preamble duration in ms.
Definition: gd73_codeplug.hh:1447
Internal used offsets within the bank.
Definition: gd73_codeplug.hh:1464
Some limits.
Definition: gd73_codeplug.hh:1316
static constexpr unsigned int keys()
The maximum number of keys.
Definition: gd73_codeplug.hh:1318
Internal used offsets within the bank.
Definition: gd73_codeplug.hh:1323
Internal used offsets within the bank.
Definition: gd73_codeplug.hh:1283
Some limits.
Definition: gd73_codeplug.hh:960
static constexpr unsigned int memberCount()
The maximum number of members.
Definition: gd73_codeplug.hh:962
Some internal offsets within the group list bank.
Definition: gd73_codeplug.hh:967
Some limits.
Definition: gd73_codeplug.hh:912
static constexpr unsigned int memberCount()
The maximum number of members.
Definition: gd73_codeplug.hh:916
static constexpr unsigned int nameLength()
The maximum name length.
Definition: gd73_codeplug.hh:914
Some internal offsets within the group list.
Definition: gd73_codeplug.hh:921
Some limits.
Definition: gd73_codeplug.hh:97
static constexpr unsigned int modelNumber()
Maximum length of model number.
Definition: gd73_codeplug.hh:105
static constexpr unsigned int serial()
Maximum length of serial number.
Definition: gd73_codeplug.hh:99
static constexpr unsigned int softwareVersion()
Maximum length of software version.
Definition: gd73_codeplug.hh:107
static constexpr unsigned int modelName()
Maximum length of model name.
Definition: gd73_codeplug.hh:101
static constexpr unsigned int deviceID()
Maximum length of device id.
Definition: gd73_codeplug.hh:103
Internal offsets within the element.
Definition: gd73_codeplug.hh:112
Some limits.
Definition: gd73_codeplug.hh:1410
static constexpr unsigned int memberCount()
The maximum number of members.
Definition: gd73_codeplug.hh:1412
Some internal offsets within the message bank.
Definition: gd73_codeplug.hh:1417
Some limits.
Definition: gd73_codeplug.hh:1360
static constexpr unsigned int messageLength()
The maximum message length.
Definition: gd73_codeplug.hh:1362
Internal used offsets within the bank.
Definition: gd73_codeplug.hh:1367
Internal used offsets within the codeplug.
Definition: gd73_codeplug.hh:1708
Internal offsets within the element.
Definition: gd73_codeplug.hh:157
Some limits.
Definition: gd73_codeplug.hh:1149
static constexpr unsigned int memberCount()
The maximum number of members.
Definition: gd73_codeplug.hh:1151
Some internal offsets within the scan list bank.
Definition: gd73_codeplug.hh:1156
Some limits.
Definition: gd73_codeplug.hh:1086
static constexpr unsigned int nameLength()
The maximum name length.
Definition: gd73_codeplug.hh:1088
static constexpr unsigned int memberCount()
The maximum number of members.
Definition: gd73_codeplug.hh:1090
static TimeRange holdTime()
The range of hold times.
Definition: gd73_codeplug.hh:1092
Some internal offsets within the scan list bank.
Definition: gd73_codeplug.hh:1099
Possible programmable key function.
Definition: gd73_codeplug.hh:184
Some limits of the settings.
Definition: gd73_codeplug.hh:361
static constexpr unsigned int bootTextLine()
Maximum length of the boot text lines.
Definition: gd73_codeplug.hh:383
static constexpr unsigned int name()
Maximum name length.
Definition: gd73_codeplug.hh:363
static constexpr TimeRange longPressDuration()
Long-press duration range.
Definition: gd73_codeplug.hh:387
static constexpr TimeRange tot()
Transmit time-out range.
Definition: gd73_codeplug.hh:365
static constexpr TimeRange loneWorkerResponse()
Lone-worker response time-out range.
Definition: gd73_codeplug.hh:375
static constexpr TimeRange powerSaveTimeout()
Power-save timeout.
Definition: gd73_codeplug.hh:369
static constexpr IntRange toneVolume()
Value range for tone-volumes.
Definition: gd73_codeplug.hh:385
static constexpr unsigned int pin()
Maximum read/write lock pin size.
Definition: gd73_codeplug.hh:373
static constexpr TimeRange loneWorkerRemindPeriod()
Lone-worker remind period range.
Definition: gd73_codeplug.hh:379
Internal offsets within the element.
Definition: gd73_codeplug.hh:394
Some limits for the zone bank.
Definition: gd73_codeplug.hh:512
static constexpr unsigned int zoneCount()
Maximum number of zones.
Definition: gd73_codeplug.hh:514
Internal offsets within the element.
Definition: gd73_codeplug.hh:519
Some limits for the element.
Definition: gd73_codeplug.hh:464
static constexpr unsigned int nameLength()
Maximum name length.
Definition: gd73_codeplug.hh:466
static constexpr unsigned int channelCount()
Maximum number of channels per zone.
Definition: gd73_codeplug.hh:468
Internal offsets within the zone element.
Definition: gd73_codeplug.hh:473