Data format translation from SUPL to NRF Cloud AGPS Schema V1

Hello,

          Using the nRF Connect SDK 1.9.1 for nRF9160 location. Found the "location" library quite simple and scalable to use. So was looking into it. We do not plan to use nRF Cloud for AGPS, and selected the corresponding option to go with External AGPS data, and picked the SUPL lib to inject AGPS data. In the GNSS Sample with SUPL Assistance, the SUPL server data received is injected to the GNSS socket, which is fine. Now in case of "location" library, there is a handler "LOCATION_EVT_GNSS_ASSISTANCE_REQUEST" is received. Here it is mentioned to push the AGPS data formatted to nRF Cloud AGPS Schema V1 into function "location_agps_data_process".

1. Is there a way to translate this received SUPL data into the desired schema?

2. Can the data be injected to GNSS Socket and inform the "location" library to use this SUPL's AGPS data?

Parents
  • Hi,

     

    Using the nRF Connect SDK 1.9.1 for nRF9160 location. Found the "location" library quite simple and scalable to use. So was looking into it. We do not plan to use nRF Cloud for AGPS, and selected the corresponding option to go with External AGPS data, and picked the SUPL lib to inject AGPS data. In the GNSS Sample with SUPL Assistance, the SUPL server data received is injected to the GNSS socket, which is fine. Now in case of "location" library, there is a handler "LOCATION_EVT_GNSS_ASSISTANCE_REQUEST" is received. Here it is mentioned to push the AGPS data formatted to nRF Cloud AGPS Schema V1 into function "location_agps_data_process".

    1. Is there a way to translate this received SUPL data into the desired schema?

    I am not sure I understand the question properly.

    AGPS SUPL data, regardless of where it comes from (ie. google supl server or nrf cloud), is injected in the same way to the gnss.

    2. Can the data be injected to GNSS Socket and inform the "location" library to use this SUPL's AGPS data?

    Location is a look up based on the MNC/MCC of your currently connected network, and if there's a problem to look up the specific Cell ID, it will give a default location based on the country code.

     

    Kind regards,

    Håkon

  • AGPS SUPL data, regardless of where it comes from (ie. google supl server or nrf cloud), is injected in the same way to the gnss.

    When NRF Cloud AGPS is not being used, there is an event that is thrown to the location event handler, here is that event -

    /**
     * GNSS is requesting assistance data. Application should obtain the data and send it to
     * location_agps_data_process().
     */
    LOCATION_EVT_GNSS_ASSISTANCE_REQUEST

    So the application will go ahead and obtain the AGPS data from SUPL server. This is supposed to be sent to "location_agps_data_process()" as per the above comment. Now here is the comment on the function declaration -

    /**
     * @brief Feed in A-GPS data to be processed by library.
     *
     * @details If Location library is not receiving A-GPS assistance data directly from nRF Cloud,
     * it throws event LOCATION_EVT_GNSS_ASSISTANCE_REQUEST when assistance is needed. Once application
     * has obtained the assistance data it can be handed over to Location library using this function.
     *
     * Note that the data must be formatted similarly to the nRF Cloud A-GPS data, see for example
     * nrf_cloud_agps_schema_v1.h.
     *
     * @param[in] buf Data received.
     * @param[in] buf_len Buffer size of data to be processed.
     *
     * @return 0 on success, or negative error code on failure.
     * @retval -EINVAL Given buffer NULL or buffer length zero.
     */
    int location_agps_data_process(const char *buf, size_t buf_len);

    From the comments there, it can be seen that the data to be sent to the function has to be of a particular schema. Now the data downloaded from SUPL server is not in that format, hence there would be an error in processing.

    My question here is, how do I convert the received SUPL data to the desired schema?

    Why is this necessary is because we need a GNSS Fix as quickly as possible to ensure that the battery consumption is reduced, and without AGPS, it takes quite a lot of time to get a fix.

Reply
  • AGPS SUPL data, regardless of where it comes from (ie. google supl server or nrf cloud), is injected in the same way to the gnss.

    When NRF Cloud AGPS is not being used, there is an event that is thrown to the location event handler, here is that event -

    /**
     * GNSS is requesting assistance data. Application should obtain the data and send it to
     * location_agps_data_process().
     */
    LOCATION_EVT_GNSS_ASSISTANCE_REQUEST

    So the application will go ahead and obtain the AGPS data from SUPL server. This is supposed to be sent to "location_agps_data_process()" as per the above comment. Now here is the comment on the function declaration -

    /**
     * @brief Feed in A-GPS data to be processed by library.
     *
     * @details If Location library is not receiving A-GPS assistance data directly from nRF Cloud,
     * it throws event LOCATION_EVT_GNSS_ASSISTANCE_REQUEST when assistance is needed. Once application
     * has obtained the assistance data it can be handed over to Location library using this function.
     *
     * Note that the data must be formatted similarly to the nRF Cloud A-GPS data, see for example
     * nrf_cloud_agps_schema_v1.h.
     *
     * @param[in] buf Data received.
     * @param[in] buf_len Buffer size of data to be processed.
     *
     * @return 0 on success, or negative error code on failure.
     * @retval -EINVAL Given buffer NULL or buffer length zero.
     */
    int location_agps_data_process(const char *buf, size_t buf_len);

    From the comments there, it can be seen that the data to be sent to the function has to be of a particular schema. Now the data downloaded from SUPL server is not in that format, hence there would be an error in processing.

    My question here is, how do I convert the received SUPL data to the desired schema?

    Why is this necessary is because we need a GNSS Fix as quickly as possible to ensure that the battery consumption is reduced, and without AGPS, it takes quite a lot of time to get a fix.

Children
No Data
Related