File: openuv380_codeplug.hh

package info (click to toggle)
qdmr 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,420 kB
  • sloc: cpp: 95,929; xml: 10,749; python: 1,108; makefile: 78; sh: 9
file content (111 lines) | stat: -rw-r--r-- 5,068 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#ifndef OPENUV380_CODEPLUG_HH
#define OPENUV380_CODEPLUG_HH

#include "opengd77base_codeplug.hh"
#include "opengd77_extension.hh"


/** Represents, encodes and decodes the device specific codeplug for Open MD-UV380 firmware.
 *
 * This codeplug is almost identical to the original GD77 codeplug.
 *
 * @ingroup ogd77 */
class OpenUV380Codeplug: public OpenGD77BaseCodeplug
{
  Q_OBJECT

public:
  /** Constructs an empty codeplug for the Open MD-UV380. */
  explicit OpenUV380Codeplug(QObject *parent=nullptr);

public:
  void clearGeneralSettings();
  bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearDTMFSettings();
  bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearAPRSSettings();
  bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack());
  bool linkAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearContacts();
  bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearDTMFContacts();
  bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearChannels();
  bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack());
  bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearBootSettings();
  bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearVFOSettings();

  void clearZones();
  bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool createZones(Context &ctx, const ErrorStack &err=ErrorStack());
  bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack());

  void clearGroupLists();
  bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
  bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
  bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());

public:
  /** Some Limits for this codeplug. */
  struct Limit: public Element::Limit {
    /** Number of channel banks. */
    static constexpr unsigned int channelBanks() { return 8; }
  };

protected:
  /** Internal used image indices. */
  struct ImageIndex {
    /// @cond DO_NOT_DOCUEMNT
    static constexpr unsigned int settings()           { return FLASH; }
    static constexpr unsigned int dtmfSettings()       { return FLASH; }
    static constexpr unsigned int aprsSettings()       { return FLASH; }
    static constexpr unsigned int dtmfContacts()       { return FLASH; }
    static constexpr unsigned int channelBank0()       { return FLASH; }
    static constexpr unsigned int bootSettings()       { return FLASH; }
    static constexpr unsigned int vfoA()               { return FLASH; }
    static constexpr unsigned int vfoB()               { return FLASH; }
    static constexpr unsigned int zoneBank()           { return FLASH; }
    static constexpr unsigned int additionalSettings() { return FLASH; }
    static constexpr unsigned int channelBank1()       { return FLASH; }
    static constexpr unsigned int contacts()           { return FLASH; }
    static constexpr unsigned int groupLists()         { return FLASH; }
    /// @endcond
  };

  /** Some offsets. */
  struct Offset {
    /// @cond DO_NOT_DOCUEMNT
    static constexpr unsigned int settings()           { return 0x00000080; }
    static constexpr unsigned int dtmfSettings()       { return 0x00001470; }
    static constexpr unsigned int aprsSettings()       { return 0x00001588; }
    static constexpr unsigned int dtmfContacts()       { return 0x00002f88; }
    static constexpr unsigned int channelBank0()       { return 0x00003780; } // Channels 1-128
    static constexpr unsigned int bootSettings()       { return 0x00007518; }
    static constexpr unsigned int vfoA()               { return 0x00007590; }
    static constexpr unsigned int vfoB()               { return 0x000075c8; }
    static constexpr unsigned int zoneBank()           { return 0x00008010; }
    static constexpr unsigned int additionalSettings() { return 0x00020000; }
    static constexpr unsigned int channelBank1()       { return 0x0009b1b0; } // Channels 129-1024
    static constexpr unsigned int contacts()           { return 0x000a7620; }
    static constexpr unsigned int groupLists()         { return 0x000ad620; }
    /// @endcond
  };
};

#endif // OPENUV380_CODEPLUG_HH