nRF Connect SDK API 2.8.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
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
110
112#define NRF_CLOUD_LOCATION_CELL_OMIT_TIME_ADV LTE_LC_CELL_TIMING_ADVANCE_INVALID
114#define NRF_CLOUD_LOCATION_CELL_OMIT_RSRQ LTE_LC_CELL_RSRQ_INVALID
116#define NRF_CLOUD_LOCATION_CELL_OMIT_RSRP LTE_LC_CELL_RSRP_INVALID
118#define NRF_CLOUD_LOCATION_CELL_OMIT_EARFCN UINT32_MAX
119
121#define NRF_CLOUD_LOCATION_CELL_TIME_ADV_MAX LTE_LC_CELL_TIMING_ADVANCE_MAX
122
123#if defined(CONFIG_NRF_CLOUD_MQTT)
129typedef void (*nrf_cloud_location_response_t)(const struct nrf_cloud_location_result *const pos);
130
161int nrf_cloud_location_request(const struct lte_lc_cells_info *const cells_inf,
162 const struct wifi_scan_info *const wifi_inf,
163 const struct nrf_cloud_location_config *const config,
165#endif /* CONFIG_NRF_CLOUD_MQTT */
166
178int nrf_cloud_location_process(const char *buf, struct nrf_cloud_location_result *result);
179
191#ifdef __cplusplus
192}
193#endif
194
195#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:129
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:427
Definition lte_lc.h:529
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:103
bool fallback
Definition nrf_cloud_location.h:108
bool do_reply
Definition nrf_cloud_location.h:101
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