GNSS controller. More...
#include <GNSS.h>
Public Member Functions | |
SpGnss () | |
Create SpGnss object. | |
~SpGnss () | |
Destroy SpGnss object. | |
int | begin (void) |
Activate GNSS device. More... | |
int | begin (Stream &debugOut) |
Activate GNSS device. More... | |
int | end (void) |
Inactivate GNSS device. More... | |
int | start (SpStartMode mode=HOT_START) |
Start positioning. More... | |
int | stop (void) |
Stop positioning. More... | |
int | isUpdate (void) |
Check position information is updated and return immediately. More... | |
int | waitUpdate (long timeout=-1) |
Wait for position information to be updated. More... | |
void | getNavData (SpNavData *navData) |
Get updated positioning information from GNSS. More... | |
unsigned long | getPositionDataSize (void) |
unsigned long | getPositionData (char *pBinaryBuffer) |
unsigned long | getPositionData (GnssPositionData *pData) |
int | setPosition (double latitude, double longitude, double altitude=0) |
Set the current position for hot start. More... | |
int | setTime (SpGnssTime *time) |
Set the current time for hot start. More... | |
int | setInterval (long interval=1) |
Set the pos interval time. More... | |
int | setInterval (SpIntervalFreq interval) |
Set the pos interval time. More... | |
int | isSelecting (SpSatelliteType sattype) |
Returns whether the specified satellite system is selecting. More... | |
int | select (SpSatelliteType sattype) |
Add specified satellite system to selection for positioning. More... | |
int | deselect (SpSatelliteType sattype) |
Remove specified satellite system to selection for positioning. More... | |
int | isGps (void) |
[Obsolete] Returns whether GPS is used as satellite system More... | |
int | useGps (void) |
[Obsolete] Use GPS for positioning More... | |
int | unuseGps (void) |
[Obsolete] Unuse GPS for positioning More... | |
int | isGlonass (void) |
[Obsolete] Returns whether Glonass is used as satellite system More... | |
int | useGlonass (void) |
[Obsolete] Use Glonass for positioning More... | |
int | unuseGlonass (void) |
[Obsolete] Unuse Glonass for positioning More... | |
void | setDebugMode (SpPrintLevel level) |
Set debug mode. More... | |
int | saveEphemeris (void) |
Save the data stored in the backup RAM to Flash. More... | |
int | removeEphemeris (void) |
Remove the backup data stored in the Flash. More... | |
void * | getDCReport (void) |
Get the QZQSM DC report data. More... | |
void | start1PPS (void) |
Start 1PPS output. More... | |
void | stop1PPS (void) |
Stop 1PPS output. More... | |
Public Attributes | |
friend | SpNavData |
Protected Member Functions | |
unsigned long | inquireSatelliteType (void) |
Static Protected Member Functions | |
static void | printMessage (SpPrintLevel level, const char *str) |
Protected Attributes | |
int | fd_ |
unsigned long | SatelliteSystem |
SpNavData | NavData |
Static Protected Attributes | |
static Stream & | DebugOut |
static SpPrintLevel | DebugPrintLevel |
GNSS controller.
You can control GNSS devices by operating SpGnss objects instantiated in your app.
int SpGnss::begin | ( | void | ) |
Activate GNSS device.
Power on GNSS hardware block, and change to the state where parameter setting and positioning start can be performed.
|
inline |
Activate GNSS device.
Power on GNSS hardware block, and change to the state where parameter setting and positioning start can be performed.
[in] | debugOut | debug out stream instead of Serial |
int SpGnss::end | ( | void | ) |
Inactivate GNSS device.
Power off GNSS hardware block.
int SpGnss::start | ( | SpStartMode | mode = HOT_START | ) |
Start positioning.
[in] | mode | set start mode(SpStartMode) |
If not specified mode, force set to hot start mode.
int SpGnss::stop | ( | void | ) |
Stop positioning.
Power off most of the hardware and change it to the idling state.
int SpGnss::isUpdate | ( | void | ) |
Check position information is updated and return immediately.
Returns 1 if position information is updated.
int SpGnss::waitUpdate | ( | long | timeout = -1 | ) |
Wait for position information to be updated.
Calling this function will block until GNSS positioning information is updated.
[in] | timeout | timeout of waiting [sec] |
Returns 1 if position information is updated. If not specified timeout, wait forever.
void SpGnss::getNavData | ( | SpNavData * | navData | ) |
Get updated positioning information from GNSS.
This function copies the updated information to the specified navData. Instantiate the navData object specified by argument in app, and specified navData to argument by the pointer address.
[out] | navData | includes latest positioning information |
Give NavData the address of the object instantiated in your app as an argument. The latest position information when the function is called is stored into this object.
int SpGnss::setPosition | ( | double | latitude, |
double | longitude, | ||
double | altitude = 0 |
||
) |
Set the current position for hot start.
In order to perform Hot start, set the approximate current position. The position held inside the GNSS device is overwritten.
[in] | latitude | Latitude of current position |
[in] | longitude | Longitude of current position |
[in] | altitude | Altitude of current position |
int SpGnss::setTime | ( | SpGnssTime * | time | ) |
Set the current time for hot start.
In order to perform Hot start, set the approximate current time. The time held inside the GNSS device is overwritten.
[in] | time | current time(SpGnssTime) |
int SpGnss::setInterval | ( | long | interval = 1 | ) |
Set the pos interval time.
Set interval of POS operation.
[in] | interval | Interval time[sec] |
int SpGnss::setInterval | ( | SpIntervalFreq | interval | ) |
Set the pos interval time.
Set interval of POS operation.
[in] | interval | Interval frequency |
int SpGnss::isSelecting | ( | SpSatelliteType | sattype | ) |
Returns whether the specified satellite system is selecting.
Returns whether satellite system specified as argument is selecting as the satellite used for positioning.
[in] | sattype | Type of satellite system |
int SpGnss::select | ( | SpSatelliteType | sattype | ) |
Add specified satellite system to selection for positioning.
GPS is selected by default. In addition to this, it is able to select Glonass or QZSS L1 / CA as the positioning satellite system, SBAS or QZSS L1S as the positioning augmentation system.
[in] | sattype | Type of satellite system |
int SpGnss::deselect | ( | SpSatelliteType | sattype | ) |
Remove specified satellite system to selection for positioning.
Do not use the specified satellite system for positioning.
[in] | sattype | type of satellite system |
|
inline |
[Obsolete] Returns whether GPS is used as satellite system
This function is obsolete. Replace with isSelecting.
|
inline |
[Obsolete] Use GPS for positioning
This function is obsolete. Replace with select.
|
inline |
[Obsolete] Unuse GPS for positioning
This function is obsolete. Replace with deselect.
|
inline |
[Obsolete] Returns whether Glonass is used as satellite system
This function is obsolete. Replace with isSelecting.
|
inline |
[Obsolete] Use Glonass for positioning
This function is obsolete. Replace with select.
|
inline |
[Obsolete] Unuse Glonass for positioning
This function is obsolete. Replace with deselect.
void SpGnss::setDebugMode | ( | SpPrintLevel | level | ) |
Set debug mode.
Print debug messages about GNSS controlling and positioning if not set 0 to argument.
[in] | level | debug mode |
int SpGnss::saveEphemeris | ( | void | ) |
Save the data stored in the backup RAM to Flash.
int SpGnss::removeEphemeris | ( | void | ) |
Remove the backup data stored in the Flash.
void * SpGnss::getDCReport | ( | void | ) |
Get the QZQSM DC report data.
void SpGnss::start1PPS | ( | void | ) |
Start 1PPS output.
void SpGnss::stop1PPS | ( | void | ) |
Stop 1PPS output.