Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: Light.h
- Revision:
- 91:8732d54328ae
- Parent:
- 87:e9d77e9f9eae
- Child:
- 92:330746c526b7
--- a/Light.h Thu Mar 13 00:07:59 2014 +0000 +++ b/Light.h Thu Mar 13 17:25:18 2014 +0000 @@ -41,7 +41,12 @@ int m_ioc_id; PhilipsLight *m_pl; - + + Thread *m_blinking_thread; + int m_current_state; + int m_last_state; + bool m_is_blinking; + public: Light(ErrorHandler *error_handler,Transport *transports[NUM_TRANSPORTS],int instance,void *endpoint); virtual ~Light(); @@ -58,18 +63,26 @@ virtual void on(); virtual void off(); - virtual void blink(); + void blink(); virtual void dim(int value); void setIOCID(int id); int getIOCID(); + void blinkLight(); + protected: void *getDimmerAction(); void *getSwitchAction(); private: PhilipsLight *pl(); + void startBlinking(); + void stopBlinking(); + void manageBlinkingThread(); + void startBlinkingThread(); + void stopBlinkingThread(); + }; #endif // _LIGHT_H_ \ No newline at end of file