Skip to content

GNSS&LBS&Wi-Fi Positioning API

GNSS&LBS&Wi-Fi Positioning API Overview

FunctionDescription
Ql_iotLocGetSupList()Obtains NMEA sentence types of the module's built-in positioning feature.
Ql_iotLocGetData()Obtains location data of the module's built-in positioning feature.
Ql_iotCmdBusLocReportInside()Reports the location data of the built-in positioning feature of the device.
Ql_iotCmdBusLocReportInside_ex()Reports the location data of the built-in positioning feature of the device.
Ql_iotCmdBusLocReportOutside()Reports location data obtained from external GNSS module.
Ql_iotCmdBusLocReportOutside_ex()Reports location data obtained from external GNSS module.

API Description

Ql_iotLocGetSupList

This function obtains NMEA sentence types of the built-in positioning feature of the module.

Prototype

c
void *Ql_iotLocGetSupList(void)

Parameter

None

Return Value

TTLV data table containing nodes that represent supported positioning types.

NOTE

  • This function is supported in SDK version 2.8.0 and above.

    Call Ql_iotTtlvFree() to release the resource after getting the information.


Example

c
void *titleTtlv = Ql_iotLocGetSupList();
Ql_iotTtlvFree(&titleTtlv);

Ql_iotLocGetData

This function obtains location data of the built-in positioning feature of the module.

Prototype

c
void *Ql_iotLocGetData(const void *titleTtlv)

Parameter

  • Input
    • const void *   titleTtlv: TTLV data table head of NMEA type to be obtained.

Return Value

TTLV data table containing nodes that represent supported location data.

NOTE

  • This function is supported in SDK version 2.8.0 and above.

    Call Ql_iotTtlvFree() to release the resource after getting the information.


Example

c
void *locDataTtlv = Ql_iotLocGetData(titleTtlv);
Ql_iotTtlvFree(&titleTtlv);

Ql_iotCmdBusLocReportInside

This function reports the location data of the built-in positioning feature of the device (It is recommended to call Ql_iotCmdBusLocReportInside_ex() to report the location data. Uplink data ID is returned after the location data is reported).

Prototype

c
qbool Ql_iotCmdBusLocReportInside(void *titleTtlv)

Parameter

  • Input
    • void *   titleTtlv: TTLV data table head of positioning type to be reported.

Return Value

  • True: Successful execution
  • False: Failed execution

NOTE

  • This function is supported in SDK version 2.6.1 and above.

Example

c
void *titleTtlv = NULL;
Ql_iotTtlvIdAddString(&titleTtlv, 0, "LBS");
Ql_iotCmdBusLocReportInside(titleTtlv);
Ql_iotTtlvFree(&titleTtlv);

Ql_iotCmdBusLocReportInside_ex

This function reports the location data of the built-in positioning feature of the device.

Prototype

c
qint32_t Ql_iotCmdBusLocReportInside_ex(void *titleTtlv)

Parameter

  • Input
    • void *   titleTtlv: TTLV data table head of NMEA sentence type to be reported.

Return Value

  • -1: Failed execution
  • 1–65535: Uplink data ID

NOTE

  • This function is supported in SDK version 2.10.0 and above.

Example

c
void *titleTtlv = NULL;
qbool ret = Ql_iotCmdBusLocReportInside_ex(titleTtlv);
Ql_iotTtlvFree(&titleTtlv);

Ql_iotCmdBusLocReportOutside

This function reports location data obtained from an external GNSS module. (It is recommended to call Ql_iotCmdBusLocReportOutside_ex() to report the location data. Uplink data ID is returned after the location data is reported). Prototype

c
qbool Ql_iotCmdBusLocReportOutside(void *nmeaTtlv)

Parameter

  • Input
    • void *   nmeaTtlv: TTLV data table head of NMEA sentence data to be reported.

Return Value

  • True: Successful execution
  • False: Failed execution

NOTE

  • This function is supported in SDK version 2.6.1 and above.

Example

c
/* Send location data obtained from the external GNSS module. */
void *nmeaTtlv=NULL;
Ql_iotTtlvIdAddString(&nmeaTtlv,0,"$GPGGA,042523.0,3413.610533,N,10854.063257,E,1,05,2.6,438.5,M,-28.0,M,,*78");
Ql_iotTtlvIdAddString(&nmeaTtlv,0,"$GPRMC,042523.0,A,3413.610533,N,10854.063257,E,0.0,245.9,190716,0.0,E,A*0F");
Ql_iotCmdBusLocReportOutside(nmeaTtlv);
Ql_iotTtlvFree(&nmeaTtlv);

Ql_iotCmdBusLocReportOutside_ex

This function reports location data obtained from an external GNSS module.

Prototype

c
qint32_t Ql_iotCmdBusLocReportOutside_ex(void *nmeaTtlv)

Parameter

  • Input
    • void *   nmeaTtlv: TTLV data table head of NMEA type to be reported.

Return Value

  • -1: Failed execution
  • 1–65535: Uplink data ID

NOTE

  • This function is supported in SDK version 2.10 and above.

Example

c
void *titleTtlv = NULL;
qbool ret = Ql_iotCmdBusLocReportOutside_ex(titleTtlv);
Ql_iotTtlvFree(&titleTtlv);