X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=benchmarks%2Fdrivers%2FJava%2FLifxLightBulb%2FLifxLightBulb.java;h=909a90c4b7e936ba86604157d34c9670add98270;hb=258a0230ed01ad0927ed54d37aafa3dd37da5af0;hp=c131bfa5e5f1a594166257912f6f0b55438ab3bb;hpb=3e3e0d0e468e7f791963c1c14e06966563d3f65c;p=iot2.git diff --git a/benchmarks/drivers/Java/LifxLightBulb/LifxLightBulb.java b/benchmarks/drivers/Java/LifxLightBulb/LifxLightBulb.java index c131bfa..909a90c 100644 --- a/benchmarks/drivers/Java/LifxLightBulb/LifxLightBulb.java +++ b/benchmarks/drivers/Java/LifxLightBulb/LifxLightBulb.java @@ -102,12 +102,12 @@ public class LifxLightBulb implements LightBulb { /*public LifxLightBulb(IoTUDP udp, byte[] macAddress) { communicationSockect = udp; bulbMacAddress = macAddress; - } + }*/ public LifxLightBulb(IoTSet _lb_addresses, String macAddress) { this(macAddress); lb_addresses = _lb_addresses; - }*/ + } public LifxLightBulb(String macAddress) { communicationSockect = null; @@ -1200,34 +1200,29 @@ public class LifxLightBulb implements LightBulb { } - /*public static void main(String[] args) throws Exception { + /* TODO: Uncomment this part to do light bulb test + public static void main(String[] args) throws Exception { System.out.println("Executing main function!"); - IoTDeviceAddress iotDevAdd = new IoTDeviceAddress("192.168.2.126", 12345, 56700, false, false); + IoTDeviceAddress iotDevAdd = new IoTDeviceAddress(args[0], 12345, 56700, false, false); Set set = new HashSet(); set.add(iotDevAdd); IoTSet iotset = new IoTSet(set); LifxLightBulb lb = new LifxLightBulb(iotset, "D073D5128E300000"); - lb.init(); + try { + lb.init(); + Thread.sleep(1000); + for (int i = 0; i < 2; i++) { + lb.turnOff(); + System.out.println("Turning off!"); + Thread.sleep(1000); + lb.turnOn(); + System.out.println("Turning on!"); + Thread.sleep(1000); + } + lb.turnOff(); + } catch(Exception ex) { + ex.printStackTrace(); + } }*/ } - - - - - - - - - - - - - - - - - - - -