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 74fb11a..481611c 100644 (file)
@@ -17,6 +17,7 @@ annotation:
 PHONY += drivers
 drivers:
        $(MAKE) -C drivers/Java
+       $(MAKE) -C drivers/Cpp
 
 PHONY += Lifxtest
 Lifxtest:
index a70a982..489fd54 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 ccdb5d9..1c46ffa 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