#include <yocto_gps.h>
Public Member Functions | |
virtual int | _invokeValueCallback (string value) |
double | altitude (void) |
string | command (void) |
Y_COORDSYSTEM_enum | coordSystem (void) |
string | dateTime (void) |
double | dilution (void) |
double | direction (void) |
double | get_altitude (void) |
string | get_command (void) |
Y_COORDSYSTEM_enum | get_coordSystem (void) |
string | get_dateTime (void) |
double | get_dilution (void) |
double | get_direction (void) |
double | get_groundSpeed (void) |
Y_ISFIXED_enum | get_isFixed (void) |
string | get_latitude (void) |
string | get_longitude (void) |
s64 | get_satCount (void) |
s64 | get_unixTime (void) |
int | get_utcOffset (void) |
double | groundSpeed (void) |
Y_ISFIXED_enum | isFixed (void) |
string | latitude (void) |
string | longitude (void) |
YGps * | next (void) |
YGps * | nextGps (void) |
virtual int | registerValueCallback (YGpsValueCallback callback) |
s64 | satCount (void) |
int | set_command (const string &newval) |
int | set_coordSystem (Y_COORDSYSTEM_enum newval) |
int | set_utcOffset (int newval) |
int | setCommand (const string &newval) |
int | setCoordSystem (Y_COORDSYSTEM_enum newval) |
int | setUtcOffset (int newval) |
s64 | unixTime (void) |
int | utcOffset (void) |
~YGps () | |
Public Member Functions inherited from YFunction | |
void | _clearDataStreamCache () |
string | _decode_json_string (const string &json) |
string | _download (const string &url) |
YDataStream * | _findDataStream (YDataSet &dataset, const string &def) |
string | _get_json_path (const string &json, const string &path) |
vector< string > | _json_get_array (const string &json) |
string | _json_get_key (const string &json, const string &data) |
string | _json_get_string (const string &json) |
int | _parseEx (yJsonStateMachine &j) |
virtual int | _parserHelper (void) |
string | _parseString (yJsonStateMachine &j) |
string | _request (const string &request) |
string | _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context) |
void | _throw (YRETCODE errType, string errMsg) |
YRETCODE | _upload (const string &path, const string &content) |
YRETCODE | _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context) |
string | advertisedValue (void) |
void | clearCache () |
string | describe (void) |
string | errMessage (void) |
string | errorMessage (void) |
YRETCODE | errorType (void) |
YRETCODE | errType (void) |
YFUN_DESCR | functionDescriptor (void) |
string | get_advertisedValue (void) |
string | get_errorMessage (void) |
YRETCODE | get_errorType (void) |
virtual string | get_friendlyName (void) |
YFUN_DESCR | get_functionDescriptor (void) |
string | get_functionId (void) |
string | get_hardwareId (void) |
string | get_hubSerial () |
string | get_logicalName (void) |
YModule * | get_module (void) |
void * | get_userData (void) |
bool | isOnline (void) |
YRETCODE | load (int msValidity) |
virtual string | loadAttribute (string attrName) |
string | logicalName (void) |
YModule * | module (void) |
virtual int | muteValueCallbacks (void) |
YFunction * | next (void) |
YFunction * | nextFunction (void) |
virtual int | registerValueCallback (YFunctionValueCallback callback) |
int | set_advertisedValue (const string &newval) |
int | set_logicalName (const string &newval) |
void | set_userData (void *data) |
int | setAdvertisedValue (const string &newval) |
int | setLogicalName (const string &newval) |
void | setUserData (void *data) |
virtual int | unmuteValueCallbacks (void) |
void * | userData (void) |
virtual | ~YFunction () |
Static Public Member Functions | |
static YGps * | Find (string func) |
static YGps * | FindGps (string func) |
static YGps * | First (void) |
static YGps * | FirstGps (void) |
Static Public Member Functions inherited from YFunction | |
static void | _ClearCache (void) |
static YFunction * | Find (string func) |
static YFunction * | FindFunction (string func) |
static YFunction * | First (void) |
static YFunction * | FirstFunction (void) |
Protected Member Functions | |
virtual int | _parseAttr (YJSONObject *json_val) |
YGps (const string &func) | |
Protected Member Functions inherited from YFunction | |
YRETCODE | _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg) |
string | _escapeAttr (const string &changeval) |
YRETCODE | _getDescriptor (YFUN_DESCR &fundescr, string &errMsg) |
YRETCODE | _getDevice (YDevice *&dev, string &errMsg) |
YRETCODE | _load_unsafe (int msValidity) |
YRETCODE | _nextFunction (string &hwId) |
int | _parse (YJSONObject *j) |
YRETCODE | _setAttr (string attrname, string newvalue) |
YFunction (const string &func) | |
Protected Attributes | |
double | _altitude |
string | _command |
Y_COORDSYSTEM_enum | _coordSystem |
string | _dateTime |
double | _dilution |
double | _direction |
double | _groundSpeed |
Y_ISFIXED_enum | _isFixed |
string | _latitude |
string | _longitude |
s64 | _satCount |
s64 | _unixTime |
int | _utcOffset |
YGpsValueCallback | _valueCallbackGps |
Protected Attributes inherited from YFunction | |
string | _advertisedValue |
u64 | _cacheExpiration |
string | _className |
std::map< string, YDataStream * > | _dataStreams |
string | _func |
YFUN_DESCR | _fundescr |
string | _funId |
string | _hwId |
string | _lastErrorMsg |
YRETCODE | _lastErrorType |
string | _logicalName |
string | _serial |
yCRITICAL_SECTION | _this_cs |
void * | _userData |
YFunctionValueCallback | _valueCallbackFunction |
Friends | |
YGps * | yFindGps (const string &func) |
YGps * | yFirstGps (void) |
Additional Inherited Members | |
Static Protected Member Functions inherited from YFunction | |
static void | _AddToCache (const string &classname, const string &func, YFunction *obj) |
static YFunction * | _FindFromCache (const string &classname, const string &func) |
static void | _UpdateTimedReportCallbackList (YFunction *func, bool add) |
static void | _UpdateValueCallbackList (YFunction *func, bool add) |
Static Protected Attributes inherited from YFunction | |
static std::map< string, YFunction * > | _cache |
YGps Class: GPS function interface
The Gps function allows you to extract positionning data from the GPS device. This class can provides complete positionning information: However, if you whish to define callbacks on position changes, you should use the YLatitude et YLongitude classes.
Definition at line 95 of file yocto_gps.h.
|
protected |
Definition at line 51 of file yocto_gps.cpp.
YGps::~YGps | ( | ) |
Definition at line 72 of file yocto_gps.cpp.
|
virtual |
Reimplemented from YFunction.
Definition at line 659 of file yocto_gps.cpp.
|
protectedvirtual |
Reimplemented from YFunction.
Definition at line 88 of file yocto_gps.cpp.
|
inline |
Definition at line 251 of file yocto_gps.h.
|
inline |
Definition at line 335 of file yocto_gps.h.
|
inline |
Definition at line 186 of file yocto_gps.h.
|
inline |
Definition at line 303 of file yocto_gps.h.
|
inline |
Definition at line 238 of file yocto_gps.h.
|
inline |
Definition at line 277 of file yocto_gps.h.
|
inlinestatic |
Definition at line 388 of file yocto_gps.h.
|
static |
Retrieves a GPS for a given identifier. The identifier can be specified using several formats:
This function does not require that the GPS is online at the time it is invoked. The returned object is nevertheless valid. Use the method YGps.isOnline() to test if the GPS is indeed online at a given time. In case of ambiguity when looking for a GPS by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
func | : a string that uniquely characterizes the GPS |
Definition at line 608 of file yocto_gps.cpp.
|
inlinestatic |
Definition at line 412 of file yocto_gps.h.
|
static |
Starts the enumeration of GPS currently accessible. Use the method YGps.nextGps() to iterate on next GPS.
Definition at line 679 of file yocto_gps.cpp.
double YGps::get_altitude | ( | void | ) |
Returns the current altitude. Beware: GPS technology is very inaccurate regarding altitude.
On failure, throws an exception or returns Y_ALTITUDE_INVALID.
Definition at line 345 of file yocto_gps.cpp.
string YGps::get_command | ( | void | ) |
Definition at line 543 of file yocto_gps.cpp.
Y_COORDSYSTEM_enum YGps::get_coordSystem | ( | void | ) |
Returns the representation system used for positioning data.
On failure, throws an exception or returns Y_COORDSYSTEM_INVALID.
Definition at line 200 of file yocto_gps.cpp.
string YGps::get_dateTime | ( | void | ) |
Returns the current time in the form "YYYY/MM/DD hh:mm:ss".
On failure, throws an exception or returns Y_DATETIME_INVALID.
Definition at line 465 of file yocto_gps.cpp.
double YGps::get_dilution | ( | void | ) |
Returns the current horizontal dilution of precision, the smaller that number is, the better .
On failure, throws an exception or returns Y_DILUTION_INVALID.
Definition at line 315 of file yocto_gps.cpp.
double YGps::get_direction | ( | void | ) |
Returns the current move bearing in degrees, zero is the true (geographic) north.
On failure, throws an exception or returns Y_DIRECTION_INVALID.
Definition at line 405 of file yocto_gps.cpp.
double YGps::get_groundSpeed | ( | void | ) |
Returns the current ground speed in Km/h.
On failure, throws an exception or returns Y_GROUNDSPEED_INVALID.
Definition at line 374 of file yocto_gps.cpp.
Y_ISFIXED_enum YGps::get_isFixed | ( | void | ) |
Returns TRUE if the receiver has found enough satellites to work.
On failure, throws an exception or returns Y_ISFIXED_INVALID.
Definition at line 141 of file yocto_gps.cpp.
string YGps::get_latitude | ( | void | ) |
Returns the current latitude.
On failure, throws an exception or returns Y_LATITUDE_INVALID.
Definition at line 255 of file yocto_gps.cpp.
string YGps::get_longitude | ( | void | ) |
Returns the current longitude.
On failure, throws an exception or returns Y_LONGITUDE_INVALID.
Definition at line 284 of file yocto_gps.cpp.
s64 YGps::get_satCount | ( | void | ) |
Returns the count of visible satellites.
On failure, throws an exception or returns Y_SATCOUNT_INVALID.
Definition at line 170 of file yocto_gps.cpp.
s64 YGps::get_unixTime | ( | void | ) |
Returns the current time in Unix format (number of seconds elapsed since Jan 1st, 1970).
On failure, throws an exception or returns Y_UNIXTIME_INVALID.
Definition at line 436 of file yocto_gps.cpp.
int YGps::get_utcOffset | ( | void | ) |
Returns the number of seconds between current time and UTC time (time zone).
On failure, throws an exception or returns Y_UTCOFFSET_INVALID.
Definition at line 494 of file yocto_gps.cpp.
|
inline |
Definition at line 263 of file yocto_gps.h.
|
inline |
Definition at line 161 of file yocto_gps.h.
|
inline |
Definition at line 212 of file yocto_gps.h.
|
inline |
Definition at line 224 of file yocto_gps.h.
|
inline |
Definition at line 399 of file yocto_gps.h.
YGps * YGps::nextGps | ( | void | ) |
Continues the enumeration of GPS started using yFirstGps().
Definition at line 669 of file yocto_gps.cpp.
|
virtual |
Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.
callback | : the callback function to call, or a NULL pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. |
Definition at line 640 of file yocto_gps.cpp.
|
inline |
Definition at line 173 of file yocto_gps.h.
int YGps::set_command | ( | const string & | newval | ) |
Definition at line 565 of file yocto_gps.cpp.
int YGps::set_coordSystem | ( | Y_COORDSYSTEM_enum | newval | ) |
Changes the representation system used for positioning data.
newval | : a value among Y_COORDSYSTEM_GPS_DMS, Y_COORDSYSTEM_GPS_DM and Y_COORDSYSTEM_GPS_D corresponding to the representation system used for positioning data |
On failure, throws an exception or returns a negative error code.
Definition at line 232 of file yocto_gps.cpp.
int YGps::set_utcOffset | ( | int | newval | ) |
Changes the number of seconds between current time and UTC time (time zone). The timezone is automatically rounded to the nearest multiple of 15 minutes. If current UTC time is known, the current time is automatically be updated according to the selected time zone.
newval | : an integer corresponding to the number of seconds between current time and UTC time (time zone) |
On failure, throws an exception or returns a negative error code.
Definition at line 527 of file yocto_gps.cpp.
|
inline |
Definition at line 339 of file yocto_gps.h.
|
inline |
Definition at line 200 of file yocto_gps.h.
|
inline |
Definition at line 330 of file yocto_gps.h.
|
inline |
Definition at line 291 of file yocto_gps.h.
|
inline |
Definition at line 315 of file yocto_gps.h.
|
friend |
Retrieves a GPS for a given identifier. The identifier can be specified using several formats:
This function does not require that the GPS is online at the time it is invoked. The returned object is nevertheless valid. Use the method YGps.isOnline() to test if the GPS is indeed online at a given time. In case of ambiguity when looking for a GPS by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.
If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.
func | : a string that uniquely characterizes the GPS |
Definition at line 449 of file yocto_gps.h.
|
friend |
Starts the enumeration of GPS currently accessible. Use the method YGps.nextGps() to iterate on next GPS.
Definition at line 460 of file yocto_gps.h.
|
protected |
Definition at line 109 of file yocto_gps.h.
|
protected |
Definition at line 115 of file yocto_gps.h.
|
protected |
Definition at line 105 of file yocto_gps.h.
|
protected |
Definition at line 113 of file yocto_gps.h.
|
protected |
Definition at line 108 of file yocto_gps.h.
|
protected |
Definition at line 111 of file yocto_gps.h.
|
protected |
Definition at line 110 of file yocto_gps.h.
|
protected |
Definition at line 103 of file yocto_gps.h.
|
protected |
Definition at line 106 of file yocto_gps.h.
|
protected |
Definition at line 107 of file yocto_gps.h.
|
protected |
Definition at line 104 of file yocto_gps.h.
|
protected |
Definition at line 112 of file yocto_gps.h.
|
protected |
Definition at line 114 of file yocto_gps.h.
|
protected |
Definition at line 116 of file yocto_gps.h.
|
static |
Definition at line 143 of file yocto_gps.h.
|
static |
Definition at line 149 of file yocto_gps.h.
|
static |
Definition at line 138 of file yocto_gps.h.
|
static |
Definition at line 137 of file yocto_gps.h.
|
static |
Definition at line 136 of file yocto_gps.h.
|
static |
Definition at line 139 of file yocto_gps.h.
|
static |
Definition at line 147 of file yocto_gps.h.
|
static |
Definition at line 142 of file yocto_gps.h.
|
static |
Definition at line 145 of file yocto_gps.h.
|
static |
Definition at line 144 of file yocto_gps.h.
|
static |
Definition at line 132 of file yocto_gps.h.
|
static |
Definition at line 134 of file yocto_gps.h.
|
static |
Definition at line 133 of file yocto_gps.h.
|
static |
Definition at line 140 of file yocto_gps.h.
|
static |
Definition at line 141 of file yocto_gps.h.
|
static |
Definition at line 135 of file yocto_gps.h.
|
static |
Definition at line 146 of file yocto_gps.h.
|
static |
Definition at line 148 of file yocto_gps.h.