Appearance
GNSS&LBS&Wi-Fi Positioning Example
Introduction
Currently, Developer Center location service supports GNSS positioning, LBS positioning, and Wi-Fi positioning to determine the specific location of the device. This section will introduce how to obtain and report location data to the Developer Center.
- GNSS Positioning The module connects with an external GNSS module to realize satellite positioning.
- LBS Positioning The module connects with an external cellular module to realize LBS positioning.
- Wi-Fi Positioning A location tracking system based on wireless router signal.
Related APIs
Function | Description |
---|---|
Qth_locGetInsideLocation() | Gets the location data of the module's built-in Wi-Fi positioning feature. |
Qth_locSendInsideLocation() | Reports the location data of the module's built-in Wi-Fi positioning feature. |
Qth_locSendOutsideLocation() | Reports the location data obtained from the external GNSS module. |
Note: See GNSS&LBS&Wi-Fi Positioning API for details.
Example 1 (Reports the location data obtained from the external GNSS module.)
1. Get the location data of the external GNSS module.
Connect the Wi-Fi module with the external GNSS module to receive location data. The GNSS module will print the NMEA data to the Wi-Fi module after receiving location data. For example, the NMEA data obtained by the external GNSS module is $GPGGA,042523.0,3116.552,N,12138.7385,E,1,05,2.6,438.5,M,-28.0,M,,*78" .
2. Report the location data obtained from the external GNSS module to Developer Center
Call Qth_locSendOutsideLocation() to report the NMEA data obtained from the external GNSS module to Developer Center.
c
/* Report the NMEA data obtained from the external GNSS module to Developer Center. */
Qth_locSendOutsideLocation("$GPGGA,042523.0,3116.552,N,12138.7385,E,1,05,2.6,438.5,M,-28.0,M,,*78", NULL, NULL);
3. View the device location on Developer Center
Open the "Device Details" page, and click the "Location" tab to view the location data.
Example 2 (Get the location data of the module's built-in Wi-Fi positioning feature)
Get the NMEA location data of the module's Wi-Fi positioning feature
c
void *nmeaTtlv = Qth_locGetInsideLocation();
Quos_ttlvFree(&nmeaTtlv);
Example 3 (Report the location data of the module's built-in Wi-Fi positioning feature)
1. Report location data of the module's Wi-Fi positioning feature to Developer Center
c
/* Report location data of the module's built-in positioning feature to Developer Center. */
Qth_locSendInsideLocation(NULL, NULL);
2. View the device location on Developer Center
Open the "Device Details" page, and click the "Location" tab to view the location data.