com.eurotech.framework.linux.position
Class PositionServiceImpl

java.lang.Object
  extended by com.eurotech.framework.linux.position.PositionServiceImpl
All Implemented Interfaces:
ConfigurableComponent, PositionService, org.osgi.service.event.EventHandler

public class PositionServiceImpl
extends Object
implements PositionService, ConfigurableComponent, org.osgi.service.event.EventHandler


Constructor Summary
PositionServiceImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext, Map<String,Object> properties)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 String getLastSentence()
          Returns the last sentence received from the gps.
 String getNmeaDate()
          Returns the current NMEA date from ZDA sentence
 NmeaPosition getNmeaPosition()
          Returns the current NMEA geographic position.
 String getNmeaTime()
          Returns the current NMEA time from GGA or ZDA sentence
 org.osgi.util.position.Position getPosition()
          Returns the current geographic position.
The org.osgi.util.measurement.Measurement class is used to represent the values that make up a position :
getLongitude() : returns the longitude of this position in radians. getLatitude() : returns the latitude of this position in radians.
 void handleEvent(org.osgi.service.event.Event event)
           
 boolean isLocked()
          Returns true if a valid geographic position has been received.
 void setConnectionFactory(org.osgi.service.io.ConnectionFactory connectionFactory)
           
 void setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
           
 void setUsbService(UsbService usbService)
           
 void unsetConnectionFactory(org.osgi.service.io.ConnectionFactory connectionFactory)
           
 void unsetEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
           
 void unsetUsbService(UsbService usbService)
           
 void updated(Map<String,Object> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionServiceImpl

public PositionServiceImpl()
Method Detail

setConnectionFactory

public void setConnectionFactory(org.osgi.service.io.ConnectionFactory connectionFactory)

unsetConnectionFactory

public void unsetConnectionFactory(org.osgi.service.io.ConnectionFactory connectionFactory)

setEventAdmin

public void setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)

unsetEventAdmin

public void unsetEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)

setUsbService

public void setUsbService(UsbService usbService)

unsetUsbService

public void unsetUsbService(UsbService usbService)

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext,
                        Map<String,Object> properties)

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)

updated

public void updated(Map<String,Object> properties)

getPosition

public org.osgi.util.position.Position getPosition()
Description copied from interface: PositionService
Returns the current geographic position.
The org.osgi.util.measurement.Measurement class is used to represent the values that make up a position :
  • getLongitude() : returns the longitude of this position in radians.
  • getLatitude() : returns the latitude of this position in radians.
  • getSpeed() : returns the ground speed of this position in meters per second.
  • getTrack() : Returns the track of this position in radians as a compass heading. The track is the extrapolation of previous previously measured positions to a future position.

  • Specified by:
    getPosition in interface PositionService
    See Also:
    Position

    getNmeaPosition

    public NmeaPosition getNmeaPosition()
    Description copied from interface: PositionService
    Returns the current NMEA geographic position.
  • getLongitude() : returns the longitude of this position in degrees.
  • getLatitude() : returns the latitude of this position in degrees.
  • getSpeedKmh() : returns the ground speed of this position in km/h.
  • getSpeedMph() : returns the ground speed of this position in mph.
  • getTrack() : Returns the track of this position in degrees as a compass heading.

    Specified by:
    getNmeaPosition in interface PositionService
    See Also:
    NmeaPosition

  • isLocked

    public boolean isLocked()
    Description copied from interface: PositionService
    Returns true if a valid geographic position has been received.

    Specified by:
    isLocked in interface PositionService

    getNmeaTime

    public String getNmeaTime()
    Description copied from interface: PositionService
    Returns the current NMEA time from GGA or ZDA sentence

    Specified by:
    getNmeaTime in interface PositionService

    getNmeaDate

    public String getNmeaDate()
    Description copied from interface: PositionService
    Returns the current NMEA date from ZDA sentence

    Specified by:
    getNmeaDate in interface PositionService

    getLastSentence

    public String getLastSentence()
    Description copied from interface: PositionService
    Returns the last sentence received from the gps.

    Specified by:
    getLastSentence in interface PositionService

    handleEvent

    public void handleEvent(org.osgi.service.event.Event event)
    Specified by:
    handleEvent in interface org.osgi.service.event.EventHandler


    Copyright © 2013. All Rights Reserved.