com.nutiteq.location.providers
Class BluetoothProvider

java.lang.Object
  extended by java.lang.Thread
      extended by com.nutiteq.location.providers.BluetoothProvider
All Implemented Interfaces:
LocationSource, java.lang.Runnable

public class BluetoothProvider
extends java.lang.Thread
implements LocationSource

Provider reading NMEA data from given connection source.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.nutiteq.location.LocationSource
STATUS_CANT_LOCATE, STATUS_CONNECTED, STATUS_CONNECTING, STATUS_CONNECTION_LOST
 
Constructor Summary
BluetoothProvider(LocationDataConnectionProvider connectionProvider, java.lang.String url)
          Create provider
 
Method Summary
 void addLocationListener(LocationListener listener)
          Add listener for location coordinates
 void disconnect()
           
 WgsPoint getLocation()
           
 LocationMarker getLocationMarker()
          Get location marker used on screen
 int getStatus()
          Get status code for location source.
 void quit()
          Quit location polling
 void run()
           
 void setLocationMarker(LocationMarker marker)
          Set location marker where to push location updates
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.nutiteq.location.LocationSource
start
 

Constructor Detail

BluetoothProvider

public BluetoothProvider(LocationDataConnectionProvider connectionProvider,
                         java.lang.String url)
Create provider

Parameters:
connectionProvider - object for connection handling
url - url for connection
Method Detail

getLocation

public WgsPoint getLocation()
Specified by:
getLocation in interface LocationSource

getStatus

public int getStatus()
Description copied from interface: LocationSource
Get status code for location source.

Specified by:
getStatus in interface LocationSource
Returns:
status code

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

disconnect

public void disconnect()

getLocationMarker

public LocationMarker getLocationMarker()
Description copied from interface: LocationSource
Get location marker used on screen

Specified by:
getLocationMarker in interface LocationSource
Returns:
associated location marker

quit

public void quit()
Description copied from interface: LocationSource
Quit location polling

Specified by:
quit in interface LocationSource

setLocationMarker

public void setLocationMarker(LocationMarker marker)
Description copied from interface: LocationSource
Set location marker where to push location updates

Specified by:
setLocationMarker in interface LocationSource
Parameters:
marker - marker displayed on screen

addLocationListener

public void addLocationListener(LocationListener listener)
Description copied from interface: LocationSource
Add listener for location coordinates

Specified by:
addLocationListener in interface LocationSource
Parameters:
listener - listener to be added