lorawan/Switchable_Device.h
2016-09-14 20:02:05 +02:00

24 lines
458 B
C++

#ifndef SWITCHABLE_DEVICE_H
#define SWITCHABLE_DEVICE_H
typedef void(*voidFuncPtr)(void);
class SwitchableDevice {
private:
voidFuncPtr _onMethod;
voidFuncPtr _offMethod;
public:
SwitchableDevice();
void setOnMethod(voidFuncPtr onMethod);
void setOffMethod(voidFuncPtr offMethod);
void setSwitchMethods(voidFuncPtr onMethod, voidFuncPtr offMethod);
void clearSwitchMethods();
void on();
void off();
};
#endif // SWITCHABLE_DEVICE_H