1 #include "spaceprotocol.h"
3 #include "pirrx51hardware.h"
5 SpaceProtocol::SpaceProtocol(
14 unsigned int trailerp,
17 : PIRProtocol(guiObject, index, gaps, iclflag),
24 trailerPulse(trailerp)
29 int SpaceProtocol::pushBits(
30 const CommandSequence &bits,
31 PIRRX51Hardware &rx51device)
34 CommandSequence::const_iterator i = bits.begin();
35 while (i != bits.end())
39 // Send the pulse for "One":
40 rx51device.addPair(onePulse, oneSpace);
41 duration += (onePulse + oneSpace);
45 // Send the pulse for "Zero":
46 rx51device.addPair(zeroPulse, zeroSpace);
47 duration += (zeroPulse + zeroSpace);
56 int SpaceProtocol::pushReverseBits(
57 const CommandSequence &bits,
58 PIRRX51Hardware &rx51device)
61 CommandSequence::const_reverse_iterator i = bits.rbegin();
62 while (i != bits.rend())
66 // Send the pulse for "One":
67 rx51device.addPair(onePulse, oneSpace);
68 duration += (onePulse + oneSpace);
72 // Send the pulse for "Zero":
73 rx51device.addPair(zeroPulse, zeroSpace);
74 duration += (zeroPulse + zeroSpace);
83 int SpaceProtocol::pushInvertedBits(
84 const CommandSequence &bits,
85 PIRRX51Hardware &rx51device)
88 CommandSequence::const_iterator i = bits.begin();
89 while (i != bits.end())
93 // Send the pulse for "Zero":
94 rx51device.addPair(zeroPulse, zeroSpace);
95 duration += (zeroPulse + zeroSpace);
99 // Send the pulse for "One":
100 rx51device.addPair(onePulse, oneSpace);
101 duration += (onePulse + oneSpace);
110 int SpaceProtocol::pushInvertedReverseBits(
111 const CommandSequence &bits,
112 PIRRX51Hardware &rx51device)
115 CommandSequence::const_reverse_iterator i = bits.rbegin();
116 while (i != bits.rend())
120 // Send the pulse for "Zero":
121 rx51device.addPair(zeroPulse, zeroSpace);
122 duration += (zeroPulse + zeroSpace);
126 // Send the pulse for "One":
127 rx51device.addPair(onePulse, oneSpace);
128 duration += (onePulse + oneSpace);