Class: PhidgetsNative::GPS
- 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
-
#altitude ⇒ Float
Returns the current altitude in meters, as reported by the most recent gps update.
-
#close ⇒ nil
This method will unregister the phidget event handlers, and free up all API resources associated with the phidget.
-
#heading ⇒ Float
Returns the current heading in degrees, as reported by the most recent gps update.
-
#new(serial_number) ⇒ Object
constructor
All phidget objects are created from the device serial number.
-
#is_fixed? ⇒ Boolean
Returns true or false, indicating whether the gps is fixed (aka “locked”).
-
#latitude ⇒ Float
Returns the current latititude, as reported by the most recent gps update.
-
#longitude ⇒ Float
Returns the current longitude, as reported by the most recent gps update.
-
#now_at_utc ⇒ Time
Returns the GPS-reported time, in the UTC zone.
-
#sample_rate ⇒ FixNum
For most Phidgets, an event handler processes the device state changes at some regular interval.
-
#velocity ⇒ Float
Returns the current velocity in km/h, as reported by the most recent gps update.
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
#altitude ⇒ Float
Returns the current altitude in meters, as reported by the most recent gps update.
#close ⇒ nil
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.
#heading ⇒ Float
Returns the current heading in degrees, as reported by the most recent gps update.
#is_fixed? ⇒ Boolean
Returns true or false, indicating whether the gps is fixed (aka “locked”).
#latitude ⇒ Float
Returns the current latititude, as reported by the most recent gps update.
#longitude ⇒ Float
Returns the current longitude, as reported by the most recent gps update.
#now_at_utc ⇒ Time
Returns the GPS-reported time, in the UTC zone.
#sample_rate ⇒ FixNum
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.
#velocity ⇒ Float
Returns the current velocity in km/h, as reported by the most recent gps update.