1 // Standard Java Packages
5 import java.rmi.Remote;
6 import java.rmi.RemoteException;
9 //import iotchecker.qual.*;
12 /** Class Smartthings sensor interface for Smartthings sensor devices.
14 * @author Rahmadi Trimananda <rtrimana @ uci.edu>, Changwoo Lee
18 public interface SmartthingsSensor extends Remote {
20 /** Method to get the latests moisture reading from the sensor
22 * @return [float] Moisture as a percentage.
24 public int getValue() throws RemoteException;
27 /** Method to probe the sensor for active value
29 * @return [boolean] True means sensor is actively detecting something.
31 public boolean isActiveValue() throws RemoteException;
34 /** Method to get the latests moisture reading timestamp from the sensor
36 * @return [Date] timestamp of latest moisture reading, null if no reading occurred yet.
38 public long getTimestampOfLastReading() throws RemoteException;
41 /** Method to initialize the moisture sensor.
45 * @return [void] None.
47 public void init() throws RemoteException;
50 /** Register an object to retrieve callbacks when new sensor reading is available
52 * @param _callbackTo [MoistureSensorCallback].
54 * @return [void] None.
56 public void registerCallback(SmartthingsSensorCallback _callbackTo) throws RemoteException;