I'm assuming AGPS in the Asset Tracker was designed to use nrf cloud. I don't know if that will be suitable for production deployment at the moment. The GPS with SUPL sample seems to work pretty well, so I'm trying to use that code in the Asset Tracker application. In the Asset Tracker gps_handler(), it takes a struct gps_event, which is from \nrf\include\drivers\gps.h:
struct gps_event {
enum gps_event_type type;
union {
struct gps_pvt pvt;
struct gps_nmea nmea;
struct gps_agps_request agps_request;
enum gps_error error;
};
};
In the GPS sample, in order for supl_session() and inject_agps_type() to work, you use them with nrf_gnss_data_frame_t and nrf_gnss_agps_data_type_t data respectively, which are from \nrfxlib\bsdlib\include\nrf_socket.h:
/**@brief AGPS notification data frame used by the GPS module to let the application know it needs new APGS data. */
typedef struct
{
uint32_t sv_mask_ephe; /**< Bit mask indicating the satellite PRNs for which the assistance GPS ephemeris data is needed. */
uint32_t sv_mask_alm; /**< Bit mask indicating the satellite PRNs for which the assistance GPS almanac data is needed. */
uint32_t data_flags; /**< Indicating other AGPS data models is needed by the GNSS module */
} nrf_gnss_agps_data_frame_t;
#define NRF_GNSS_PVT_DATA_ID 1
#define NRF_GNSS_NMEA_DATA_ID 2
#define NRF_GNSS_AGPS_DATA_ID 3
/**@brief Wrapper struct that used for all data frames read from the GNSS module */
typedef struct
{
uint8_t data_id;
union
{
nrf_gnss_pvt_data_frame_t pvt; /**< PVT (Position, Velocity, and Time) data notification frame */
nrf_gnss_nmea_data_frame_t nmea; /**< NMEA data notification frame */
nrf_gnss_agps_data_frame_t agps; /**< AGPS data request notification */
};
} nrf_gnss_data_frame_t;
Both ways have a lot in common, but they're not compatible. Is the Asset Tracker taking the GNSS data and repackaging it differently than the GPS sample? Maybe I'm missing something. Anyway, is there a way to make this work? I want most of the framework of the Asset Tracker, but using the GPS with SUPL code.