public class BrickletGPS extends Device
Modifier and Type | Class and Description |
---|---|
class |
BrickletGPS.Altitude |
static interface |
BrickletGPS.AltitudeListener
This listener is triggered periodically with the period that is set by
setAltitudeCallbackPeriod(long) . |
class |
BrickletGPS.Coordinates |
static interface |
BrickletGPS.CoordinatesListener
This listener is triggered periodically with the period that is set by
setCoordinatesCallbackPeriod(long) . |
class |
BrickletGPS.DateTime |
static interface |
BrickletGPS.DateTimeListener
This listener is triggered periodically with the period that is set by
setDateTimeCallbackPeriod(long) . |
class |
BrickletGPS.Motion |
static interface |
BrickletGPS.MotionListener
This listener is triggered periodically with the period that is set by
setMotionCallbackPeriod(long) . |
class |
BrickletGPS.Status |
static interface |
BrickletGPS.StatusListener
This listener is triggered periodically with the period that is set by
setStatusCallbackPeriod(long) . |
Device.Identity
Constructor and Description |
---|
BrickletGPS(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addAltitudeListener(BrickletGPS.AltitudeListener listener)
Adds a Altitude listener.
|
void |
addCoordinatesListener(BrickletGPS.CoordinatesListener listener)
Adds a Coordinates listener.
|
void |
addDateTimeListener(BrickletGPS.DateTimeListener listener)
Adds a DateTime listener.
|
void |
addMotionListener(BrickletGPS.MotionListener listener)
Adds a Motion listener.
|
void |
addStatusListener(BrickletGPS.StatusListener listener)
Adds a Status listener.
|
BrickletGPS.Altitude |
getAltitude()
Returns the current altitude and corresponding geoidal separation.
|
long |
getAltitudeCallbackPeriod()
Returns the period as set by
setAltitudeCallbackPeriod(long) . |
BrickletGPS.Coordinates |
getCoordinates()
Returns the GPS coordinates.
|
long |
getCoordinatesCallbackPeriod()
Returns the period as set by
setCoordinatesCallbackPeriod(long) . |
BrickletGPS.DateTime |
getDateTime()
Returns the current date and time.
|
long |
getDateTimeCallbackPeriod()
Returns the period as set by
setDateTimeCallbackPeriod(long) . |
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
BrickletGPS.Motion |
getMotion()
Returns the current course and speed.
|
long |
getMotionCallbackPeriod()
Returns the period as set by
setMotionCallbackPeriod(long) . |
BrickletGPS.Status |
getStatus()
Returns the current fix status, the number of satellites that are in view and
the number of satellites that are currently used.
|
long |
getStatusCallbackPeriod()
Returns the period as set by
setStatusCallbackPeriod(long) . |
void |
removeAltitudeListener(BrickletGPS.AltitudeListener listener)
Removes a Altitude listener.
|
void |
removeCoordinatesListener(BrickletGPS.CoordinatesListener listener)
Removes a Coordinates listener.
|
void |
removeDateTimeListener(BrickletGPS.DateTimeListener listener)
Removes a DateTime listener.
|
void |
removeMotionListener(BrickletGPS.MotionListener listener)
Removes a Motion listener.
|
void |
removeStatusListener(BrickletGPS.StatusListener listener)
Removes a Status listener.
|
void |
restart(short restartType)
Restarts the GPS Bricklet, the following restart types are available:
\verbatim
"Value", "Description"
"0", "Hot start (use all available data in the NV store)"
"1", "Warm start (don't use ephemeris at restart)"
"2", "Cold start (don't use time, position, almanacs and ephemeris at restart)"
"3", "Factory reset (clear all system/user configurations at restart)"
\endverbatim
|
void |
setAltitudeCallbackPeriod(long period)
Sets the period with which the
BrickletGPS.AltitudeListener listener is triggered
periodically. |
void |
setCoordinatesCallbackPeriod(long period)
Sets the period with which the
BrickletGPS.CoordinatesListener listener is triggered
periodically. |
void |
setDateTimeCallbackPeriod(long period)
Sets the period with which the
BrickletGPS.DateTimeListener listener is triggered
periodically. |
void |
setMotionCallbackPeriod(long period)
Sets the period with which the
BrickletGPS.MotionListener listener is triggered
periodically. |
void |
setStatusCallbackPeriod(long period)
Sets the period with which the
BrickletGPS.StatusListener listener is triggered
periodically. |
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_GET_COORDINATES
public static final byte FUNCTION_GET_STATUS
public static final byte FUNCTION_GET_ALTITUDE
public static final byte FUNCTION_GET_MOTION
public static final byte FUNCTION_GET_DATE_TIME
public static final byte FUNCTION_RESTART
public static final byte FUNCTION_SET_COORDINATES_CALLBACK_PERIOD
public static final byte FUNCTION_GET_COORDINATES_CALLBACK_PERIOD
public static final byte FUNCTION_SET_STATUS_CALLBACK_PERIOD
public static final byte FUNCTION_GET_STATUS_CALLBACK_PERIOD
public static final byte FUNCTION_SET_ALTITUDE_CALLBACK_PERIOD
public static final byte FUNCTION_GET_ALTITUDE_CALLBACK_PERIOD
public static final byte FUNCTION_SET_MOTION_CALLBACK_PERIOD
public static final byte FUNCTION_GET_MOTION_CALLBACK_PERIOD
public static final byte FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD
public static final byte FUNCTION_GET_DATE_TIME_CALLBACK_PERIOD
public static final byte FUNCTION_GET_IDENTITY
public static final short FIX_NO_FIX
public static final short FIX_2D_FIX
public static final short FIX_3D_FIX
public static final short RESTART_TYPE_HOT_START
public static final short RESTART_TYPE_WARM_START
public static final short RESTART_TYPE_COLD_START
public static final short RESTART_TYPE_FACTORY_RESET
public BrickletGPS(String uid, IPConnection ipcon)
public BrickletGPS.Coordinates getCoordinates() throws TinkerforgeException
getStatus()
.TinkerforgeException
public BrickletGPS.Status getStatus() throws TinkerforgeException
getCoordinates()
, getAltitude()
and getMotion()
return invalid data"
"2", "2D Fix, only getCoordinates()
and getMotion()
return valid data"
"3", "3D Fix, getCoordinates()
, getAltitude()
and getMotion()
return valid data"
\endverbatim
There is also a :ref:`blue LED <gps_bricklet_fix_led>` on the Bricklet that
indicates the fix status.TinkerforgeException
public BrickletGPS.Altitude getAltitude() throws TinkerforgeException
getStatus()
.TinkerforgeException
public BrickletGPS.Motion getMotion() throws TinkerforgeException
getStatus()
.TinkerforgeException
public BrickletGPS.DateTime getDateTime() throws TinkerforgeException
TinkerforgeException
public void restart(short restartType) throws TinkerforgeException
TinkerforgeException
public void setCoordinatesCallbackPeriod(long period) throws TinkerforgeException
BrickletGPS.CoordinatesListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletGPS.CoordinatesListener
listener is only triggered if the coordinates changed
since the last triggering.TinkerforgeException
public long getCoordinatesCallbackPeriod() throws TinkerforgeException
setCoordinatesCallbackPeriod(long)
.TinkerforgeException
public void setStatusCallbackPeriod(long period) throws TinkerforgeException
BrickletGPS.StatusListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletGPS.StatusListener
listener is only triggered if the status changed since the
last triggering.TinkerforgeException
public long getStatusCallbackPeriod() throws TinkerforgeException
setStatusCallbackPeriod(long)
.TinkerforgeException
public void setAltitudeCallbackPeriod(long period) throws TinkerforgeException
BrickletGPS.AltitudeListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletGPS.AltitudeListener
listener is only triggered if the altitude changed since
the last triggering.TinkerforgeException
public long getAltitudeCallbackPeriod() throws TinkerforgeException
setAltitudeCallbackPeriod(long)
.TinkerforgeException
public void setMotionCallbackPeriod(long period) throws TinkerforgeException
BrickletGPS.MotionListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletGPS.MotionListener
listener is only triggered if the motion changed since the
last triggering.TinkerforgeException
public long getMotionCallbackPeriod() throws TinkerforgeException
setMotionCallbackPeriod(long)
.TinkerforgeException
public void setDateTimeCallbackPeriod(long period) throws TinkerforgeException
BrickletGPS.DateTimeListener
listener is triggered
periodically. A value of 0 turns the listener off.
The BrickletGPS.DateTimeListener
listener is only triggered if the date or time changed
since the last triggering.TinkerforgeException
public long getDateTimeCallbackPeriod() throws TinkerforgeException
setDateTimeCallbackPeriod(long)
.TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addCoordinatesListener(BrickletGPS.CoordinatesListener listener)
public void removeCoordinatesListener(BrickletGPS.CoordinatesListener listener)
public void addStatusListener(BrickletGPS.StatusListener listener)
public void removeStatusListener(BrickletGPS.StatusListener listener)
public void addAltitudeListener(BrickletGPS.AltitudeListener listener)
public void removeAltitudeListener(BrickletGPS.AltitudeListener listener)
public void addMotionListener(BrickletGPS.MotionListener listener)
public void removeMotionListener(BrickletGPS.MotionListener listener)
public void addDateTimeListener(BrickletGPS.DateTimeListener listener)
public void removeDateTimeListener(BrickletGPS.DateTimeListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.