nRF Cloud cellular positioning¶
The nRF Cloud cellular positioning library enables applications to request cellular positioning data from nRF Cloud to be used with the nRF9160 SiP. This library is an enhancement to the nRF Cloud library.
Note
To use the nRF Cloud cellular positioning service, an nRF Cloud account is needed, and the device needs to be associated with a user’s account.
Configuration¶
Configure the following options to enable or disable the use of this library:
Request and process cellular positioning data¶
The nrf_cloud_cell_pos_request()
function is used to request the cellular location of the device by type.
When nRF Cloud responds with the requested cellular positioning data, the nrf_cloud_cell_pos_process()
function processes the received data.
The function parses the data and returns the location information if it is found.
API documentation¶
include/net/nrf_cloud_cell_pos.h
subsys/net/lib/nrf_cloud/src/
-
group
nrf_cloud_cell_pos
Enums
Functions
-
int
nrf_cloud_cell_pos_request
(enum nrf_cloud_cell_pos_type type, const bool request_loc)¶ Request a cellular positioning query from nRF Cloud.
- Parameters
type – Type of cellular positioning request.
request_loc – If true, cloud will send location to the device. If false, cloud will not send location to the device.
- Returns
0 if successful, otherwise a (negative) error code.
-
int
nrf_cloud_cell_pos_process
(const char *buf, struct nrf_cloud_cell_pos_result *result)¶ Processes cellular positioning data received from nRF Cloud.
- Parameters
buf – Pointer to data received from nRF Cloud.
result – Pointer to buffer for parsing result.
- Returns
0 if processed successfully and cell-based location found. 1 if processed successfully but no cell-based location found. otherwise a (negative) error code.
-
struct
nrf_cloud_cell_pos_result
¶ - #include <nrf_cloud_cell_pos.h>
Cellular positioning request result.
-
int