X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=protocols%2Fnokia32protocol.h;fp=protocols%2Fnokia32protocol.h;h=c53a6095adc0e94765139212f19111b01a983882;hb=d724312c55dabe2c72175e88abf694880312fac4;hp=0000000000000000000000000000000000000000;hpb=fb8932101ae4f67f18ffa31073d51823cc872ac8;p=pierogi diff --git a/protocols/nokia32protocol.h b/protocols/nokia32protocol.h new file mode 100644 index 0000000..c53a609 --- /dev/null +++ b/protocols/nokia32protocol.h @@ -0,0 +1,60 @@ +#ifndef NOKIA32PROTOCOL_H +#define NOKIA32PROTOCOL_H + +#include "spaceprotocol.h" + +class PIRRX51Hardware; + +// +// The Nokia32 protocol is a somewhat unusual 32-bit protocol. It encodes +// pairs of bits rather than individual bits. +// + +class Nokia32Protocol: public PIRProtocol +{ +public: + Nokia32Protocol( + QObject *guiObject, + unsigned int index); + +public slots: + void startSendingCommand( + unsigned int threadableID, + PIRKeyName command); + +private: + int generateStandardCommand( + const PIRKeyBits &bits, + PIRRX51Hardware &device); + + int pushBits( + const CommandSequence &bits, + PIRRX51Hardware &rx51device); + + int pushToggleAndBits( + const CommandSequence &bits, + PIRRX51Hardware &rx51device); + + int pushDoubleBit( + bool firstBit, + bool secondBit, + PIRRX51Hardware &rx51device); + + unsigned int zeroPulse; + unsigned int zeroSpace; + unsigned int onePulse; + unsigned int oneSpace; + unsigned int twoPulse; + unsigned int twoSpace; + unsigned int threePulse; + unsigned int threeSpace; + + unsigned int headerPulse; + unsigned int headerSpace; + + unsigned int trailerPulse; + + unsigned int keypressCount; +}; + +#endif // NOKIA32PROTOCOL_H