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];
int type = recHeader.getType();
//cout << "Received: " << type << endl;
+ log << "Received: " << type << endl;
DeviceStateService* dat = NULL;
switch (type) {
}
-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);
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;
-}
+}*/