nRF Connect SDK API
3.3.99
Loading...
Searching...
No Matches
nrf_cloud_defs.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
*/
6
7
#ifndef NRF_CLOUD_DEFS_H__
8
#define NRF_CLOUD_DEFS_H__
9
10
#include <zephyr/toolchain.h>
11
16
/* Message schemas defined by nRF Cloud:
17
* https://github.com/nRFCloud/application-protocols/tree/v1/schemas
18
*/
19
20
/* nRF Cloud appID values */
21
#define NRF_CLOUD_JSON_APPID_KEY "appId"
22
#define NRF_CLOUD_JSON_APPID_VAL_AGNSS "AGNSS"
23
#define NRF_CLOUD_JSON_APPID_VAL_PGPS "PGPS"
24
#define NRF_CLOUD_JSON_APPID_VAL_GNSS "GNSS"
25
#define NRF_CLOUD_JSON_APPID_VAL_LOCATION "GROUND_FIX"
26
#define NRF_CLOUD_JSON_APPID_VAL_DEVICE "DEVICE"
27
#define NRF_CLOUD_JSON_APPID_VAL_FLIP "FLIP"
28
#define NRF_CLOUD_JSON_APPID_VAL_BTN "BUTTON"
29
#define NRF_CLOUD_JSON_APPID_VAL_TEMP "TEMP"
30
#define NRF_CLOUD_JSON_APPID_VAL_HUMID "HUMID"
31
#define NRF_CLOUD_JSON_APPID_VAL_AIR_PRESS "AIR_PRESS"
32
#define NRF_CLOUD_JSON_APPID_VAL_AIR_QUAL "AIR_QUAL"
33
#define NRF_CLOUD_JSON_APPID_VAL_RSRP "RSRP"
34
#define NRF_CLOUD_JSON_APPID_VAL_LIGHT "LIGHT"
35
#define NRF_CLOUD_JSON_APPID_VAL_MODEM "MODEM"
36
37
/* Message type */
38
#define NRF_CLOUD_JSON_MSG_TYPE_KEY "messageType"
39
#define NRF_CLOUD_JSON_MSG_TYPE_VAL_CMD "CMD"
40
#define NRF_CLOUD_JSON_MSG_TYPE_VAL_DATA "DATA"
41
#define NRF_CLOUD_JSON_MSG_TYPE_VAL_DISCONNECT "DISCON"
42
43
/* Misc message keys */
44
#define NRF_CLOUD_JSON_DATA_KEY "data"
45
#define NRF_CLOUD_JSON_ERR_KEY "err"
46
#define NRF_CLOUD_JSON_FULFILL_KEY "fulfilledWith"
47
#define NRF_CLOUD_JSON_FILTERED_KEY "filtered"
48
#define NRF_CLOUD_MSG_TIMESTAMP_KEY "ts"
49
50
/* Modem info key text */
51
#define NRF_CLOUD_JSON_MCC_KEY "mcc"
52
#define NRF_CLOUD_JSON_MNC_KEY "mnc"
53
#define NRF_CLOUD_JSON_AREA_CODE_KEY "tac"
54
#define NRF_CLOUD_JSON_CELL_ID_KEY "eci"
55
#define NRF_CLOUD_JSON_PHYCID_KEY "phycid"
56
#define NRF_CLOUD_JSON_RSRP_KEY "rsrp"
57
58
/* Cellular positioning */
59
#define NRF_CLOUD_CELL_POS_JSON_KEY_LTE "lte"
60
#define NRF_CLOUD_CELL_POS_JSON_KEY_ECI NRF_CLOUD_JSON_CELL_ID_KEY
61
#define NRF_CLOUD_CELL_POS_JSON_KEY_MCC NRF_CLOUD_JSON_MCC_KEY
62
#define NRF_CLOUD_CELL_POS_JSON_KEY_MNC NRF_CLOUD_JSON_MNC_KEY
63
#define NRF_CLOUD_CELL_POS_JSON_KEY_TAC NRF_CLOUD_JSON_AREA_CODE_KEY
64
#define NRF_CLOUD_CELL_POS_JSON_KEY_AGE "age"
65
#define NRF_CLOUD_CELL_POS_JSON_KEY_T_ADV "adv"
66
#define NRF_CLOUD_CELL_POS_JSON_KEY_EARFCN "earfcn"
67
#define NRF_CLOUD_CELL_POS_JSON_KEY_PCI "pci"
68
#define NRF_CLOUD_CELL_POS_JSON_KEY_NBORS "nmr"
69
#define NRF_CLOUD_CELL_POS_JSON_KEY_RSRP NRF_CLOUD_JSON_RSRP_KEY
70
#define NRF_CLOUD_CELL_POS_JSON_KEY_RSRQ "rsrq"
71
#define NRF_CLOUD_CELL_POS_JSON_KEY_TDIFF "timeDiff"
72
73
/* Location */
74
#define NRF_CLOUD_LOCATION_JSON_KEY_CONFIG "config"
75
#define NRF_CLOUD_LOCATION_JSON_KEY_DOREPLY "doReply"
76
#define NRF_CLOUD_LOCATION_JSON_KEY_HICONF "hiConf"
77
#define NRF_CLOUD_LOCATION_JSON_KEY_FALLBACK "fallback"
78
#define NRF_CLOUD_LOCATION_JSON_KEY_WIFI "wifi"
79
#define NRF_CLOUD_LOCATION_JSON_KEY_APS "accessPoints"
80
#define NRF_CLOUD_LOCATION_JSON_KEY_ANCHORS "anchors"
81
#define NRF_CLOUD_LOCATION_JSON_KEY_ANC_NAME "name"
82
#define NRF_CLOUD_LOCATION_JSON_KEY_ANC_MAC "macAddress"
83
#define NRF_CLOUD_LOCATION_JSON_KEY_WIFI_MAC "macAddress"
84
#define NRF_CLOUD_LOCATION_JSON_KEY_WIFI_CH "channel"
85
#define NRF_CLOUD_LOCATION_JSON_KEY_WIFI_RSSI "signalStrength"
86
#define NRF_CLOUD_LOCATION_JSON_KEY_WIFI_SSID "ssid"
87
#define NRF_CLOUD_LOCATION_JSON_KEY_LAT "lat"
88
#define NRF_CLOUD_LOCATION_JSON_KEY_LON "lon"
89
#define NRF_CLOUD_LOCATION_JSON_KEY_UNCERT "uncertainty"
90
#define NRF_CLOUD_LOCATION_TYPE_VAL_MCELL "MCELL"
91
#define NRF_CLOUD_LOCATION_TYPE_VAL_SCELL "SCELL"
92
#define NRF_CLOUD_LOCATION_TYPE_VAL_WIFI "WIFI"
93
#define NRF_CLOUD_LOCATION_TYPE_VAL_ANCHOR "ANCHOR"
94
96
#define NRF_CLOUD_LOCATION_DOREPLY_DEFAULT true
97
#define NRF_CLOUD_LOCATION_HICONF_DEFAULT false
98
#define NRF_CLOUD_LOCATION_FALLBACK_DEFAULT true
99
100
/* P-GPS */
101
#define NRF_CLOUD_JSON_PGPS_PRED_COUNT "predictionCount"
102
#define NRF_CLOUD_JSON_PGPS_INT_MIN "predictionIntervalMinutes"
103
#define NRF_CLOUD_JSON_PGPS_GPS_DAY "startGpsDay"
104
#define NRF_CLOUD_JSON_PGPS_GPS_TIME "startGpsTimeOfDaySeconds"
105
#define NRF_CLOUD_PGPS_RCV_ARRAY_IDX_HOST 0
106
#define NRF_CLOUD_PGPS_RCV_ARRAY_IDX_PATH 1
107
108
/* A-GNSS */
109
#define NRF_CLOUD_JSON_KEY_ELEVATION_MASK "mask"
110
#define NRF_CLOUD_JSON_KEY_AGNSS_TYPES "types"
111
112
/* FOTA */
113
#define NRF_CLOUD_FOTA_TYPE_MODEM_DELTA "MODEM"
114
#define NRF_CLOUD_FOTA_TYPE_MODEM_FULL "MDM_FULL"
115
#define NRF_CLOUD_FOTA_TYPE_BOOT "BOOT"
116
#define NRF_CLOUD_FOTA_TYPE_APP "APP"
117
#define NRF_CLOUD_FOTA_TYPE_SMP "SMP"
118
#define NRF_CLOUD_FOTA_TYPE_CUSTOM "CUSTOM"
119
#define NRF_CLOUD_FOTA_COAP_KEY_JOB_DOC "jobDocument"
120
#define NRF_CLOUD_FOTA_COAP_KEY_JOB_ID "jobId"
121
#define NRF_CLOUD_FOTA_COAP_KEY_PATH "path"
122
#define NRF_CLOUD_FOTA_COAP_KEY_HOST "host"
123
#define NRF_CLOUD_FOTA_COAP_KEY_TYPE "firmwareType"
124
#define NRF_CLOUD_FOTA_COAP_KEY_SIZE "fileSize"
125
#define NRF_CLOUD_FOTA_COAP_KEY_VER "version"
127
#define NRF_CLOUD_FOTA_VER 2
128
129
#define NRF_CLOUD_ERROR_CODE_KEY "code"
130
#define NRF_CLOUD_ERROR_MSG_KEY "message"
131
#define NRF_CLOUD_TOPIC_KEY "topic"
132
#define NRF_CLOUD_MSG_KEY "message"
133
134
/* GNSS - PVT */
135
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_LAT "lat"
136
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_LON "lon"
137
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_ACCURACY "acc"
138
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_ALTITUDE "alt"
139
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_SPEED "spd"
140
#define NRF_CLOUD_JSON_GNSS_PVT_KEY_HEADING "hdg"
141
142
/* Device Info */
143
#define NRF_CLOUD_DEVICE_JSON_KEY_NET_INF "networkInfo"
144
#define NRF_CLOUD_DEVICE_JSON_KEY_SIM_INF "simInfo"
145
#define NRF_CLOUD_DEVICE_JSON_KEY_DEV_INF "deviceInfo"
146
147
/* Settings Module */
149
#define NRF_CLOUD_SETTINGS_NAME "nrf_cloud"
150
#define NRF_CLOUD_SETTINGS_FOTA_KEY "fota"
151
#define NRF_CLOUD_SETTINGS_FOTA_JOB "job"
153
#define NRF_CLOUD_SETTINGS_FULL_FOTA NRF_CLOUD_SETTINGS_NAME \
154
"/" \
155
NRF_CLOUD_SETTINGS_FOTA_KEY
157
#define NRF_CLOUD_SETTINGS_FULL_FOTA_JOB NRF_CLOUD_SETTINGS_FULL_FOTA \
158
"/" \
159
NRF_CLOUD_SETTINGS_FOTA_JOB
160
161
/* Shadow */
162
#define NRF_CLOUD_JSON_KEY_STATE "state"
163
#define NRF_CLOUD_JSON_KEY_REP "reported"
164
#define NRF_CLOUD_JSON_KEY_DES "desired"
165
#define NRF_CLOUD_JSON_KEY_DELTA "delta"
166
#define NRF_CLOUD_JSON_KEY_DEVICE "device"
167
#define NRF_CLOUD_JSON_KEY_SRVC_INFO "serviceInfo"
168
#define NRF_CLOUD_JSON_KEY_SRVC_INFO_UI "ui"
169
#define NRF_CLOUD_JSON_KEY_SRVC_INFO_FOTA NRF_CLOUD_FOTA_VER_STR
170
#define NRF_CLOUD_JSON_KEY_CFG "config"
171
#define NRF_CLOUD_JSON_KEY_CTRL "control"
172
#define NRF_CLOUD_JSON_KEY_LOG "logLvl"
173
#define NRF_CLOUD_JSON_KEY_MEMFAULT "memfaultEn"
174
#define NRF_CLOUD_JSON_KEY_TOPICS "topics"
175
#define NRF_CLOUD_JSON_KEY_STAGE "stage"
176
#define NRF_CLOUD_JSON_KEY_PAIRING "pairing"
177
#define NRF_CLOUD_JSON_KEY_PAIR_STAT "pairingStatus"
178
#define NRF_CLOUD_JSON_KEY_TOPIC_PRFX "nrfcloud_mqtt_topic_prefix"
179
#define NRF_CLOUD_JSON_KEY_KEEPALIVE "keepalive"
180
#define NRF_CLOUD_JSON_KEY_CONN "connection"
181
#define NRF_CLOUD_JSON_KEY_APP_VER "appVersion"
182
#define NRF_CLOUD_JSON_KEY_BOOTLOADER_VER "bootloaderVersion"
183
#define NRF_CLOUD_JSON_KEY_SMP_APP_VER "smpDevAppVer"
184
#define NRF_CLOUD_JSON_KEY_CONN_INFO "connectionInfo"
185
#define NRF_CLOUD_JSON_KEY_PROTOCOL "protocol"
186
#define NRF_CLOUD_JSON_KEY_METHOD "method"
187
#define NRF_CLOUD_JSON_VAL_NOT_ASSOC "not_associated"
188
#define NRF_CLOUD_JSON_VAL_PAIRED "paired"
189
#define NRF_CLOUD_JSON_KEY_SHADOW_VERSION "version"
190
#define NRF_CLOUD_JSON_KEY_SHADOW_TIMESTAMP "timestamp"
191
#define NRF_CLOUD_JSON_KEY_ERR "err"
192
#define NRF_CLOUD_JSON_KEY_ERR_MSG "message"
193
/* Current FOTA version string used in device shadow */
194
#define NRF_CLOUD_FOTA_VER_STR "fota_v" STRINGIFY(NRF_CLOUD_FOTA_VER)
195
/* Max length of nRF Cloud's stage/environment name */
196
#define NRF_CLOUD_STAGE_ID_MAX_LEN 8
198
#define NRF_CLOUD_TENANT_ID_MAX_LEN 64
200
#define NRF_CLOUD_CLIENT_ID_MAX_LEN 64
201
202
/* Topics */
203
#define NRF_CLOUD_JSON_KEY_DEVICE_TO_CLOUD "d2c"
204
#define NRF_CLOUD_JSON_KEY_CLOUD_TO_DEVICE "c2d"
205
#define NRF_CLOUD_BULK_MSG_TOPIC "/bulk"
206
#define NRF_CLOUD_JSON_VAL_TOPIC_C2D "/" NRF_CLOUD_JSON_KEY_CLOUD_TO_DEVICE
207
#define NRF_CLOUD_JSON_VAL_TOPIC_AGNSS "/agnss"
208
#define NRF_CLOUD_JSON_VAL_TOPIC_PGPS "/pgps"
209
#define NRF_CLOUD_JSON_VAL_TOPIC_GND_FIX "/ground_fix"
210
#define NRF_CLOUD_JSON_VAL_TOPIC_RCV "/r"
211
#define NRF_CLOUD_JSON_VAL_TOPIC_WILDCARD "/+"
212
#define NRF_CLOUD_JSON_VAL_TOPIC_BIN "/bin"
213
#define NRF_CLOUD_JSON_VAL_PROTO_MQTT "MQTT"
214
#define NRF_CLOUD_JSON_VAL_PROTO_COAP "CoAP"
215
#define NRF_CLOUD_JSON_VAL_METHOD_LTE "LTE"
216
#define NRF_CLOUD_JSON_VAL_METHOD_WIFI "Wi-Fi"
217
#define NRF_CLOUD_JSON_VAL_METHOD_DECT "DECT NR+"
218
220
#define NRF_CLOUD_TRANSFORM_MAX_RESPONSE_LEN 1792
221
#define NRF_CLOUD_TRANSFORM_REQ_LEN_KEY "l"
222
#define NRF_CLOUD_TRANSFORM_REQ_TF_KEY "t"
223
#define NRF_CLOUD_TRANSFORM_RSP_TF_KEY "tf"
224
#define NRF_CLOUD_TRANSFORM_RSP_POS_KEY "position"
225
227
#endif
/* NRF_CLOUD_DEFS_H__ */
include
net
nrf_cloud_defs.h
Generated on Wed Jun 10 2026 17:22:24 for nRF Connect SDK API by
1.12.0