Minor fixes in LifxLightBulb driver (not fully tested yet)
[iot2.git] / benchmarks / drivers / Cpp / LifxLightBulb / LifxLightBulb.hpp
index a70a982525fcef7bc554df187ce9509eca0d8f58..489fd54033b46894ec281af304b1b0d5daa9ae77 100644 (file)
@@ -438,16 +438,16 @@ class LifxLightBulb //: public LightBulb
                                        continue;
                                }
 
-                               /*socketMutex.lock();
+                               socketMutex.lock();
 
                                char dat[1024];
-                               dat = communicationSocket.receiveData(1024);
+                               int ret = communicationSocket->receiveData(dat, 1024);
 
                                // Never forget to release!
                                socketMutex.unlock();
 
                                // A packed arrived
-                               if (dat != null) {
+                               if (ret != -1) {
                                        receivedPacket(dat);
                                }
 
@@ -459,11 +459,6 @@ class LifxLightBulb //: public LightBulb
 
                                // Wait a bit as to not tie up system resources
                                this_thread::sleep_for (chrono::milliseconds(100));
-                               } catch (Exception e) {
-
-                               }*/
-
-
                        }
                }