Class: PhidgetsNative::GPS

Inherits:
Device
  • Object
show all
Defined in:
ext/phidgets_native/gps_ruby.c,
ext/phidgets_native/gps_ruby.c

Overview

This class provides functionality specific to the “GPS” device class. Primarily, this includes reporting of latitude/longitude, velocity/heading and time.

Instance Method Summary collapse

Methods inherited from Device

#device_class, #device_id, #is_attached?, #label, #name, #serial_number, #type, #version, #wait_for_attachment

Constructor Details

#new(serial_number) ⇒ Object

All phidget objects are created from the device serial number. Serial numbers are required to be Fixnums (aka “unsigned integers”).

Instance Method Details

#altitudeFloat

Returns the current altitude in meters, as reported by the most recent gps update.

Returns:

  • (Float)

#closenil

This method will unregister the phidget event handlers, and free up all API resources associated with the phidget. This is an optional, but useful way to remove the object’s overhead before the GC kicks in and actually frees the resource.

Returns:

  • (nil)

#headingFloat

Returns the current heading in degrees, as reported by the most recent gps update.

Returns:

  • (Float)

#is_fixed?Boolean

Returns true or false, indicating whether the gps is fixed (aka “locked”).

Returns:

  • (Boolean)

#latitudeFloat

Returns the current latititude, as reported by the most recent gps update.

Returns:

  • (Float)

#longitudeFloat

Returns the current longitude, as reported by the most recent gps update.

Returns:

  • (Float)

#now_at_utcTime

Returns the GPS-reported time, in the UTC zone.

Returns:

  • (Time)

#sample_rateFixNum

For most Phidgets, an event handler processes the device state changes at some regular interval. For these devices, this method will return the rate of state changes measured in Hz.

Returns:

  • (FixNum)

#velocityFloat

Returns the current velocity in km/h, as reported by the most recent gps update.

Returns:

  • (Float)