--- /dev/null
+public interface Sprinkler {
+
+ public void init();
+ public void setZone(int _zone, boolean _onOff, int _onDurationSeconds);
+ public List<ZoneState> getZoneStates();
+ public int getNumberOfZones();
+ public boolean doesHaveZoneTimers();
+
+ capability Initialize {
+ description = "Initialize object";
+ method = "init()";
+ }
+
+ capability Zone {
+ description = "Manage zones";
+ method = "setZone(int _zone, boolean _onOff, int _onDurationSeconds)";
+ method = "getZoneStates()";
+ method = "getNumberOfZones()";
+ method = "doesHaveZoneTimers()";
+ }
+
+ struct ZoneState {
+ int zoneNumber;
+ boolean onOffState;
+ int duration;
+ }
+}
+
+
--- /dev/null
+
+requires Sprinkler with Initialize, Zone as interface SprinklerSmart;
+
--- /dev/null
+public interface Lawn {
+
+ capability Empty {
+ description = "Empty";
+ }
+}
+
+
--- /dev/null
+
+requires Lawn with Empty as interface LawnSmart;
+
--- /dev/null
+public interface MoistureSensorCallback {
+
+ public void newReadingAvailable(int sensorId, float moisture, long timeStampOfLastReading);
+
+ capability Callback {
+ description = "Callback method";
+ method = "newReadingAvailable(int sensorId, float moisture, long timeStampOfLastReading)";
+ }
+}
+
+
--- /dev/null
+
+requires MoistureSensorCallback with Callback as interface SensorSmartCallback;
+
--- /dev/null
+
+requires MoistureSensor with Initialize, Moisture, SensorId as interface SensorSmart;
+
--- /dev/null
+public interface MoistureSensor {
+
+ public void init();
+ public float getMoisture();
+ public long getTimestampOfLastReading();
+ public void setId(int id);
+ public int getId();
+ public void registerCallback(MoistureSensorCallback _callbackTo);
+
+ capability Initialize {
+ description = "Initialize object";
+ method = "init()";
+ method = "registerCallback(MoistureSensorCallback _callbackTo)";
+ }
+
+ capability Moisture {
+ description = "Handle moisture value";
+ method = "getMoisture()";
+ method = "getTimestampOfLastReading()";
+ }
+
+ capability SensorId {
+ description = "Manage sensor Id";
+ method = "setId(int id)";
+ method = "getId()";
+ }
+}
+
+
--- /dev/null
+public interface WeatherGatewayCallback {
+
+ public void informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute);
+
+ capability Callback {
+ description = "Callback method";
+ method = "informationRetrieved(double _inchesPerWeek, int _weatherZipCode, int _daysToWaterOn, double _inchesPerMinute)";
+ }
+}
+
+
--- /dev/null
+
+requires WeatherGatewayCallback with Callback as interface WeatherGWSmartCallback;
+
--- /dev/null
+
+requires WeatherGateway with Initialize, WeatherUpdate as interface WeatherGatewaySmart;
+
--- /dev/null
+public interface WeatherGateway {
+
+ public void init();
+ public void start();
+ public void stop();
+ public double getInchesPerWeek();
+ public int getWeatherZipCode();
+ public int getDaysToWaterOn();
+ public double getInchesPerMinute();
+ public void registerCallback(WeatherGatewayCallback _callbackTo);
+
+ capability Initialize {
+ description = "Initialize object";
+ method = "init()";
+ method = "start()";
+ method = "stop()";
+ method = "registerCallback(WeatherGatewayCallback _callbackTo)";
+ }
+
+ capability WeatherUpdate {
+ description = "Manage weather data update";
+ method = "getInchesPerWeek()";
+ method = "getWeatherZipCode()";
+ method = "getDaysToWaterOn()";
+ method = "getInchesPerMinute()";
+ }
+}
+
+