QuectelGnssRK
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
QuectelGnssRK Class Reference

QuectelGnssRK class to aquire GNSS location. More...

#include <QuectelGnssRK.h>

Data Structures

struct  LocationCommandContext
 State data passed to the worker thread for getLocation and getLocationAsync calls. More...
 
class  LocationConfiguration
 LocationConfiguration class to configure Location class options. More...
 
struct  LocationPoint
 Type of point coordinates of the given event. More...
 

Public Types

enum  LocationFix { LOCATION_FIX_NONE = 0 , LOCATION_FIX_2D , LOCATION_FIX_3D }
 Type of location fix.
 
enum  LocationConstellation {
  LOCATION_CONST_GPS_ONLY = 0 , LOCATION_CONST_GPS_GLONASS = (1 << 0) , LOCATION_CONST_GPS_BEIDOU = (1 << 1) , LOCATION_CONST_GPS_GALILEO = (1 << 2) ,
  LOCATION_CONST_GPS_QZSS = (1 << 3)
}
 GNSS constellation types. More...
 
enum class  LocationCommand { None , Acquire , Exit }
 Command request codes made from user thread to worker thread. More...
 
enum class  LocationResults {
  Unavailable , Unsupported , Idle , Acquiring ,
  Pending , Fixed , TimedOut
}
 QuectelGnssRK result response enumerations. More...
 
enum class  CME_Error {
  NONE = 0 , FIX = 1 , SESSION_IS_ONGOING = 504 , SESSION_NOT_ACTIVE = 505 ,
  OPERATION_TIMEOUT = 506 , NO_FIX = 516 , GNSS_IS_WORKING = 522 , UNKNOWN_ERROR = 549 ,
  UNDEFINED = 999
}
 Error codes returned from Cellular.command as CME errors. More...
 
typedef std::function< void(LocationResults, const LocationPoint &point) LocationDoneCallback)
 QuectelGnssRK class response callback prototype.
 

Public Member Functions

int begin (LocationConfiguration &configuration)
 Configure the QuectelGnssRK class.
 
LocationResults getLocation (LocationPoint &point, bool publish=false)
 Get GNSS position, synchronously.
 
LocationResults getLocationAsync (LocationDoneCallback callback)
 Get GNSS position, asynchronously, with given callback.
 
LocationResults getStatus () const
 Get the current acquisition state.
 
bool publishLocationEvent (const LocationPoint *point=nullptr)
 Publish the a location, or the last location.
 
bool concurrentGnssAndCellularSupported () const
 Returns true if GNSS and cellular can really operate concurrently.
 
const LocationPointgetLastLocationPoint () const
 Get the location from the previous getLocation() or getLocationAsync() request.
 
LocationResults getLastResults () const
 Get the result of the previous getLocation() or getLocationAsync() request.
 
bool getHasFix () const
 Returns true if the previous getLocation() or getLocationAsync() got a GNSS fix (has a valid location)
 

Static Public Member Functions

static QuectelGnssRKinstance ()
 Singleton class instance for QuectelGnssRK.
 
static void addToEventHandler (Variant &eventData, Variant &locVariant)
 Handler function used with the LocationFusionRK library.
 

Detailed Description

QuectelGnssRK class to aquire GNSS location.

Member Enumeration Documentation

◆ CME_Error

enum class QuectelGnssRK::CME_Error
strong

Error codes returned from Cellular.command as CME errors.

Enumerator
NONE 

No error

FIX 

Fixed position

SESSION_IS_ONGOING 

Session is ongoing

SESSION_NOT_ACTIVE 

Session not active

OPERATION_TIMEOUT 

Operational timeout

NO_FIX 

No fix

GNSS_IS_WORKING 

GNSS is working

UNKNOWN_ERROR 

Unknown error

◆ LocationCommand

enum class QuectelGnssRK::LocationCommand
strong

Command request codes made from user thread to worker thread.

Enumerator
None 

Do nothing

Acquire 

Perform GNSS acquisition

Exit 

Exit from thread

◆ LocationConstellation

GNSS constellation types.

Even though these are a bitfield, you can't OR them together.

◆ LocationResults

enum class QuectelGnssRK::LocationResults
strong

QuectelGnssRK result response enumerations.

Enumerator
Unavailable 

GNSS is not available, typically this indicates the modem is off

Unsupported 

GNSS is not supported on this hardware

Idle 

No GNSS acquistions are pending or in progress

Acquiring 

GNSS is aquiring a fix

Pending 

A previous GNSS acquisition is in progress

Fixed 

GNSS position has been aquired and fixed

TimedOut 

GNSS has not fix

Member Function Documentation

◆ addToEventHandler()

void QuectelGnssRK::addToEventHandler ( Variant & eventData,
Variant & locVariant )
static

Handler function used with the LocationFusionRK library.

Parameters
eventData
locVariant

◆ begin()

int QuectelGnssRK::begin ( LocationConfiguration & configuration)

Configure the QuectelGnssRK class.

Parameters
configurationStructure containing configuration
Return values
0Success

◆ concurrentGnssAndCellularSupported()

bool QuectelGnssRK::concurrentGnssAndCellularSupported ( ) const

Returns true if GNSS and cellular can really operate concurrently.

Returns
true
false

This function returns false on BG95 and true on EG91.

The BG95 cellular modem only sort of supports concurrent GNSS and cellular. If you are trying to get a fix, it may block the operation of the cellular modem for so long that it will fail to connect. This is because the modem shares radio components between GNSS and cellular.

The EG91 works independently enough that you can run the GNSS and cellular operations at the same time.

◆ getHasFix()

bool QuectelGnssRK::getHasFix ( ) const
inline

Returns true if the previous getLocation() or getLocationAsync() got a GNSS fix (has a valid location)

Returns
true
false

◆ getLastLocationPoint()

const LocationPoint & QuectelGnssRK::getLastLocationPoint ( ) const
inline

Get the location from the previous getLocation() or getLocationAsync() request.

Returns
const LocationPoint&

If the LocationPoint .fix member is true, then the location is valid. If any error occurred, then the structure will be zeroed.

◆ getLastResults()

LocationResults QuectelGnssRK::getLastResults ( ) const
inline

Get the result of the previous getLocation() or getLocationAsync() request.

Returns
LocationResults

See also getHasFix() if you only want to know that.

◆ getLocation()

QuectelGnssRK::LocationResults QuectelGnssRK::getLocation ( LocationPoint & point,
bool publish = false )

Get GNSS position, synchronously.

Parameters
pointLocation point with position
publishPublish location point after acquisition
Returns
LocationResults

◆ getLocationAsync()

QuectelGnssRK::LocationResults QuectelGnssRK::getLocationAsync ( LocationDoneCallback callback)

Get GNSS position, asynchronously, with given callback.

Parameters
callbackCallback function to call after acquisition completion
Returns
LocationResults

The results are not automatically published when using a callback, but you can use publishLocationEvent from your callback.

◆ getStatus()

LocationResults QuectelGnssRK::getStatus ( ) const
inline

Get the current acquisition state.

Return values
LocationResults::IdleNo current acquisition
LocationResults::AcquiringAcquisition in progress

◆ instance()

static QuectelGnssRK & QuectelGnssRK::instance ( )
inlinestatic

Singleton class instance for QuectelGnssRK.

Returns
QuectelGnssRK&

◆ publishLocationEvent()

bool QuectelGnssRK::publishLocationEvent ( const LocationPoint * point = nullptr)

Publish the a location, or the last location.

Parameters
pointthe location to publish (optional). If omitted or null, then the last location from getLocation() or getLocationAsync() is used.
Returns
true if the publish succeeded

The documentation for this class was generated from the following files: