ims.devicemanager
Class DeviceHandler

java.lang.Object
  extended by ims.devicemanager.DeviceHandler

public class DeviceHandler
extends java.lang.Object

Handles the important values and information needed for the connected GPS-Bluetooth-device. Provides all the important information about the device and the Bluetooth connect thread.

Copyright © 2014 by Daniela Blum

This file is part of GPSChildFinder.
GPSChildFinder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses.

Author:
Daniela Blum

Constructor Summary
DeviceHandler()
           
 
Method Summary
static void cleanUp()
          Called when the DeviceHandler needs to be cleaned up after disconnect the current device.
static boolean disconnectedToastShown()
           
static void disconnectedToastShown(boolean shown)
           
static BluetoothConnectThread getBtConnectThread()
           
static BluetoothDataManager getBtDataManager()
           
static android.bluetooth.BluetoothDevice getConnectedDevice()
           
static void setBtConnectThread(BluetoothConnectThread btConnectThread)
           
static void setBtDataManager(BluetoothDataManager btDataManager)
           
static void setConnectedDevice(android.bluetooth.BluetoothDevice connectedDevice)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceHandler

public DeviceHandler()
Method Detail

getBtConnectThread

public static BluetoothConnectThread getBtConnectThread()
Returns:
bluetooth connect thread that is currently running and connected with the device

setBtConnectThread

public static void setBtConnectThread(BluetoothConnectThread btConnectThread)
Parameters:
btConnectThread - to set

getBtDataManager

public static BluetoothDataManager getBtDataManager()
Returns:
current bluetooth data manager to receive the data from the connected device

setBtDataManager

public static void setBtDataManager(BluetoothDataManager btDataManager)
Parameters:
btDataManager - to set

getConnectedDevice

public static android.bluetooth.BluetoothDevice getConnectedDevice()
Returns:
currently connected device

setConnectedDevice

public static void setConnectedDevice(android.bluetooth.BluetoothDevice connectedDevice)
Parameters:
connectedDevice - to set

cleanUp

public static void cleanUp()
Called when the DeviceHandler needs to be cleaned up after disconnect the current device.


disconnectedToastShown

public static boolean disconnectedToastShown()
Returns:
the status of the disconnectedToastShown (true if the toast - when the current device was disconnected - was shown before, false otherwise)

disconnectedToastShown

public static void disconnectedToastShown(boolean shown)
Parameters:
shown - boolean to set