Class WifiContext

  • All Implemented Interfaces:
    SensorValueListener

    public class WifiContext
    extends Context
    implements SensorValueListener
    WifiContext - a WiFi-based context class
    This class is used to detect whether a wifi given ssid is currently connected. This class extends the base class Context. Value updates are obtained from WifiSensor via SensorValueListener
    • Constructor Detail

      • WifiContext

        public WifiContext​(java.lang.String name,
                           java.lang.String ssid)
        Creates a ActivityContext
        Parameters:
        name - the name of the context
        ssid - the Wifi network service set id (SSID).
      • WifiContext

        public WifiContext​(java.lang.String id,
                           java.lang.String name,
                           java.lang.String ssid)
        Creates a ActivityContext
        Parameters:
        id - the identifier of the context
        name - the name of the context
        ssid - the Wifi network service set id (SSID).
    • Method Detail

      • setSsid

        public void setSsid​(java.lang.String ssid)
        Sets the service set id (SSID)
        Parameters:
        ssid - the SSID
      • getSsid

        public java.lang.String getSsid()
        Gets the service set id (SSID)
        Returns:
        the SSID
      • receiveValue

        public void receiveValue​(java.lang.Object value)
        Receive the current wifi's ssid from the WifiSensor WifiSensor. In order to receive the updates, this context should be registered as a SensorValueListener for the sensor.
        Specified by:
        receiveValue in interface SensorValueListener
        Parameters:
        value - the received value