nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
nrf_cloud_location.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_CLOUD_LOCATION_H_
8#define NRF_CLOUD_LOCATION_H_
9
14#include <zephyr/kernel.h>
15#include <zephyr/sys/slist.h>
16#include <modem/lte_lc.h>
17#include <net/nrf_cloud.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
29#define NRF_CLOUD_LOCATION_WIFI_OMIT_RSSI (INT8_MAX)
31#define NRF_CLOUD_LOCATION_WIFI_OMIT_CHAN (0)
32
34#define NRF_CLOUD_LOCATION_WIFI_AP_CNT_MIN 2
35
37#define NRF_CLOUD_LOCATION_ANCHOR_NAME_MAX 32
38
44
46};
47
50 sys_snode_t node;
51 char name[];
52};
53
57#define NRF_CLOUD_ANCHOR_LIST_BUF_MIN_SZ (sizeof(struct nrf_cloud_anchor_list_node) + \
58 NRF_CLOUD_LOCATION_ANCHOR_NAME_MAX + 1)
59
65 double lat;
67 double lon;
71 uint32_t unc;
74
76 uint32_t anchor_cnt;
77
82 sys_slist_t anchor_list;
83
91
94};
95
107};
108
110#define NRF_CLOUD_LOCATION_CELL_OMIT_TIME_ADV LTE_LC_CELL_TIMING_ADVANCE_INVALID
112#define NRF_CLOUD_LOCATION_CELL_OMIT_RSRQ LTE_LC_CELL_RSRQ_INVALID
114#define NRF_CLOUD_LOCATION_CELL_OMIT_RSRP LTE_LC_CELL_RSRP_INVALID
116#define NRF_CLOUD_LOCATION_CELL_OMIT_EARFCN UINT32_MAX
117
119#define NRF_CLOUD_LOCATION_CELL_TIME_ADV_MAX LTE_LC_CELL_TIMING_ADVANCE_MAX
120
121#if defined(CONFIG_NRF_CLOUD_MQTT)
127typedef void (*nrf_cloud_location_response_t)(const struct nrf_cloud_location_result *const pos);
128
159int nrf_cloud_location_request(const struct lte_lc_cells_info *const cells_inf,
160 const struct wifi_scan_info *const wifi_inf,
161 const struct nrf_cloud_location_config *const config,
163#endif /* CONFIG_NRF_CLOUD_MQTT */
164
176int nrf_cloud_location_process(const char *buf, struct nrf_cloud_location_result *result);
177
189#ifdef __cplusplus
190}
191#endif
192
193#endif /* NRF_CLOUD_LOCATION_H_ */
void(* nrf_cloud_location_response_t)(const struct nrf_cloud_location_result *const pos)
Cloud location result handler function type.
Definition: nrf_cloud_location.h:127
int nrf_cloud_location_request(const struct lte_lc_cells_info *const cells_inf, const struct wifi_scan_info *const wifi_inf, const struct nrf_cloud_location_config *const config, nrf_cloud_location_response_t cb)
Perform an nRF Cloud location request over MQTT.
int nrf_cloud_location_process(const char *buf, struct nrf_cloud_location_result *result)
Process location data received from nRF Cloud over MQTT or REST.
nrf_cloud_location_type
Location request type.
Definition: nrf_cloud_location.h:40
@ LOCATION_TYPE__INVALID
Definition: nrf_cloud_location.h:45
@ LOCATION_TYPE_WIFI
Definition: nrf_cloud_location.h:43
@ LOCATION_TYPE_SINGLE_CELL
Definition: nrf_cloud_location.h:41
@ LOCATION_TYPE_MULTI_CELL
Definition: nrf_cloud_location.h:42
int nrf_cloud_location_scell_data_get(struct lte_lc_cell *const cell_inf)
Get the cellular network information from the modem that is required for a single-cell location reque...
nrf_cloud_error
nRF Cloud error codes. See the Error Codes section of nRF Cloud API documentation for more informatio...
Definition: nrf_cloud.h:210
Definition: lte_lc.h:415
Definition: lte_lc.h:513
sys_snode_t node
Definition: nrf_cloud_location.h:50
char name[]
Definition: nrf_cloud_location.h:51
Anchor name list node, to be used with sys_slist_t APIs.
Definition: nrf_cloud_location.h:49
bool hi_conf
Definition: nrf_cloud_location.h:101
bool fallback
Definition: nrf_cloud_location.h:106
bool do_reply
Definition: nrf_cloud_location.h:99
Location request config.
Definition: nrf_cloud_location.h:97
double lon
Definition: nrf_cloud_location.h:67
uint32_t anchor_cnt
Definition: nrf_cloud_location.h:76
char * anchor_buf
Definition: nrf_cloud_location.h:90
enum nrf_cloud_error err
Definition: nrf_cloud_location.h:73
double lat
Definition: nrf_cloud_location.h:65
size_t anchor_buf_sz
Definition: nrf_cloud_location.h:93
sys_slist_t anchor_list
Definition: nrf_cloud_location.h:82
enum nrf_cloud_location_type type
Definition: nrf_cloud_location.h:63
uint32_t unc
Definition: nrf_cloud_location.h:71
Location request result.
Definition: nrf_cloud_location.h:61
Access points found during a Wi-Fi scan.
Definition: wifi_location_common.h:29