Adjusting C++ files to compile with gcc 4.9.3
[iot2.git] / benchmarks / drivers / Cpp / LifxLightBulb / LifxLightBulb.cpp
index 38edcff..976ec54 100644 (file)
@@ -339,7 +339,6 @@ void LifxLightBulb::receivedPacket(char* packetData) {
        recHeader.setFromBytes(headerBytes);
 
        // load the payload bytes (strip away the header)
-       //char payloadBytes[recHeader.getSize()];
        char* payloadBytes = new char[recHeader.getSize()];
        for (int i = 36; i < recHeader.getSize(); i++) {
                payloadBytes[i - 36] = packetData[i];
@@ -347,6 +346,7 @@ void LifxLightBulb::receivedPacket(char* packetData) {
 
        int type = recHeader.getType();
        //cout << "Received: " << type << endl;
+       log << "Received: " << type << endl;
 
        DeviceStateService* dat = NULL;
        switch (type) {
@@ -1219,12 +1219,12 @@ void adjustBright(LifxLightBulb *llb) {
 }
 
 
-int main(int argc, char *argv[])
+/*int main(int argc, char *argv[])
 {
        string macAddress1 = "D073D5128E300000";
        //string macAddress = "D073D50241DA0000";
-       string devIPAddress1 = "192.168.2.126";
-       //string devIPAddress = "192.168.2.232";
+       string devIPAddress1 = "192.168.1.126";
+       //string devIPAddress = "192.168.1.232";
        IoTDeviceAddress* devAddress1 = new IoTDeviceAddress(devIPAddress1, 12345, 56700, false, false);
        unordered_set<void*>* myset1 = new unordered_set<void*>();
        myset1->insert(devAddress1);
@@ -1233,14 +1233,16 @@ int main(int argc, char *argv[])
        LifxLightBulb *llb1 = new LifxLightBulb(setDevAddress1, macAddress1);
        cout << "Generated LifxLightBulb object!" << endl;
        llb1->init();
+       cout << "Initialized!" << endl;
        llb1->turnOn();
+       cout << "Turning on!" << endl;
        onOff(llb1);
-       adjustTemp(llb1);
-       adjustBright(llb1);
-//     llb->turnOff();
+//     adjustTemp(llb1);
+//     adjustBright(llb1);
+       llb1->turnOff();
 
 //     delete devAddress1;
 //     delete llb1;
 
        return 0;
-}
+}*/