forked from Sepanta/console-emulator
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
547 B
31 lines
547 B
#ifndef PUSHBUTTON_H
|
|
#define PUSHBUTTON_H
|
|
|
|
#define PROTOCOL_LENGTH 8
|
|
#define MESSAGE_DIRECTION 0x00
|
|
#define PushButtonDataLength 0x01
|
|
#define PushButtonType 0x04
|
|
#define PushButtonPush 0x01
|
|
#define PushButtonRelease 0x00
|
|
#define TIME_TAG 0x00
|
|
|
|
#include "Led.h"
|
|
|
|
class PushButton
|
|
{
|
|
private:
|
|
char _functionCode;
|
|
Led _led;
|
|
|
|
QByteArray generateCode(bool isPressed);
|
|
|
|
public:
|
|
PushButton(char functionCode);
|
|
PushButton(char functionCode, char ledFunctionCode);
|
|
|
|
QByteArray press();
|
|
QByteArray release();
|
|
Led* getLed();
|
|
};
|
|
|
|
#endif //PUSHBUTTON_H
|
|
|