nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
nrf_cloud.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_CLOUD_H__
8#define NRF_CLOUD_H__
9
10#include <zephyr/kernel.h>
11#include <zephyr/types.h>
12#include <zephyr/net/mqtt.h>
13#if defined(CONFIG_MODEM_INFO)
14#include <modem/modem_info.h>
15#endif
16#include <net/nrf_cloud_defs.h>
18#if defined(CONFIG_NRF_MODEM)
19#include <nrf_modem_gnss.h>
20#endif
21#include <net/nrf_cloud_os.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
32#define NCT_MSG_ID_USE_NEXT_INCREMENT 0
34#define NCT_MSG_ID_CC_SUB 100
36#define NCT_MSG_ID_DC_SUB 101
38#define NCT_MSG_ID_FOTA_SUB 103
40#define NCT_MSG_ID_CC_UNSUB 150
42#define NCT_MSG_ID_DC_UNSUB 151
44#define NCT_MSG_ID_FOTA_UNSUB 153
46#define NCT_MSG_ID_STATE_REQUEST 200
48#define NCT_MSG_ID_FOTA_REQUEST 201
50#define NCT_MSG_ID_FOTA_BLE_REQUEST 202
52#define NCT_MSG_ID_STATE_REPORT 300
54#define NCT_MSG_ID_PAIR_STATUS_REPORT 301
56#define NCT_MSG_ID_FOTA_REPORT 302
58#define NCT_MSG_ID_FOTA_BLE_REPORT 303
60#define NCT_MSG_ID_INCREMENT_BEGIN 1000
62#define NCT_MSG_ID_INCREMENT_END 9999
64#define NCT_MSG_ID_USER_TAG_BEGIN (NCT_MSG_ID_INCREMENT_END + 1)
66#define NCT_MSG_ID_USER_TAG_END 0xFFFF /* MQTT message IDs are uint16_t */
67
69#define IS_VALID_USER_TAG(tag) ((tag >= NCT_MSG_ID_USER_TAG_BEGIN) && \
70 (tag <= NCT_MSG_ID_USER_TAG_END))
71
73#define NRF_CLOUD_JWT_VALID_TIME_S_MAX (7 * 24 * 60 * 60)
75#define NRF_CLOUD_JWT_VALID_TIME_S_DEF (10 * 60)
76
78#define NRF_CLOUD_NO_TIMESTAMP 0
79
137
142
161};
162
175};
176
204};
205
213 /* nRF Cloud API defined error codes below */
226 /* Item was not found. No error occurred, the requested item simply does not exist */
231};
232
259};
260
282
293};
294
298
305
306 /* Types not handled by this library:
307 * NRF_CLOUD_FOTA_BLE_BOOT = 3,
308 * NRF_CLOUD_FOTA_BLE_SOFTDEVICE = 4,
309 */
310
315
318
320#define NRF_CLOUD_FOTA_JOB_ID_SIZE (32 + 4 + 1)
321
326 char *id;
327 char *host;
328 char *path;
330};
331
348};
349
360};
361
368};
369
373 uint32_t len;
375 const void *ptr;
376};
377
381 uint32_t len;
383 const void *ptr;
384};
385
397 uint16_t tag;
401 int64_t ts_ms;
402};
403
409 uint32_t status;
416};
417
424
428 enum mqtt_qos qos;
430 uint32_t id;
431};
432
436 uint8_t bootloader:1;
438 uint8_t modem:1;
440 uint8_t application:1;
442 uint8_t modem_full:1;
444 uint8_t smp:1;
445
447 uint8_t _rsvd:3;
448};
449
452 /* Items with UI support on nRF Cloud */
454 uint8_t temperature:1;
456 uint8_t gnss:1;
458 uint8_t flip:1;
460 uint8_t humidity:1;
462 uint8_t air_pressure:1;
464 uint8_t rsrp:1;
466 uint8_t log:1;
468 uint8_t dictionary_log:1;
470 uint8_t air_quality:1;
471
472 /* Items without UI support on nRF Cloud */
474 uint8_t light_sensor:1;
476 uint8_t button:1;
477
479 uint8_t _rsvd:5;
480};
481
490};
491
497
498#if defined(CONFIG_MODEM_INFO)
502 const struct modem_param_info *mpi;
503#endif
504
509};
510
515
518};
519
528};
529
542};
543
547 double lat;
549 double lon;
551 float accuracy;
552
554 float alt;
556 float speed;
558 float heading;
559
561 uint8_t has_alt:1;
563 uint8_t has_speed:1;
565 uint8_t has_heading:1;
566
568 uint8_t _rsvd:5;
569};
570
572 /* Configured sec_tag for nRF Cloud */
573 uint32_t sec_tag;
574
575 /* Flags to indicate if the specified credentials exist */
576 uint8_t ca:1;
577 uint8_t client_cert:1;
578 uint8_t prv_key:1;
579};
580
581#if !defined(CONFIG_NRF_MODEM)
582#define NRF_MODEM_GNSS_NMEA_MAX_LEN 83
583#endif
589 const char *sentence;
590};
591
599 int64_t ts_ms;
600 union {
605#if defined(CONFIG_NRF_MODEM)
607 struct nrf_modem_gnss_nmea_data_frame *mdm_nmea;
609 struct nrf_modem_gnss_pvt_data_frame *mdm_pvt;
610#endif
611 };
612};
613
614#ifdef CONFIG_NRF_CLOUD_GATEWAY
618 uint16_t id;
619};
620#endif
621
637};
638
645typedef void (*nrf_cloud_event_handler_t)(const struct nrf_cloud_evt *evt);
646
671
677};
678
691int nrf_cloud_init(const struct nrf_cloud_init_param *param);
692
713
724
739int nrf_cloud_get_imei(char *buf, size_t buf_sz);
740
756int nrf_cloud_get_uuid(char *buf, size_t buf_sz);
757
771int nrf_cloud_get_modem_fw(char *buf, size_t buf_sz);
772
786
804
815
829
843int nrf_cloud_send(const struct nrf_cloud_tx_data *msg);
844
856int nrf_cloud_obj_shadow_update(struct nrf_cloud_obj *const shadow_obj);
857
872
881
893int nrf_cloud_modem_fota_completed(const bool fota_success);
894
909int nrf_cloud_client_id_get(char *id_buf, size_t id_buf_sz);
910
923int nrf_cloud_client_id_runtime_set(const char *const client_id);
924
934int nrf_cloud_tenant_id_get(char *id_buf, size_t id_len);
935
951int nrf_cloud_jwt_generate(uint32_t time_valid_s, char * const jwt_buf, size_t jwt_buf_sz);
952
971 bool * const reboot_required);
972
984
997
1020
1034int nrf_cloud_fota_fmfu_dev_set(const struct dfu_target_fmfu_fdev *const fmfu_dev_inf);
1035
1052
1059
1073
1090
1102
1111
1121int nrf_cloud_fota_smp_version_get(char **smp_ver_out);
1122
1134
1146
1159void nrf_cloud_sec_tag_set(const sec_tag_t sec_tag);
1160
1167
1170#ifdef __cplusplus
1171}
1172#endif
1173
1174#endif /* NRF_CLOUD_H__ */
void nrf_cloud_sec_tag_set(const sec_tag_t sec_tag)
Set the sec tag used for nRF Cloud credentials. The default sec tag value is.
int nrf_cloud_get_modem_fw(char *buf, size_t buf_sz)
Retrieve the Modem firmware version.
int nrf_cloud_process(void)
Function that must be called periodically to keep the module functional.
nrf_cloud_fota_status
FOTA status reported to nRF Cloud and notified in nrf_cloud_fota_poll_handler_t.
Definition: nrf_cloud.h:284
@ NRF_CLOUD_FOTA_IN_PROGRESS
Definition: nrf_cloud.h:286
@ NRF_CLOUD_FOTA_FAILED
Definition: nrf_cloud.h:287
@ NRF_CLOUD_FOTA_CANCELED
Definition: nrf_cloud.h:290
@ NRF_CLOUD_FOTA_TIMED_OUT
Definition: nrf_cloud.h:289
@ NRF_CLOUD_FOTA_QUEUED
Definition: nrf_cloud.h:285
@ NRF_CLOUD_FOTA_REJECTED
Definition: nrf_cloud.h:291
@ NRF_CLOUD_FOTA_SUCCEEDED
Definition: nrf_cloud.h:288
@ NRF_CLOUD_FOTA_DOWNLOADING
Definition: nrf_cloud.h:292
int nrf_cloud_init(const struct nrf_cloud_init_param *param)
Initialize the module.
int nrf_cloud_sensor_data_send(const struct nrf_cloud_sensor_data *param)
Send sensor data reliably.
int nrf_cloud_fota_pending_job_validate(enum nrf_cloud_fota_type *const fota_type_out)
Validate a pending FOTA installation before initializing this library. This function enables the appl...
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
@ NRF_CLOUD_ERROR_NRF_DEV_NOT_FOUND
Definition: nrf_cloud.h:222
@ NRF_CLOUD_ERROR_NO_DEV_DELETE
Definition: nrf_cloud.h:225
@ NRF_CLOUD_ERROR_DEV_ID_IN_USE
Definition: nrf_cloud.h:218
@ NRF_CLOUD_ERROR_UNKNOWN
Definition: nrf_cloud.h:211
@ NRF_CLOUD_ERROR_DATA_NOT_FOUND
Definition: nrf_cloud.h:221
@ NRF_CLOUD_ERROR_DEV_NOT_ASSOCIATED
Definition: nrf_cloud.h:220
@ NRF_CLOUD_ERROR_BAD_RANGE
Definition: nrf_cloud.h:228
@ NRF_CLOUD_ERROR_INTERNAL_SERVER
Definition: nrf_cloud.h:230
@ NRF_CLOUD_ERROR_DISSOCIATE
Definition: nrf_cloud.h:216
@ NRF_CLOUD_ERROR_INVALID_CERT
Definition: nrf_cloud.h:215
@ NRF_CLOUD_ERROR_NOT_FOUND_NO_ERROR
Definition: nrf_cloud.h:227
@ NRF_CLOUD_ERROR_VALIDATION
Definition: nrf_cloud.h:229
@ NRF_CLOUD_ERROR_NO_DEV_DISSOCIATE
Definition: nrf_cloud.h:224
@ NRF_CLOUD_ERROR_INVALID_OWNER_CODE
Definition: nrf_cloud.h:219
@ NRF_CLOUD_ERROR_BAD_REQUEST
Definition: nrf_cloud.h:214
@ NRF_CLOUD_ERROR_ACCESS_DENIED
Definition: nrf_cloud.h:217
@ NRF_CLOUD_ERROR_NONE
Definition: nrf_cloud.h:212
@ NRF_CLOUD_ERROR_NO_DEV_NOT_PROV
Definition: nrf_cloud.h:223
int nrf_cloud_get_imei(char *buf, size_t buf_sz)
Retrieve the IMEI.
int nrf_cloud_print_details(void)
Print details about cloud connection.
nrf_cloud_fota_bootloader_status_flags
Status flags for tracking the update process of the b1 bootloader (MCUBOOT)
Definition: nrf_cloud.h:351
@ NRF_CLOUD_FOTA_BL_STATUS_S0_WAS_ACTIVE
Definition: nrf_cloud.h:357
@ NRF_CLOUD_FOTA_BL_STATUS_CLEAR
Definition: nrf_cloud.h:353
@ NRF_CLOUD_FOTA_BL_STATUS_REBOOTED
Definition: nrf_cloud.h:359
@ NRF_CLOUD_FOTA_BL_STATUS_S0_FLAG_SET
Definition: nrf_cloud.h:355
int nrf_cloud_tenant_id_get(char *id_buf, size_t id_len)
Retrieve the current customer tenant ID.
#define NRF_CLOUD_FOTA_JOB_ID_SIZE
Definition: nrf_cloud.h:320
nrf_cloud_connect_result
nRF Cloud connect result. Used as return value for nrf_cloud_connect() and to describe NRF_CLOUD_EVT_...
Definition: nrf_cloud.h:181
@ NRF_CLOUD_CONNECT_RES_ERR_ALREADY_CONNECTED
Definition: nrf_cloud.h:203
@ NRF_CLOUD_CONNECT_RES_ERR_MISC
Definition: nrf_cloud.h:191
@ NRF_CLOUD_CONNECT_RES_ERR_CERT
Definition: nrf_cloud.h:197
@ NRF_CLOUD_CONNECT_RES_ERR_NO_MEM
Definition: nrf_cloud.h:193
@ NRF_CLOUD_CONNECT_RES_ERR_TIMEOUT_NO_DATA
Definition: nrf_cloud.h:201
@ NRF_CLOUD_CONNECT_RES_ERR_CERT_MISC
Definition: nrf_cloud.h:199
@ NRF_CLOUD_CONNECT_RES_SUCCESS
Definition: nrf_cloud.h:183
@ NRF_CLOUD_CONNECT_RES_ERR_BACKEND
Definition: nrf_cloud.h:189
@ NRF_CLOUD_CONNECT_RES_ERR_NOT_INITD
Definition: nrf_cloud.h:185
@ NRF_CLOUD_CONNECT_RES_ERR_NETWORK
Definition: nrf_cloud.h:187
@ NRF_CLOUD_CONNECT_RES_ERR_PRV_KEY
Definition: nrf_cloud.h:195
bool nrf_cloud_fota_is_type_modem(const enum nrf_cloud_fota_type type)
Determine if FOTA type is modem related.
int nrf_cloud_fota_smp_install(void)
Install a downloaded SMP FOTA job. Called automatically if.
nrf_cloud_sensor
Sensor types supported by the nRF Cloud.
Definition: nrf_cloud.h:234
@ NRF_CLOUD_SENSOR_FLIP
Definition: nrf_cloud.h:238
@ NRF_CLOUD_SENSOR_BUTTON
Definition: nrf_cloud.h:240
@ NRF_CLOUD_SENSOR_TEMP
Definition: nrf_cloud.h:242
@ NRF_CLOUD_SENSOR_AIR_QUAL
Definition: nrf_cloud.h:248
@ NRF_CLOUD_LTE_LINK_RSRP
Definition: nrf_cloud.h:250
@ NRF_CLOUD_SENSOR_HUMID
Definition: nrf_cloud.h:244
@ NRF_CLOUD_SENSOR_AIR_PRESS
Definition: nrf_cloud.h:246
@ NRF_CLOUD_LOG
Definition: nrf_cloud.h:252
@ NRF_CLOUD_DICTIONARY_LOG
Definition: nrf_cloud.h:254
@ NRF_CLOUD_DEVICE_INFO
Definition: nrf_cloud.h:256
@ NRF_CLOUD_SENSOR_GNSS
Definition: nrf_cloud.h:236
@ NRF_CLOUD_SENSOR_LIGHT
Definition: nrf_cloud.h:258
int nrf_cloud_fota_fmfu_dev_set(const struct dfu_target_fmfu_fdev *const fmfu_dev_inf)
Set the flash device used for full modem FOTA updates. This function is intended to be used by custom...
nrf_cloud_fota_validate_status
Validity of an in-progress/installed FOTA update.
Definition: nrf_cloud.h:333
@ NRF_CLOUD_FOTA_VALIDATE_PASS
Definition: nrf_cloud.h:339
@ NRF_CLOUD_FOTA_VALIDATE_FAIL
Definition: nrf_cloud.h:341
@ NRF_CLOUD_FOTA_VALIDATE_ERROR
Definition: nrf_cloud.h:347
@ NRF_CLOUD_FOTA_VALIDATE_DONE
Definition: nrf_cloud.h:345
@ NRF_CLOUD_FOTA_VALIDATE_UNKNOWN
Definition: nrf_cloud.h:343
@ NRF_CLOUD_FOTA_VALIDATE_NONE
Definition: nrf_cloud.h:335
@ NRF_CLOUD_FOTA_VALIDATE_PENDING
Definition: nrf_cloud.h:337
int nrf_cloud_send(const struct nrf_cloud_tx_data *msg)
Send data to nRF Cloud.
int nrf_cloud_modem_fota_completed(const bool fota_success)
The application has handled reinit after a modem FOTA update and the LTE link has been reestablished....
int nrf_cloud_get_uuid(char *buf, size_t buf_sz)
Retrieve the device's UUID.
nrf_cloud_fota_type
FOTA update type.
Definition: nrf_cloud.h:296
@ NRF_CLOUD_FOTA_APPLICATION
Definition: nrf_cloud.h:300
@ NRF_CLOUD_FOTA_TYPE__FIRST
Definition: nrf_cloud.h:297
@ NRF_CLOUD_FOTA_MODEM_DELTA
Definition: nrf_cloud.h:302
@ NRF_CLOUD_FOTA_TYPE__INVALID
Definition: nrf_cloud.h:316
@ NRF_CLOUD_FOTA_MODEM_FULL
Definition: nrf_cloud.h:312
@ NRF_CLOUD_FOTA_BOOTLOADER
Definition: nrf_cloud.h:304
@ NRF_CLOUD_FOTA_SMP
Definition: nrf_cloud.h:314
int nrf_cloud_obj_shadow_update(struct nrf_cloud_obj *const shadow_obj)
Update the device's shadow with the data from the provided object.
int nrf_cloud_client_id_get(char *id_buf, size_t id_buf_sz)
Retrieve the current device ID.
int nrf_cloud_fota_smp_version_get(char **smp_ver_out)
Get the current version string of the SMP device. An empty string will be returned if nrf_cloud_fota_...
int nrf_cloud_fota_job_start(void)
Start the FOTA update job. This function should be called after the NRF_CLOUD_EVT_FOTA_JOB_AVAILABLE ...
int nrf_cloud_bootloader_fota_slot_set(struct nrf_cloud_settings_fota_job *const job)
Set the active bootloader (B1) slot flag which is needed to validate a bootloader FOTA update....
sec_tag_t nrf_cloud_sec_tag_get(void)
Get the sec tag used for nRF Cloud credentials.
int nrf_cloud_connect(void)
Connect to the cloud.
nrf_cloud_topic_type
Topic types supported by nRF Cloud.
Definition: nrf_cloud.h:262
@ NRF_CLOUD_TOPIC_STATE
Definition: nrf_cloud.h:264
@ NRF_CLOUD_TOPIC_BULK
Definition: nrf_cloud.h:271
@ NRF_CLOUD_TOPIC_MESSAGE
Definition: nrf_cloud.h:266
@ NRF_CLOUD_TOPIC_BIN
Definition: nrf_cloud.h:280
int nrf_cloud_fota_smp_version_read(void)
Read the image info from the SMP device to obtain the current version.
int nrf_cloud_jwt_generate(uint32_t time_valid_s, char *const jwt_buf, size_t jwt_buf_sz)
Generate a JWT to be used with nRF Cloud's REST API. This library's configured values for client id a...
bool nrf_cloud_fota_is_type_enabled(const enum nrf_cloud_fota_type type)
Determine if the specified FOTA type is enabled by the configuration. This function returns false if ...
int nrf_cloud_shadow_device_status_update(const struct nrf_cloud_device_status *const dev_status)
Update the device status in the shadow.
nrf_cloud_gnss_type
GNSS data type contained in nrf_cloud_gnss_data.
Definition: nrf_cloud.h:531
@ NRF_CLOUD_GNSS_TYPE_MODEM_PVT
Definition: nrf_cloud.h:539
@ NRF_CLOUD_GNSS_TYPE_PVT
Definition: nrf_cloud.h:535
@ NRF_CLOUD_GNSS_TYPE_INVALID
Definition: nrf_cloud.h:533
@ NRF_CLOUD_GNSS_TYPE_NMEA
Definition: nrf_cloud.h:537
@ NRF_CLOUD_GNSS_TYPE_MODEM_NMEA
Definition: nrf_cloud.h:541
int nrf_cloud_uninit(void)
Uninitialize nRF Cloud; disconnects cloud connection and cleans up allocated memory.
int nrf_cloud_credentials_configured_check(void)
Check if the credentials required for connecting to nRF Cloud exist. The application's configuration ...
int nrf_cloud_sensor_data_stream(const struct nrf_cloud_sensor_data *param)
Stream sensor data. Uses lowest QoS; no acknowledgment,.
void(* nrf_cloud_event_handler_t)(const struct nrf_cloud_evt *evt)
Event handler registered with the module to handle asynchronous events from the module.
Definition: nrf_cloud.h:645
nrf_cloud_evt_type
Asynchronous nRF Cloud events notified by the module.
Definition: nrf_cloud.h:81
@ NRF_CLOUD_EVT_ERROR
Definition: nrf_cloud.h:135
@ NRF_CLOUD_EVT_TRANSPORT_DISCONNECTED
Definition: nrf_cloud.h:113
@ NRF_CLOUD_EVT_TRANSPORT_CONNECTING
Definition: nrf_cloud.h:85
@ NRF_CLOUD_EVT_SENSOR_DATA_ACK
Definition: nrf_cloud.h:109
@ NRF_CLOUD_EVT_RX_DATA_DISCON
Definition: nrf_cloud.h:99
@ NRF_CLOUD_EVT_TRANSPORT_CONNECT_ERROR
Definition: nrf_cloud.h:125
@ NRF_CLOUD_EVT_FOTA_START
Definition: nrf_cloud.h:117
@ NRF_CLOUD_EVT_FOTA_DONE
Definition: nrf_cloud.h:119
@ NRF_CLOUD_EVT_RX_DATA_SHADOW
Definition: nrf_cloud.h:105
@ NRF_CLOUD_EVT_USER_ASSOCIATED
Definition: nrf_cloud.h:91
@ NRF_CLOUD_EVT_FOTA_JOB_AVAILABLE
Definition: nrf_cloud.h:131
@ NRF_CLOUD_EVT_FOTA_ERROR
Definition: nrf_cloud.h:121
@ NRF_CLOUD_EVT_TRANSPORT_CONNECTED
Definition: nrf_cloud.h:83
@ NRF_CLOUD_EVT_RX_DATA_LOCATION
Definition: nrf_cloud.h:103
@ NRF_CLOUD_EVT_USER_ASSOCIATION_REQUEST
Definition: nrf_cloud.h:89
@ NRF_CLOUD_EVT_READY
Definition: nrf_cloud.h:93
@ NRF_CLOUD_EVT_PINGRESP
Definition: nrf_cloud.h:107
@ NRF_CLOUD_EVT_RX_DATA_GENERAL
Definition: nrf_cloud.h:95
nrf_cloud_error_status
nRF Cloud error status, used to describe NRF_CLOUD_EVT_ERROR event.
Definition: nrf_cloud.h:139
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_BAD_PROT_VER
Definition: nrf_cloud.h:146
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_NOT_AUTH
Definition: nrf_cloud.h:154
@ NRF_CLOUD_ERR_STATUS_MQTT_SUB_FAIL
Definition: nrf_cloud.h:156
@ NRF_CLOUD_ERR_STATUS_NONE
Definition: nrf_cloud.h:141
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_FAIL
Definition: nrf_cloud.h:144
@ NRF_CLOUD_ERR_STATUS_PGPS_PROC
Definition: nrf_cloud.h:160
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_BAD_USR_PWD
Definition: nrf_cloud.h:152
@ NRF_CLOUD_ERR_STATUS_AGNSS_PROC
Definition: nrf_cloud.h:158
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_ID_REJECTED
Definition: nrf_cloud.h:148
@ NRF_CLOUD_ERR_STATUS_MQTT_CONN_SERVER_UNAVAIL
Definition: nrf_cloud.h:150
int nrf_cloud_disconnect(void)
Disconnect from the cloud.
int nrf_cloud_credentials_check(struct nrf_cloud_credentials_status *const cs)
Check if credentials exist in the configured location.
nrf_cloud_disconnect_status
nRF Cloud disconnect status, used to describe NRF_CLOUD_EVT_TRANSPORT_DISCONNECTED event.
Definition: nrf_cloud.h:166
@ NRF_CLOUD_DISCONNECT_USER_REQUEST
Definition: nrf_cloud.h:168
@ NRF_CLOUD_DISCONNECT_CLOSED_BY_REMOTE
Definition: nrf_cloud.h:170
@ NRF_CLOUD_DISCONNECT_INVALID_REQUEST
Definition: nrf_cloud.h:172
@ NRF_CLOUD_DISCONNECT_MISC
Definition: nrf_cloud.h:174
int nrf_cloud_client_id_runtime_set(const char *const client_id)
Set the device ID at runtime. Requires.
int nrf_cloud_fota_fmfu_apply(void)
Install a full modem update from flash. If successful, reboot the device or reinit the modem to compl...
nrf_cloud_shadow_info
How the info sections are handled when encoding shadow data.
Definition: nrf_cloud.h:483
@ NRF_CLOUD_INFO_NO_CHANGE
Definition: nrf_cloud.h:485
@ NRF_CLOUD_INFO_CLEAR
Definition: nrf_cloud.h:489
@ NRF_CLOUD_INFO_SET
Definition: nrf_cloud.h:487
int nrf_cloud_pending_fota_job_process(struct nrf_cloud_settings_fota_job *const job, bool *const reboot_required)
Process/validate a pending FOTA update job. Typically the job information is read from non-volatile s...
int nrf_cloud_fota_pending_job_type_get(enum nrf_cloud_fota_type *const pending_fota_type)
Retrieve the FOTA type of a pending FOTA job. A value of NRF_CLOUD_FOTA_TYPE__INVALID indicates that ...
API for retrieving modem information.
Definition: dfu_target_full_modem.h:26
Modem parameters.
Definition: modem_info.h:146
uint8_t prv_key
Definition: nrf_cloud.h:578
uint32_t sec_tag
Definition: nrf_cloud.h:573
uint8_t client_cert
Definition: nrf_cloud.h:577
uint8_t ca
Definition: nrf_cloud.h:576
Definition: nrf_cloud.h:571
bool alerts_enabled
Definition: nrf_cloud.h:630
int log_level
Definition: nrf_cloud.h:636
Data to control behavior of the nrf_cloud library from the cloud side. This data is stored in the dev...
Definition: nrf_cloud.h:625
uint32_t len
Definition: nrf_cloud.h:373
const void * ptr
Definition: nrf_cloud.h:375
Generic encapsulation for any data that is sent to the cloud.
Definition: nrf_cloud.h:371
enum nrf_cloud_shadow_info conn_inf
Definition: nrf_cloud.h:527
struct nrf_cloud_svc_info * svc
Definition: nrf_cloud.h:525
struct nrf_cloud_modem_info * modem
Definition: nrf_cloud.h:523
Structure to specify which components are added to the encoded device status object.
Definition: nrf_cloud.h:521
enum nrf_cloud_evt_type type
Definition: nrf_cloud.h:407
uint32_t status
Definition: nrf_cloud.h:409
struct nrf_cloud_topic topic
Definition: nrf_cloud.h:413
struct nrf_cloud_data data
Definition: nrf_cloud.h:411
struct nrf_cloud_obj_shadow_data * shadow
Definition: nrf_cloud.h:415
Asynchronous events received from the module.
Definition: nrf_cloud.h:405
char * id
Definition: nrf_cloud.h:326
char * path
Definition: nrf_cloud.h:328
char * host
Definition: nrf_cloud.h:327
int file_size
Definition: nrf_cloud.h:329
enum nrf_cloud_fota_type type
Definition: nrf_cloud.h:324
Common FOTA job info.
Definition: nrf_cloud.h:323
struct nrf_modem_gnss_pvt_data_frame * mdm_pvt
Definition: nrf_cloud.h:609
enum nrf_cloud_gnss_type type
Definition: nrf_cloud.h:595
struct nrf_cloud_gnss_pvt pvt
Definition: nrf_cloud.h:602
struct nrf_modem_gnss_nmea_data_frame * mdm_nmea
Definition: nrf_cloud.h:607
struct nrf_cloud_gnss_nmea nmea
Definition: nrf_cloud.h:604
int64_t ts_ms
Definition: nrf_cloud.h:599
GNSS data to be sent to nRF Cloud as a device message.
Definition: nrf_cloud.h:593
const char * sentence
Definition: nrf_cloud.h:589
NMEA data.
Definition: nrf_cloud.h:585
uint8_t has_heading
Definition: nrf_cloud.h:565
float heading
Definition: nrf_cloud.h:558
double lon
Definition: nrf_cloud.h:549
uint8_t has_alt
Definition: nrf_cloud.h:561
uint8_t has_speed
Definition: nrf_cloud.h:563
float alt
Definition: nrf_cloud.h:554
float accuracy
Definition: nrf_cloud.h:551
double lat
Definition: nrf_cloud.h:547
float speed
Definition: nrf_cloud.h:556
PVT data.
Definition: nrf_cloud.h:545
struct nrf_cloud_data data
Definition: nrf_cloud.h:617
uint16_t id
Definition: nrf_cloud.h:618
Structure to hold message received from nRF Cloud.
Definition: nrf_cloud.h:616
struct dfu_target_fmfu_fdev * fmfu_dev_inf
Definition: nrf_cloud.h:662
const char * application_version
Definition: nrf_cloud.h:670
nrf_cloud_event_handler_t event_handler
Definition: nrf_cloud.h:650
void * smp_reset_cb
Definition: nrf_cloud.h:676
struct nrf_cloud_os_mem_hooks * hooks
Definition: nrf_cloud.h:666
char * client_id
Definition: nrf_cloud.h:656
Initialization parameters for the module.
Definition: nrf_cloud.h:648
enum nrf_cloud_shadow_info device
Definition: nrf_cloud.h:494
enum nrf_cloud_shadow_info sim
Definition: nrf_cloud.h:496
enum nrf_cloud_shadow_info network
Definition: nrf_cloud.h:495
const struct modem_param_info * mpi
Definition: nrf_cloud.h:502
const char * application_version
Definition: nrf_cloud.h:508
Modem info data and which sections should be encoded.
Definition: nrf_cloud.h:493
Object containing shadow update data.
Definition: nrf_cloud_codec.h:129
Object used for building nRF Cloud messages.
Definition: nrf_cloud_codec.h:84
Custom OS memory hooks for nRF Cloud library.
Definition: nrf_cloud_os.h:22
struct nrf_cloud_data data
Definition: nrf_cloud.h:391
int64_t ts_ms
Definition: nrf_cloud.h:401
enum nrf_cloud_sensor type
Definition: nrf_cloud.h:389
uint16_t tag
Definition: nrf_cloud.h:397
Sensor data transmission parameters.
Definition: nrf_cloud.h:387
enum nrf_cloud_fota_validate_status validate
Definition: nrf_cloud.h:364
enum nrf_cloud_fota_type type
Definition: nrf_cloud.h:365
enum nrf_cloud_fota_bootloader_status_flags bl_flags
Definition: nrf_cloud.h:367
FOTA job info provided to the settings module to track FOTA job status.
Definition: nrf_cloud.h:363
uint8_t modem
Definition: nrf_cloud.h:438
uint8_t application
Definition: nrf_cloud.h:440
uint8_t bootloader
Definition: nrf_cloud.h:436
uint8_t modem_full
Definition: nrf_cloud.h:442
uint8_t smp
Definition: nrf_cloud.h:444
Controls which values are added to the FOTA array in the "serviceInfo" shadow section.
Definition: nrf_cloud.h:434
uint8_t button
Definition: nrf_cloud.h:476
uint8_t light_sensor
Definition: nrf_cloud.h:474
uint8_t log
Definition: nrf_cloud.h:466
uint8_t air_quality
Definition: nrf_cloud.h:470
uint8_t gnss
Definition: nrf_cloud.h:456
uint8_t dictionary_log
Definition: nrf_cloud.h:468
uint8_t humidity
Definition: nrf_cloud.h:460
uint8_t flip
Definition: nrf_cloud.h:458
uint8_t air_pressure
Definition: nrf_cloud.h:462
uint8_t rsrp
Definition: nrf_cloud.h:464
uint8_t temperature
Definition: nrf_cloud.h:454
DEPRECATED - No longer used by nRF Cloud.
Definition: nrf_cloud.h:451
struct nrf_cloud_svc_info_fota * fota
Definition: nrf_cloud.h:514
struct nrf_cloud_svc_info_ui * ui
Definition: nrf_cloud.h:517
Structure to specify which components are added to the encoded service info object.
Definition: nrf_cloud.h:512
uint32_t len
Definition: nrf_cloud.h:381
const void * ptr
Definition: nrf_cloud.h:383
MQTT topic.
Definition: nrf_cloud.h:379
struct nrf_cloud_data data
Definition: nrf_cloud.h:423
struct nrf_cloud_obj * obj
Definition: nrf_cloud.h:421
uint32_t id
Definition: nrf_cloud.h:430
enum nrf_cloud_topic_type topic_type
Definition: nrf_cloud.h:426
enum mqtt_qos qos
Definition: nrf_cloud.h:428
Structure used to send data to nRF Cloud.
Definition: nrf_cloud.h:419