org.placelab.core
Class BluetoothReading

java.lang.Object
  extended byorg.placelab.core.BluetoothReading
All Implemented Interfaces:
BeaconReading

public class BluetoothReading
extends java.lang.Object
implements BeaconReading

This class represents the sighting of a remote bluetooth device


Field Summary
protected  java.lang.String majorDeviceClass
           
protected  java.lang.String minorDeviceClass
           
protected  int serviceClasses
           
protected  java.lang.String[] serviceClassesList
           
 
Constructor Summary
BluetoothReading(java.io.DataInputStream dis)
           
BluetoothReading(java.util.Hashtable map)
           
BluetoothReading(java.lang.String humanReadableName, java.lang.String bluetoothAddress, java.lang.String majorDeviceClass, java.lang.String minorDeviceClass, int serviceClasses)
           
 
Method Summary
 java.lang.String getHumanReadableName()
          Returns Bluetooth Friendly Name
 java.lang.String getId()
          Returns Bluetooth MAC address
 java.lang.String getMajorDeviceClass()
           
 java.lang.String getMinorDeviceClass()
           
 int getNormalizedSignalStrength()
          No signal strength available in javax.bluetooth - returns -1
 int getServiceClasses()
           
 java.lang.String[] getServiceClassesList()
           
 java.lang.String getType()
           
 boolean isValid()
          returns true if the id for this beacon is within the range of acceptable values, for instance if it is not all zeroes.
 void toCompressedBytes(java.io.DataOutputStream dos)
           
 java.lang.String toLogString()
           
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

majorDeviceClass

protected java.lang.String majorDeviceClass

minorDeviceClass

protected java.lang.String minorDeviceClass

serviceClasses

protected int serviceClasses

serviceClassesList

protected java.lang.String[] serviceClassesList
Constructor Detail

BluetoothReading

public BluetoothReading(java.lang.String humanReadableName,
                        java.lang.String bluetoothAddress,
                        java.lang.String majorDeviceClass,
                        java.lang.String minorDeviceClass,
                        int serviceClasses)

BluetoothReading

public BluetoothReading(java.util.Hashtable map)

BluetoothReading

public BluetoothReading(java.io.DataInputStream dis)
                 throws java.io.IOException
Method Detail

getType

public java.lang.String getType()
Specified by:
getType in interface BeaconReading
Returns:
the type of reading that this is (WIFI, BLUETOOTH, GSM, etc)

getMajorDeviceClass

public java.lang.String getMajorDeviceClass()

getMinorDeviceClass

public java.lang.String getMinorDeviceClass()

getServiceClassesList

public java.lang.String[] getServiceClassesList()

getServiceClasses

public int getServiceClasses()

getId

public java.lang.String getId()
Returns Bluetooth MAC address

Specified by:
getId in interface BeaconReading
Returns:
a globally unique ID for this reading

isValid

public boolean isValid()
Description copied from interface: BeaconReading
returns true if the id for this beacon is within the range of acceptable values, for instance if it is not all zeroes.

Specified by:
isValid in interface BeaconReading

getHumanReadableName

public java.lang.String getHumanReadableName()
Returns Bluetooth Friendly Name

Specified by:
getHumanReadableName in interface BeaconReading
Returns:
a human readable name (if any) for this reading

getNormalizedSignalStrength

public int getNormalizedSignalStrength()
No signal strength available in javax.bluetooth - returns -1

Specified by:
getNormalizedSignalStrength in interface BeaconReading
Returns:
an int 0-100 depending on the signal strength, or -1 if unsupported

toString

public java.lang.String toString()

toLogString

public java.lang.String toLogString()
Specified by:
toLogString in interface BeaconReading

toShortString

public java.lang.String toShortString()
Specified by:
toShortString in interface BeaconReading

toCompressedBytes

public void toCompressedBytes(java.io.DataOutputStream dos)
                       throws java.io.IOException
Specified by:
toCompressedBytes in interface BeaconReading
Throws:
java.io.IOException