Cleaning up benchmarks and drivers code.
[iot2.git] / benchmarks / drivers / Java / WeatherPhoneGateway / WeatherPhoneGateway.java
index 7ac5b85be439da3b652cf1c6ecc532db1994a218..1d5944cd17fed9b638eb21b72f66e633fddd2ade 100644 (file)
@@ -18,9 +18,6 @@ import iotruntime.slave.IoTDeviceAddress;
 import iotcode.annotation.*;
 import iotcode.interfaces.*;
 
-// Checker annotations
-//import iotchecker.qual.*;
-
 /** WeatherPhoneProxy that uses IoTRemoteCall and WeatherInfo class
  *  to get information from a phone app
  *
@@ -46,23 +43,6 @@ public class WeatherPhoneGateway implements WeatherGateway {
        /**
         * Constructor
         */
-       /*public WeatherPhoneGateway() throws RemoteException, UnknownHostException {
-
-               iotDevAdd = new IoTDeviceAddress("192.168.2.101", 1234, 8000);
-               weatherInfo = new WeatherInfo();
-
-               // Launch IoTRemoteCall server in a separate thread
-               workerThread = new Thread(new Runnable() {
-                       public void run() {
-                               iotRemCall = new IoTRemoteCall(WeatherInfoInterface.class, 
-                                       weatherInfo, iotDevAdd.getDestinationPortNumber());
-                       }
-               });
-               workerThread.start();
-
-               System.out.println("PhoneGateway is started");
-       
-       }*/
        public WeatherPhoneGateway() {
        }
 
@@ -74,10 +54,6 @@ public class WeatherPhoneGateway implements WeatherGateway {
                // Get address
                Iterator it = ph_address.iterator();
                iotDevAdd = (IoTDeviceAddress) it.next();
-//             try {
-//                     iotDevAdd = new IoTDeviceAddress("192.168.2.101", 1234, 8000);
-//             } catch (Exception ex) {
-//             }
                System.out.println("Address: " + iotDevAdd.getCompleteAddress());
                System.out.println("Source port: " + iotDevAdd.getSourcePortNumber());
                System.out.println("Destination port: " + iotDevAdd.getDestinationPortNumber());
@@ -158,14 +134,9 @@ public class WeatherPhoneGateway implements WeatherGateway {
                                System.out.println("We get into doCallbacks!");
                                System.out.println("weatherInfo.isNewDataAvailable(): " + weatherInfo.isNewDataAvailable());
                                for (WeatherGatewaySmartCallback c : listPGWCallback) {
-                                       //try {
-                                               //c.informationRetrieved(this);
-                                               c.informationRetrieved(this.getInchesPerWeek(), this.getWeatherZipCode(), this.getDaysToWaterOn(), this.getInchesPerMinute());
-                                       //} catch (RemoteException ex) {
-                                       //      ex.printStackTrace();
-                                       //}
-                                       // We have read data - set this back to false
+                                       c.informationRetrieved(this.getInchesPerWeek(), this.getWeatherZipCode(), this.getDaysToWaterOn(), this.getInchesPerMinute());
                                }
+                               // We have read data - set this back to false
                                weatherInfo.setNewDataAvailable(false);
                        }
                }
@@ -202,12 +173,4 @@ public class WeatherPhoneGateway implements WeatherGateway {
 
                return weatherInfo.getInchesPerMinute();
        }
-
-
-//     public static void main(String[] args) throws UnknownHostException, RemoteException {
-
-//             @LocalRemote WeatherPhoneGateway wpg = new @LocalRemote WeatherPhoneGateway();
-//             wpg.init();
-//             wpg.start();
-//     }
 }