nRF Connect SDK API 2.8.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
162
176
205
232
260
281#if defined(CONFIG_NRF_CLOUD_MQTT_SHADOW_TRANSFORMS)
283 NRF_CLOUD_TOPIC_STATE_TF,
284#endif
285};
286
298
302
309
310 /* Types not handled by this library:
311 * NRF_CLOUD_FOTA_BLE_BOOT = 3,
312 * NRF_CLOUD_FOTA_BLE_SOFTDEVICE = 4,
313 */
314
319
322
324#define NRF_CLOUD_FOTA_JOB_ID_SIZE (32 + 4 + 1)
325
335
353
365
373
377 uint32_t len;
379 const void *ptr;
380};
381
385 uint32_t len;
387 const void *ptr;
388};
389
407
421
428
432 enum mqtt_qos qos;
434 uint32_t id;
435};
436
440 uint8_t bootloader:1;
442 uint8_t modem:1;
444 uint8_t application:1;
446 uint8_t modem_full:1;
448 uint8_t smp:1;
449
451 uint8_t _rsvd:3;
452};
453
461 /* Items with UI support on nRF Cloud */
463 uint8_t temperature:1;
465 uint8_t gnss:1;
467 uint8_t flip:1;
469 uint8_t humidity:1;
471 uint8_t air_pressure:1;
473 uint8_t rsrp:1;
475 uint8_t log:1;
477 uint8_t dictionary_log:1;
479 uint8_t air_quality:1;
480
481 /* Items without UI support on nRF Cloud */
483 uint8_t light_sensor:1;
485 uint8_t button:1;
486
488 uint8_t _rsvd:5;
489};
490
500
506
507#if defined(CONFIG_MODEM_INFO)
511 const struct modem_param_info *mpi;
512#endif
513
518};
519
530
540
554
558 double lat;
560 double lon;
562 float accuracy;
563
565 float alt;
567 float speed;
569 float heading;
570
572 uint8_t has_alt:1;
574 uint8_t has_speed:1;
576 uint8_t has_heading:1;
577
579 uint8_t _rsvd:5;
580};
581
583 /* Configured sec_tag for nRF Cloud */
584 uint32_t sec_tag;
585 size_t ca_size;
586
587 /* Flags to indicate if the specified credentials exist */
588 uint8_t ca:1;
589 uint8_t ca_coap:1;
590 uint8_t ca_aws:1;
591 uint8_t client_cert:1;
592 uint8_t prv_key:1;
593};
594
595#if !defined(CONFIG_NRF_MODEM)
596#define NRF_MODEM_GNSS_NMEA_MAX_LEN 83
597#endif
603 const char *sentence;
604};
605
613 int64_t ts_ms;
614 union {
619#if defined(CONFIG_NRF_MODEM)
621 struct nrf_modem_gnss_nmea_data_frame *mdm_nmea;
623 struct nrf_modem_gnss_pvt_data_frame *mdm_pvt;
624#endif
625 };
626};
627
628#ifdef CONFIG_NRF_CLOUD_GATEWAY
632 uint16_t id;
633};
634#endif
635
653
660typedef void (*nrf_cloud_event_handler_t)(const struct nrf_cloud_evt *evt);
661
693
706int nrf_cloud_init(const struct nrf_cloud_init_param *param);
707
728
739
751
766int nrf_cloud_get_imei(char *buf, size_t buf_sz);
767
783int nrf_cloud_get_uuid(char *buf, size_t buf_sz);
784
798int nrf_cloud_get_modem_fw(char *buf, size_t buf_sz);
799
813
831
842
856
870int nrf_cloud_send(const struct nrf_cloud_tx_data *msg);
871
883int nrf_cloud_obj_shadow_update(struct nrf_cloud_obj *const shadow_obj);
884
903int nrf_cloud_shadow_transform_request(char const *const transform, const size_t max_response_len);
904
919
928
940int nrf_cloud_modem_fota_completed(const bool fota_success);
941
956int nrf_cloud_client_id_get(char *id_buf, size_t id_buf_sz);
957
970int nrf_cloud_client_id_runtime_set(const char *const client_id);
971
981int nrf_cloud_tenant_id_get(char *id_buf, size_t id_len);
982
998int nrf_cloud_jwt_generate(uint32_t time_valid_s, char * const jwt_buf, size_t jwt_buf_sz);
999
1018 bool * const reboot_required);
1019
1031
1044
1067
1081int nrf_cloud_fota_fmfu_dev_set(const struct dfu_target_fmfu_fdev *const fmfu_dev_inf);
1082
1099
1106
1120
1137
1150int nrf_cloud_fota_smp_client_init(const void *smp_reset_cb);
1151
1163
1172
1182int nrf_cloud_fota_smp_version_get(char **smp_ver_out);
1183
1195
1210
1227void nrf_cloud_sec_tag_set(const sec_tag_t sec_tag);
1228
1235
1249void nrf_cloud_sec_tag_coap_jwt_set(const sec_tag_t sec_tag);
1250
1260
1263#ifdef __cplusplus
1264}
1265#endif
1266
1267#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.
void nrf_cloud_sec_tag_coap_jwt_set(const sec_tag_t sec_tag)
Set the sec tag containing the private key used to sign CoAP JWTs for nRF Cloud authentication....
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:288
@ NRF_CLOUD_FOTA_IN_PROGRESS
Definition nrf_cloud.h:290
@ NRF_CLOUD_FOTA_FAILED
Definition nrf_cloud.h:291
@ NRF_CLOUD_FOTA_CANCELED
Definition nrf_cloud.h:294
@ NRF_CLOUD_FOTA_TIMED_OUT
Definition nrf_cloud.h:293
@ NRF_CLOUD_FOTA_QUEUED
Definition nrf_cloud.h:289
@ NRF_CLOUD_FOTA_REJECTED
Definition nrf_cloud.h:295
@ NRF_CLOUD_FOTA_SUCCEEDED
Definition nrf_cloud.h:292
@ NRF_CLOUD_FOTA_DOWNLOADING
Definition nrf_cloud.h:296
int nrf_cloud_init(const struct nrf_cloud_init_param *param)
Initialize the module.
int nrf_cloud_shadow_transform_request(char const *const transform, const size_t max_response_len)
Request shadow data over MQTT using a JSONata expression. For example, to request the reported device...
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:355
@ NRF_CLOUD_FOTA_BL_STATUS_S0_WAS_ACTIVE
Definition nrf_cloud.h:361
@ NRF_CLOUD_FOTA_BL_STATUS_CLEAR
Definition nrf_cloud.h:357
@ NRF_CLOUD_FOTA_BL_STATUS_REBOOTED
Definition nrf_cloud.h:363
@ NRF_CLOUD_FOTA_BL_STATUS_S0_FLAG_SET
Definition nrf_cloud.h:359
sec_tag_t nrf_cloud_sec_tag_coap_jwt_get(void)
Get the sec tag containing the private key used to sign CoAP JWTs for nRF Cloud authentication.
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:324
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:337
@ NRF_CLOUD_FOTA_VALIDATE_PASS
Definition nrf_cloud.h:343
@ NRF_CLOUD_FOTA_VALIDATE_FAIL
Definition nrf_cloud.h:345
@ NRF_CLOUD_FOTA_VALIDATE_ERROR
Definition nrf_cloud.h:351
@ NRF_CLOUD_FOTA_VALIDATE_DONE
Definition nrf_cloud.h:349
@ NRF_CLOUD_FOTA_VALIDATE_UNKNOWN
Definition nrf_cloud.h:347
@ NRF_CLOUD_FOTA_VALIDATE_NONE
Definition nrf_cloud.h:339
@ NRF_CLOUD_FOTA_VALIDATE_PENDING
Definition nrf_cloud.h:341
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:300
@ NRF_CLOUD_FOTA_APPLICATION
Definition nrf_cloud.h:304
@ NRF_CLOUD_FOTA_TYPE__FIRST
Definition nrf_cloud.h:301
@ NRF_CLOUD_FOTA_MODEM_DELTA
Definition nrf_cloud.h:306
@ NRF_CLOUD_FOTA_TYPE__INVALID
Definition nrf_cloud.h:320
@ NRF_CLOUD_FOTA_MODEM_FULL
Definition nrf_cloud.h:316
@ NRF_CLOUD_FOTA_BOOTLOADER
Definition nrf_cloud.h:308
@ NRF_CLOUD_FOTA_SMP
Definition nrf_cloud.h:318
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_smp_client_init(const void *smp_reset_cb)
Initialize the SMP client. Called automatically if.
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:542
@ NRF_CLOUD_GNSS_TYPE_MODEM_PVT
Definition nrf_cloud.h:550
@ NRF_CLOUD_GNSS_TYPE_PVT
Definition nrf_cloud.h:546
@ NRF_CLOUD_GNSS_TYPE_INVALID
Definition nrf_cloud.h:544
@ NRF_CLOUD_GNSS_TYPE_NMEA
Definition nrf_cloud.h:548
@ NRF_CLOUD_GNSS_TYPE_MODEM_NMEA
Definition nrf_cloud.h:552
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:660
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_print_cloud_details(void)
Print details about cloud connection after connected.
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:492
@ NRF_CLOUD_INFO_NO_CHANGE
Definition nrf_cloud.h:494
@ NRF_CLOUD_INFO_CLEAR
Definition nrf_cloud.h:498
@ NRF_CLOUD_INFO_SET
Definition nrf_cloud.h:496
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:201
uint8_t prv_key
Definition nrf_cloud.h:592
uint32_t sec_tag
Definition nrf_cloud.h:584
uint8_t ca_coap
Definition nrf_cloud.h:589
uint8_t client_cert
Definition nrf_cloud.h:591
uint8_t ca_aws
Definition nrf_cloud.h:590
uint8_t ca
Definition nrf_cloud.h:588
size_t ca_size
Definition nrf_cloud.h:585
Definition nrf_cloud.h:582
bool alerts_enabled
Definition nrf_cloud.h:644
int log_level
Definition nrf_cloud.h:651
Data to control behavior of the nrf_cloud library from the cloud side. This data is stored in the dev...
Definition nrf_cloud.h:639
uint32_t len
Definition nrf_cloud.h:377
const void * ptr
Definition nrf_cloud.h:379
Generic encapsulation for any data that is sent to the cloud.
Definition nrf_cloud.h:375
enum nrf_cloud_shadow_info conn_inf
Definition nrf_cloud.h:538
struct nrf_cloud_svc_info * svc
Definition nrf_cloud.h:536
struct nrf_cloud_modem_info * modem
Definition nrf_cloud.h:534
Structure to specify which components are added to the encoded device status object.
Definition nrf_cloud.h:532
enum nrf_cloud_evt_type type
Definition nrf_cloud.h:411
uint32_t status
Definition nrf_cloud.h:413
struct nrf_cloud_topic topic
Definition nrf_cloud.h:417
struct nrf_cloud_data data
Definition nrf_cloud.h:415
struct nrf_cloud_obj_shadow_data * shadow
Definition nrf_cloud.h:419
Asynchronous events received from the module.
Definition nrf_cloud.h:409
char * id
Definition nrf_cloud.h:330
char * path
Definition nrf_cloud.h:332
char * host
Definition nrf_cloud.h:331
int file_size
Definition nrf_cloud.h:333
enum nrf_cloud_fota_type type
Definition nrf_cloud.h:328
Common FOTA job info.
Definition nrf_cloud.h:327
struct nrf_modem_gnss_pvt_data_frame * mdm_pvt
Definition nrf_cloud.h:623
enum nrf_cloud_gnss_type type
Definition nrf_cloud.h:609
struct nrf_cloud_gnss_pvt pvt
Definition nrf_cloud.h:616
struct nrf_modem_gnss_nmea_data_frame * mdm_nmea
Definition nrf_cloud.h:621
struct nrf_cloud_gnss_nmea nmea
Definition nrf_cloud.h:618
int64_t ts_ms
Definition nrf_cloud.h:613
GNSS data to be sent to nRF Cloud as a device message.
Definition nrf_cloud.h:607
const char * sentence
Definition nrf_cloud.h:603
NMEA data.
Definition nrf_cloud.h:599
uint8_t has_heading
Definition nrf_cloud.h:576
float heading
Definition nrf_cloud.h:569
double lon
Definition nrf_cloud.h:560
uint8_t has_alt
Definition nrf_cloud.h:572
uint8_t has_speed
Definition nrf_cloud.h:574
float alt
Definition nrf_cloud.h:565
float accuracy
Definition nrf_cloud.h:562
double lat
Definition nrf_cloud.h:558
float speed
Definition nrf_cloud.h:567
PVT data.
Definition nrf_cloud.h:556
struct nrf_cloud_data data
Definition nrf_cloud.h:631
uint16_t id
Definition nrf_cloud.h:632
Structure to hold message received from nRF Cloud.
Definition nrf_cloud.h:630
struct dfu_target_fmfu_fdev * fmfu_dev_inf
Definition nrf_cloud.h:677
const char * application_version
Definition nrf_cloud.h:685
nrf_cloud_event_handler_t event_handler
Definition nrf_cloud.h:665
void * smp_reset_cb
Definition nrf_cloud.h:691
struct nrf_cloud_os_mem_hooks * hooks
Definition nrf_cloud.h:681
char * client_id
Definition nrf_cloud.h:671
Initialization parameters for the module.
Definition nrf_cloud.h:663
enum nrf_cloud_shadow_info device
Definition nrf_cloud.h:503
enum nrf_cloud_shadow_info sim
Definition nrf_cloud.h:505
enum nrf_cloud_shadow_info network
Definition nrf_cloud.h:504
const struct modem_param_info * mpi
Definition nrf_cloud.h:511
const char * application_version
Definition nrf_cloud.h:517
Modem info data and which sections should be encoded.
Definition nrf_cloud.h:502
Object containing shadow update data.
Definition nrf_cloud_codec.h:165
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:395
int64_t ts_ms
Definition nrf_cloud.h:405
enum nrf_cloud_sensor type
Definition nrf_cloud.h:393
uint16_t tag
Definition nrf_cloud.h:401
Sensor data transmission parameters.
Definition nrf_cloud.h:391
enum nrf_cloud_fota_validate_status validate
Definition nrf_cloud.h:368
enum nrf_cloud_fota_type type
Definition nrf_cloud.h:369
enum nrf_cloud_fota_bootloader_status_flags bl_flags
Definition nrf_cloud.h:371
FOTA job info provided to the settings module to track FOTA job status.
Definition nrf_cloud.h:367
uint8_t modem
Definition nrf_cloud.h:442
uint8_t application
Definition nrf_cloud.h:444
uint8_t bootloader
Definition nrf_cloud.h:440
uint8_t modem_full
Definition nrf_cloud.h:446
uint8_t smp
Definition nrf_cloud.h:448
Controls which values are added to the FOTA array in the "serviceInfo" shadow section.
Definition nrf_cloud.h:438
uint8_t button
Definition nrf_cloud.h:485
uint8_t light_sensor
Definition nrf_cloud.h:483
uint8_t log
Definition nrf_cloud.h:475
uint8_t air_quality
Definition nrf_cloud.h:479
uint8_t gnss
Definition nrf_cloud.h:465
uint8_t dictionary_log
Definition nrf_cloud.h:477
uint8_t humidity
Definition nrf_cloud.h:469
uint8_t flip
Definition nrf_cloud.h:467
uint8_t air_pressure
Definition nrf_cloud.h:471
uint8_t rsrp
Definition nrf_cloud.h:473
uint8_t temperature
Definition nrf_cloud.h:463
DEPRECATED - No longer used by nRF Cloud The device data cards on the nRF Cloud portal automatically ...
Definition nrf_cloud.h:460
struct nrf_cloud_svc_info_fota * fota
Definition nrf_cloud.h:523
struct nrf_cloud_svc_info_ui * ui
Definition nrf_cloud.h:528
Structure to specify which components are added to the encoded service info object.
Definition nrf_cloud.h:521
uint32_t len
Definition nrf_cloud.h:385
const void * ptr
Definition nrf_cloud.h:387
MQTT topic.
Definition nrf_cloud.h:383
struct nrf_cloud_data data
Definition nrf_cloud.h:427
struct nrf_cloud_obj * obj
Definition nrf_cloud.h:425
uint32_t id
Definition nrf_cloud.h:434
enum nrf_cloud_topic_type topic_type
Definition nrf_cloud.h:430
enum mqtt_qos qos
Definition nrf_cloud.h:432
Structure used to send data to nRF Cloud.
Definition nrf_cloud.h:423