nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
lwm2m_client_utils.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/net/lwm2m.h>
#include <modem/lte_lc.h>

Go to the source code of this file.

Data Structures

struct  modem_mode_change
 Callback used for querying permission from the app to proceed when modem's state changes. More...
 
struct  lwm2m_fota_download_start
 
struct  lwm2m_fota_download_finished
 
struct  lwm2m_fota_update_request
 
struct  lwm2m_fota_reconnect
 
struct  lwm2m_fota_update_failure
 
struct  lwm2m_fota_event
 

Macros

#define LWM2M_OBJECT_CELLULAR_CONNECTIVITY_ID   10
 
#define LWM2M_OBJECT_ADV_FIRMWARE_ID   33629
 
#define RESULT_ADV_FOTA_CANCELLED   10
 
#define RESULT_ADV_FOTA_DEFERRED   11
 
#define RESULT_ADV_CONFLICT_STATE   12
 
#define RESULT_ADV_DEPENDENCY_ERR   13
 
#define REBOOT_SOURCE_DEVICE_OBJ   0
 
#define REBOOT_SOURCE_FOTA_OBJ   1
 
#define LWM2M_FOTA_PACKAGE_ID   0
 
#define LWM2M_FOTA_PACKAGE_URI_ID   1
 
#define LWM2M_FOTA_UPDATE_ID   2
 
#define LWM2M_FOTA_STATE_ID   3
 
#define LWM2M_FOTA_UPDATE_RESULT_ID   5
 
#define LWM2M_FOTA_PACKAGE_NAME_ID   6
 
#define LWM2M_FOTA_PACKAGE_VERSION_ID   7
 
#define LWM2M_FOTA_UPDATE_PROTO_SUPPORT_ID   8
 
#define LWM2M_FOTA_UPDATE_DELIV_METHOD_ID   9
 
#define LWM2M_FOTA_CANCEL_ID   10
 
#define LWM2M_FOTA_SEVERITY_ID   11
 
#define LWM2M_FOTA_LAST_STATE_CHANGE_TIME_ID   12
 
#define LWM2M_FOTA_MAXIMUM_DEFERRED_PERIOD_ID   13
 
#define LWM2M_ADV_FOTA_COMPONENT_NAME_ID   14
 
#define LWM2M_ADV_FOTA_CURRENT_VERSION_ID   15
 
#define LWM2M_ADV_FOTA_LINKED_INSTANCES_ID   16
 
#define LWM2M_ADV_FOTA_CONFLICTING_INSTANCES_ID   17
 

Typedefs

typedef int(* modem_mode_cb_t) (enum lte_lc_func_mode new_mode, void *user_data)
 Callback to request a modem state change, being it powering off, flight mode etc.
 
typedef int(* lwm2m_firmware_event_cb_t) (struct lwm2m_fota_event *event)
 Firmware update event callback.
 

Enumerations

enum  lwm2m_fota_event_id {
  LWM2M_FOTA_DOWNLOAD_START , LWM2M_FOTA_DOWNLOAD_FINISHED , LWM2M_FOTA_UPDATE_IMAGE_REQ , LWM2M_FOTA_UPDATE_MODEM_RECONNECT_REQ ,
  LWM2M_FOTA_UPDATE_ERROR
}
 
enum  lwm2m_rai_mode { LWM2M_RAI_MODE_DISABLED = 0 , LWM2M_RAI_MODE_ENABLED = 1 }
 

Functions

int lwm2m_init_security (struct lwm2m_ctx *ctx, char *endpoint, struct modem_mode_change *mmode)
 Initialize Security object support for nrf91.
 
int lwm2m_security_set_psk (uint16_t sec_obj_inst, const void *psk, int psk_len, bool psk_is_hex, const char *psk_id)
 Set security object to PSK mode.
 
int lwm2m_security_set_certificate (uint16_t sec_obj_inst, const void *cert, int cert_len, const void *private_key, int key_len, const void *ca_chain, int ca_len)
 Set security object to certificate mode.
 
bool lwm2m_security_needs_bootstrap (void)
 Check if the client credentials are already stored.
 
int lwm2m_device_reboot_cb (uint16_t obj_inst_id, uint8_t *args, uint16_t args_len)
 Reboot handler for a device object.
 
void * firmware_read_cb (uint16_t obj_inst_id, size_t *data_len)
 Firmware read callback.
 
int lwm2m_init_firmware_cb (lwm2m_firmware_event_cb_t cb)
 Initialize Firmware update utils library with callback.
 
int lwm2m_init_image (void)
 Initialize Image Update object.
 
int lwm2m_rai_req (enum lwm2m_rai_mode mode)
 Function for requesting modem to enable or disable use of AS RAI.
 
int lwm2m_utils_enable_conneval (enum lte_lc_energy_estimate min_energy_estimate, uint64_t maximum_delay_s, uint64_t poll_period_ms)
 Enable connection pre-evaluation module.
 
void lwm2m_utils_disable_conneval (void)
 Disable connection pre-evaluation.
 
int lwm2m_utils_conneval (struct lwm2m_ctx *client, enum lwm2m_rd_client_event *client_event)
 Start connection pre-evaluation.
 
void lwm2m_utils_connection_manage (struct lwm2m_ctx *client, enum lwm2m_rd_client_event *client_event)
 LwM2M utils connection event handler.
 
void lwm2m_utils_rai_event_cb (struct lwm2m_ctx *client, enum lwm2m_rd_client_event *client_event)
 LwM2M utils RAI event handler.
 
uint8_t lwm2m_adv_firmware_get_update_state (uint16_t obj_inst_id)
 
void lwm2m_adv_firmware_set_update_state (uint16_t obj_inst_id, uint8_t state)
 
uint8_t lwm2m_adv_firmware_get_update_result (uint16_t obj_inst_id)
 
void lwm2m_adv_firmware_set_update_result (uint16_t obj_inst_id, uint8_t result)
 
void lwm2m_adv_firmware_set_write_cb (uint16_t obj_inst_id, lwm2m_engine_set_data_cb_t cb)
 
lwm2m_engine_set_data_cb_t lwm2m_adv_firmware_get_write_cb (uint16_t obj_inst_id)
 
void lwm2m_adv_firmware_set_update_cb (uint16_t obj_inst_id, lwm2m_engine_execute_cb_t cb)
 
lwm2m_engine_execute_cb_t lwm2m_adv_firmware_get_update_cb (uint16_t obj_inst_id)
 
int lwm2m_adv_firmware_create_inst (const char *component, lwm2m_engine_set_data_cb_t write_callback, lwm2m_engine_execute_cb_t update_callback)
 
static int lwm2m_init_firmware (void)
 
static int lwm2m_init_device (void)
 
static int lwm2m_init_cellular_connectivity_object (void)
 
static int lwm2m_init_connmon (void)
 
static int lwm2m_init_location (void)