Minor fixes in LifxLightBulb driver (not fully tested yet)
authorrtrimana <rtrimana@uci.edu>
Tue, 10 Jan 2017 22:57:31 +0000 (14:57 -0800)
committerrtrimana <rtrimana@uci.edu>
Tue, 10 Jan 2017 22:57:31 +0000 (14:57 -0800)
benchmarks/Makefile
benchmarks/drivers/Cpp/LifxLightBulb/LifxLightBulb.hpp
iotjava/iotruntime/cpp/IoTUDP.hpp

index 74fb11afd006781543db8d19b062e0a2a92879a7..481611c19bc07f1fb938a674293491d1210264ce 100644 (file)
@@ -17,6 +17,7 @@ annotation:
 PHONY += drivers
 drivers:
        $(MAKE) -C drivers/Java
+       $(MAKE) -C drivers/Cpp
 
 PHONY += Lifxtest
 Lifxtest:
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) {
-
-                               }*/
-
-
                        }
                }
 
index ccdb5d92ec6c3e2bf26f5fb14892121a140a42ce..1c46ffa599557a5e090fd6562424517b80fb3a23 100644 (file)
@@ -62,7 +62,7 @@ class IoTUDP
                int receiveData(void* buffer, int iMaxDataLength) {
 
                        unsigned short destinationPort = (unsigned short) iDstPort;
-                       socket->recvFrom(buffer, iMaxDataLength, strHostAddress, destinationPort);
+                       return socket->recvFrom(buffer, iMaxDataLength, strHostAddress, destinationPort);
                }
 };
 #endif