Class WifiContext
- java.lang.Object
-
- eu.h2020.helios_social.core.context.Context
-
- eu.h2020.helios_social.core.context.ext.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 Summary
Constructors Constructor Description WifiContext(java.lang.String name, java.lang.String ssid)
Creates a ActivityContextWifiContext(java.lang.String id, java.lang.String name, java.lang.String ssid)
Creates a ActivityContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSsid()
Gets the service set id (SSID)void
receiveValue(java.lang.Object value)
Receive the current wifi's ssid from the WifiSensorWifiSensor
.void
setSsid(java.lang.String ssid)
Sets the service set id (SSID)-
Methods inherited from class eu.h2020.helios_social.core.context.Context
addSensor, addSensors, getContextListeners, getId, getName, getSensors, isActive, registerContextListener, removeSensor, setActive, setName, unregisterContextListener
-
-
-
-
Constructor Detail
-
WifiContext
public WifiContext(java.lang.String name, java.lang.String ssid)
Creates a ActivityContext- Parameters:
name
- the name of the contextssid
- 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 contextname
- the name of the contextssid
- 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 WifiSensorWifiSensor
. In order to receive the updates, this context should be registered as a SensorValueListener for the sensor.- Specified by:
receiveValue
in interfaceSensorValueListener
- Parameters:
value
- the received value
-
-