X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iot2.git;a=blobdiff_plain;f=benchmarks%2Fdrivers%2FCpp%2FLifxLightBulb%2FLifxLightBulb.cpp;h=976ec547216f0d6c8865ce9ccf67e0f9ebafa30c;hp=38edcffa727a0a94391325fb1aface8b54f667f9;hb=12cd536cebfeea6c5df468170b6388a9f6ff2f12;hpb=1dfa63ff48c8f5695f64046585831d5a7b886d7c;ds=sidebyside diff --git a/benchmarks/drivers/Cpp/LifxLightBulb/LifxLightBulb.cpp b/benchmarks/drivers/Cpp/LifxLightBulb/LifxLightBulb.cpp index 38edcff..976ec54 100644 --- a/benchmarks/drivers/Cpp/LifxLightBulb/LifxLightBulb.cpp +++ b/benchmarks/drivers/Cpp/LifxLightBulb/LifxLightBulb.cpp @@ -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* myset1 = new unordered_set(); 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; -} +}*/