1 package iotcode.interfaces;
3 // Standard Java Packages
7 import java.rmi.Remote;
8 import java.rmi.RemoteException;
10 // Checker annotations
11 import iotchecker.qual.*;
14 /** Class Moisture sensor interface for Moisture sensor devices.
16 * @author Ali Younis <ayounis @ uci.edu>
20 public interface MoistureSensor extends Remote {
22 /** Method to get the latests moisture reading from the sensor
24 * @return [float] Moisture as a percentage.
26 public float getMoisture() throws RemoteException;
29 /** Method to get the latests moisture reading timestamp from the sensor
31 * @return [Date] timestamp of latest moisture reading, null if no reading occurred yet.
33 public Date getTimestampOfLastReading() throws RemoteException;
36 /** Method to initialize the moisture sensor.
40 * @return [void] None.
42 public void init() throws RemoteException;
45 /** Register an object to retrieve callbacks when new sensor reading is available
47 * @param _callbackTo [MoistureSensorCallback].
49 * @return [void] None.
51 public void registerCallback(@NonLocalRemote MoistureSensorCallback _callbackTo) throws RemoteException;