Keyset update
[pierogi] / protocols / xmpprotocol.h
1 #ifndef XMPPROTOCOL_H
2 #define XMPPROTOCOL_H
3
4 #include "pirprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // The XMP protocol is a large, fairly complex protocol, but seems to be
10 // gaining popularity in a variety of modern devices.
11 //
12
13 class XMPProtocol: public PIRProtocol
14 {
15 public:
16   XMPProtocol(
17     QObject *guiObject,
18     unsigned int index,
19     unsigned int sd1,
20     unsigned int sd2,
21     unsigned int oem,
22     unsigned int d,
23     bool hasFF);
24
25 public slots:
26   void startSendingCommand(
27     unsigned int threadableID,
28     PIRKeyName command);
29
30 private:
31   int generateStandardCommand(
32     const PIRKeyBits &bits,
33     PIRRX51Hardware &device);
34
35   int generateRepeatCommand(
36     const PIRKeyBits &bits,
37     PIRRX51Hardware &device);
38
39   int generateFinalCommand(
40     const PIRKeyBits &bits,
41     PIRRX51Hardware &device);
42
43   unsigned int calculateChecksumOne();
44
45   unsigned int calculateChecksumTwo(
46     unsigned int toggle,
47     const CommandSequence &firstCode,
48     const CommandSequence &secondCode);
49
50   int pushHalfByte(
51     unsigned int halfByte,
52     PIRRX51Hardware &rx51device);
53
54   int pushFullByte(
55     unsigned int fullByte,
56     PIRRX51Hardware &rx51device);
57
58   int pushBits(
59     const CommandSequence &bits,
60     PIRRX51Hardware &rx51device);
61
62   unsigned int subDeviceOne;
63   unsigned int subDeviceTwo;
64   unsigned int oemCode;
65   unsigned int deviceCode;
66   bool hasFinalFrame;
67 };
68
69 #endif // XMPPROTOCOL_H