| Modifier and Type | Field and Description |
|---|---|
Semaphore |
connected_semaphore
semaphore for WiFi connected reading - released by GPS handler
|
StringBuffer |
MAC_reading
current MAC reading
|
Semaphore |
mac_semaphore
semaphore for MAC reading - released by GPS handler
|
Semaphore |
nearby_semaphore
semaphore for nearby thread - released by GPS handler
|
StringBuffer |
RSSI_reading
current RSSI reading
|
Semaphore |
rssi_semaphore
semaphore for RSSI reading - released by GPS handler
|
StringBuffer |
SSID_reading
current SSID reading
|
Semaphore |
ssid_semaphore
semaphore for SSID reading - released by GPS handler
|
StringBuffer |
WLAN_reading
current WLAN reading
|
Semaphore |
wlan_semaphore
semaphore for WiFi combined reading - released by GPS handler
|
| Constructor and Description |
|---|
WifiHandler(Context nors)
Constructor, allocating all necessary resources for the handler
Here, it's reading the preference settings for the polltime and enabling WiFi
Then, it's getting a reference to the
WifiManager and finally, it's arming the semaphores |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
Acquire(String sensor,
String query)
Method to acquire sensor data
Initialise WiFi scanning thread, if not done before
Also initialise the WC sensor thread
|
void |
destroyHandler()
Method to release all handler resources
Here, we release all semaphores, then shut down any acquisition threads and release the wifi lock, if held
|
void |
Discover()
Method to discover the sensor symbols support by this handler
As the result of the discovery, appropriate
Sensor entries will be added to the SensorRepository, if WiFi available |
void |
History(String sensor)
Method to view historical chart of the given sensor symbol - here doing nothing
|
void |
run()
run WiFi discovery in separate thread
|
String |
Share(String sensor)
Method to share the last value of the given sensor - here doing nothing
|
public StringBuffer MAC_reading
public StringBuffer SSID_reading
public StringBuffer RSSI_reading
public StringBuffer WLAN_reading
public Semaphore nearby_semaphore
public Semaphore mac_semaphore
public Semaphore ssid_semaphore
public Semaphore rssi_semaphore
public Semaphore wlan_semaphore
public Semaphore connected_semaphore
public WifiHandler(Context nors)
WifiManager and finally, it's arming the semaphoresnors - Reference to the calling Contextpublic byte[] Acquire(String sensor, String query)
Acquire in interface Handlersensor - String of the sensor symbolquery - String of the query to be fulfilled - not used hereHandler.Acquire(java.lang.String, java.lang.String)public String Share(String sensor)
Share in interface Handlersensor - String of the sensor symbol to be sharedHandler.Share(java.lang.String)public void History(String sensor)
History in interface Handlersensor - String of the symbol for which the history is being requestedHandler.History(java.lang.String)public void Discover()
Sensor entries will be added to the SensorRepository, if WiFi availableDiscover in interface HandlerHandler.Discover(),
Sensor,
SensorRepositorypublic void destroyHandler()
destroyHandler in interface HandlerHandler.destroyHandler()public void run()
run in interface RunnableRunnable.run()