// Driver LifxLightBulb
// Implemented based on LightBulb virtual class (interface)
-//std::atomic
-//std::atomic<bool> didAlreadyInit(false);
-//std::atomic<bool> didGetBulbVersion(false);
-
class LifxLightBulb : public LightBulb
{
private:
IoTUDP *communicationSocket;
char bulbMacAddress[8];
//TODO:
- //static Semaphore socketMutex = new Semaphore(1);
bool sendSocketFlag = false;
// Current Bulb Values
int currentTemperature = 9000;
bool bulbIsOn = false;
- //std::atomic
- //atomic<bool> didAlreadyInit;
- bool didAlreadyInit;
- //atomic<bool> didGetBulbVersion;
- bool didGetBulbVersion;
+ bool didAlreadyInit = false;
+ bool didGetBulbVersion = false;
// Mutex locks
mutex socketMutex;
// Constructor
LifxLightBulb();
- LifxLightBulb(uint8_t* ipAddress, string macAddress, int srcPort);
- //LifxLightBulb(IoTSet<IoTDeviceAddress*>* _devAddress, string macAddress);
- LifxLightBulb(IoTSet<void*>* _devAddress, string macAddress);
+ LifxLightBulb(IPAddress ipAddress, char* macAddress, int srcPort);
~LifxLightBulb();
// Initialize the lightbulb
void init();