aba8819e76d97c22f3970120981d1e844d3d229f
[iot2.git] / benchmarks / other / ZigbeeTest / SmartthingsSensor.java
1 // Standard Java Packages
2 import java.util.Date;
3
4 //RMI packages
5 import java.rmi.Remote;
6 import java.rmi.RemoteException;
7
8 // Checker annotations
9 //import iotchecker.qual.*;
10
11
12 /** Class Smartthings sensor interface for Smartthings sensor devices.
13  *
14  * @author      Rahmadi Trimananda <rtrimana @ uci.edu>, Changwoo Lee
15  * @version     1.0
16  * @since       2016-12-21
17  */
18 public interface SmartthingsSensor extends Remote {
19
20         /** Method to get the latests moisture reading from the sensor
21          *
22          *   @return [float] Moisture as a percentage.
23          */
24         public int getValue() throws RemoteException;
25
26
27         /** Method to probe the sensor for active value
28          *
29          *   @return [boolean] True means sensor is actively detecting something.
30          */
31         public boolean isActiveValue() throws RemoteException;
32
33
34         /** Method to get the latests moisture reading timestamp from the sensor
35          *
36          *   @return [Date] timestamp of latest moisture reading, null if no reading occurred yet.
37          */
38         public long getTimestampOfLastReading() throws RemoteException;
39
40
41         /** Method to initialize the moisture sensor.
42          *
43          *   @param None.
44          *
45          *   @return [void] None.
46          */
47         public void init() throws RemoteException;
48
49         public void setId(int id);
50
51         public int getId();
52
53         /** Register an object to retrieve callbacks when new sensor reading is available
54          *
55          *   @param _callbackTo [MoistureSensorCallback].
56          *
57          *   @return [void] None.
58          */
59         public void registerCallback(SmartthingsSensorCallback _callbackTo) throws RemoteException;
60 }
61
62
63
64
65
66
67
68
69
70
71
72
73
74