pub struct GpsBricklet { /* private fields */ }
Expand description

Determine position, velocity and altitude using GPS

Implementations

Creates an object with the unique device ID uid. This object can then be used after the IP Connection ip_connection is connected.

Returns the response expected flag for the function specified by the function ID parameter. It is true if the function is expected to send a response, false otherwise.

For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For callback configuration functions it is enabled by default too, but can be disabled by set_response_expected. For setter functions it is disabled by default and can be enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

See set_response_expected for the list of function ID constants available for this function.

Changes the response expected flag of the function specified by the function ID parameter. This flag can only be changed for setter (default value: false) and callback configuration functions (default value: true). For getter functions it is always enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

Changes the response expected flag for all setter and callback configuration functions of this device at once.

This receiver is triggered periodically with the period that is set by Set Coordinates Receiver Period. The parameters are the same as for Get Coordinates.

The get_coordinates_callback_receiver receiver is only triggered if the coordinates changed since the last triggering and if there is currently a fix as indicated by Get Status.

This receiver is triggered periodically with the period that is set by Set Status Receiver Period. The parameters are the same as for Get Status.

The get_status_callback_receiver receiver is only triggered if the status changed since the last triggering.

This receiver is triggered periodically with the period that is set by Set Altitude Receiver Period. The parameters are the same as for Get Altitude.

The get_altitude_callback_receiver receiver is only triggered if the altitude changed since the last triggering and if there is currently a fix as indicated by Get Status.

This receiver is triggered periodically with the period that is set by Set Motion Receiver Period. The parameters are the same as for Get Motion.

The get_motion_callback_receiver receiver is only triggered if the motion changed since the last triggering and if there is currently a fix as indicated by Get Status.

This receiver is triggered periodically with the period that is set by Set Date Time Receiver Period. The parameters are the same as for Get Date Time.

The get_date_time_callback_receiver receiver is only triggered if the date or time changed since the last triggering.

Returns the GPS coordinates. Latitude and longitude are given in the [`DD.dddddd°format, the value 57123468 means 57.123468°. The parameternsandeware the cardinal directions for latitude and longitude. Possible values fornsandew`` are ‘N’, ‘S’, ‘E’ and ‘W’ (north, south, east and west).

PDOP, HDOP and VDOP are the dilution of precision (DOP) values. They specify the additional multiplicative effect of GPS satellite geometry on GPS precision. See `here](https://en.wikipedia.org/wiki/Dilution_of_precision_(GPS))__ for more information. The values are give in hundredths.

EPE is the Estimated Position Error. The EPE is given in cm. This is not the absolute maximum error, it is the error with a specific confidence. See here__ for more information.

This data is only valid if there is currently a fix as indicated by Get Status.

Returns the current fix status, the number of satellites that are in view and the number of satellites that are currently used.

Possible fix status values can be:

ValueDescription
1No Fix
22D Fix
33D Fix

There is also a `blue LED](gps_bricklet_fix_led) on the Bricklet that indicates the fix status.

Associated constants:

  • GPSBRICKLET_FIX_NO_FIX
  • GPSBRICKLET_FIX_2D_FIX
  • GPSBRICKLET_FIX_3D_FIX

Returns the current altitude and corresponding geoidal separation.

Both values are given in cm.

This data is only valid if there is currently a fix as indicated by Get Status.

Returns the current course and speed. Course is given in hundredths degree and speed is given in hundredths km/h. A course of 0° means the Bricklet is traveling north bound and 90° means it is traveling east bound.

Please note that this only returns useful values if an actual movement is present.

This data is only valid if there is currently a fix as indicated by Get Status.

Returns the current date and time. The date is given in the format ddmmyy and the time is given in the format hhmmss.sss. For example, 140713 means 14.05.13 as date and 195923568 means 19:59:23.568 as time.

Restarts the GPS Bricklet, the following restart types are available:

ValueDescription
0Hot start (use all available data in the NV store)
1Warm start (don’t use ephemeris at restart)
2Cold start (don’t use time
3Factory reset (clear all system/user configurations at restart)

Associated constants:

  • GPSBRICKLET_RESTART_TYPE_HOT_START
  • GPSBRICKLET_RESTART_TYPE_WARM_START
  • GPSBRICKLET_RESTART_TYPE_COLD_START
  • GPSBRICKLET_RESTART_TYPE_FACTORY_RESET

Sets the period in ms with which the get_coordinates_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_coordinates_callback_receiver receiver is only triggered if the coordinates changed since the last triggering.

The default value is 0.

Returns the period as set by Set Coordinates Receiver Period.

Sets the period in ms with which the get_status_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_status_callback_receiver receiver is only triggered if the status changed since the last triggering.

The default value is 0.

Returns the period as set by Set Status Receiver Period.

Sets the period in ms with which the get_altitude_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_altitude_callback_receiver receiver is only triggered if the altitude changed since the last triggering.

The default value is 0.

Returns the period as set by Set Altitude Receiver Period.

Sets the period in ms with which the get_motion_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_motion_callback_receiver receiver is only triggered if the motion changed since the last triggering.

The default value is 0.

Returns the period as set by Set Motion Receiver Period.

Sets the period in ms with which the get_date_time_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_date_time_callback_receiver receiver is only triggered if the date or time changed since the last triggering.

The default value is 0.

Returns the period as set by Set Date Time Receiver Period.

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be ‘a’, ‘b’, ‘c’ or ‘d’.

The device identifier numbers can be found here. |device_identifier_constant|

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.