nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
lwm2m_carrier.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019-2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef LWM2M_CARRIER_H__
8#define LWM2M_CARRIER_H__
9
15#include <stdint.h>
16#include <stddef.h>
17#include <stdbool.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
51#define LWM2M_CARRIER_EVENT_LTE_LINK_UP 1
52
63#define LWM2M_CARRIER_EVENT_LTE_LINK_DOWN 2
64
71#define LWM2M_CARRIER_EVENT_LTE_POWER_OFF 3
72
87#define LWM2M_CARRIER_EVENT_BOOTSTRAPPED 4
88
106#define LWM2M_CARRIER_EVENT_REGISTERED 5
107
118#define LWM2M_CARRIER_EVENT_DEREGISTERED 6
119
129#define LWM2M_CARRIER_EVENT_DEFERRED 7
130
145#define LWM2M_CARRIER_EVENT_FOTA_START 8
146
150#define LWM2M_CARRIER_EVENT_FOTA_SUCCESS 9
151
162#define LWM2M_CARRIER_EVENT_REBOOT 10
163
172#define LWM2M_CARRIER_EVENT_MODEM_DOMAIN 11
173
185#define LWM2M_CARRIER_EVENT_APP_DATA 12
186
193#define LWM2M_CARRIER_EVENT_MODEM_INIT 13
194
201#define LWM2M_CARRIER_EVENT_MODEM_SHUTDOWN 14
202
213#define LWM2M_CARRIER_EVENT_ERROR_CODE_RESET 15
214
222#define LWM2M_CARRIER_EVENT_ERROR 20
229typedef struct {
231 const char *uri;
233
240#define LWM2M_CARRIER_MODEM_EVENT_ME_OVERHEATED 0
242#define LWM2M_CARRIER_MODEM_EVENT_ME_BATTERY_LOW 1
244#define LWM2M_CARRIER_MODEM_EVENT_RESET_LOOP 2
252
260#define LWM2M_CARRIER_APP_DATA_EVENT_DATA_WRITE 0
262#define LWM2M_CARRIER_APP_DATA_EVENT_OBSERVE_START 1
264#define LWM2M_CARRIER_APP_DATA_EVENT_OBSERVE_STOP 2
271typedef struct {
273 const uint8_t *buffer;
280 uint16_t path[4];
282 uint8_t path_len;
284 uint8_t type;
286
295#define LWM2M_CARRIER_DEFERRED_NO_REASON 0
296
301#define LWM2M_CARRIER_DEFERRED_PDN_ACTIVATE 1
302
306#define LWM2M_CARRIER_DEFERRED_BOOTSTRAP_NO_ROUTE 2
307
312#define LWM2M_CARRIER_DEFERRED_BOOTSTRAP_CONNECT 3
313
318#define LWM2M_CARRIER_DEFERRED_BOOTSTRAP_SEQUENCE 4
319
323#define LWM2M_CARRIER_DEFERRED_SERVER_NO_ROUTE 5
324
329#define LWM2M_CARRIER_DEFERRED_SERVER_CONNECT 6
330
335#define LWM2M_CARRIER_DEFERRED_SERVER_REGISTRATION 7
336
341#define LWM2M_CARRIER_DEFERRED_SERVICE_UNAVAILABLE 8
342
346#define LWM2M_CARRIER_DEFERRED_SIM_MSISDN 9
353typedef struct {
355 uint32_t reason;
357 int32_t timeout;
359
367#define LWM2M_CARRIER_ERROR_NO_ERROR 0
369#define LWM2M_CARRIER_ERROR_LTE_LINK_UP_FAIL 1
371#define LWM2M_CARRIER_ERROR_LTE_LINK_DOWN_FAIL 2
373#define LWM2M_CARRIER_ERROR_BOOTSTRAP 3
381#define LWM2M_CARRIER_ERROR_FOTA_FAIL 4
383#define LWM2M_CARRIER_ERROR_CONFIGURATION 5
385#define LWM2M_CARRIER_ERROR_INIT 6
387#define LWM2M_CARRIER_ERROR_RUN 7
389#define LWM2M_CARRIER_ERROR_CONNECT 8
390
397typedef struct {
399 uint32_t type;
401 int32_t value;
403
408typedef struct {
410 uint32_t type;
412 union {
424 } data;
426
442
467#define LWM2M_CARRIER_GENERIC 0x00000001
468
473#define LWM2M_CARRIER_VERIZON 0x00000002
474
479#define LWM2M_CARRIER_LG_UPLUS 0x00000008
480
485#define LWM2M_CARRIER_T_MOBILE 0x00000010
486
491#define LWM2M_CARRIER_SOFTBANK 0x00000020
492
497#define LWM2M_CARRIER_BELL_CA 0x00000040
508#define LWM2M_CARRIER_SERVER_BINDING_UDP 0x01
510#define LWM2M_CARRIER_SERVER_BINDING_NONIP 0x02
521#define LWM2M_CARRIER_PDN_TYPE_IPV4V6 0
523#define LWM2M_CARRIER_PDN_TYPE_IPV4 1
525#define LWM2M_CARRIER_PDN_TYPE_IPV6 2
527#define LWM2M_CARRIER_PDN_TYPE_NONIP 3
538#define LWM2M_CARRIER_LG_UPLUS_DEVICE_SERIAL_NO_IMEI 0
541#define LWM2M_CARRIER_LG_UPLUS_DEVICE_SERIAL_NO_2DID 1
548typedef struct {
555 const char *service_code;
564
569typedef struct {
570
598
611
625
636
645
654 const char *server_uri;
655
669
691
705
722
733
748
758 const char *apn;
759
770 uint8_t pdn_type;
771
783 const char *manufacturer;
784
796 const char *model_number;
797
809 const char *device_type;
810
822 const char *hardware_version;
823
840 const char *software_version;
841
847
865
884#define LWM2M_CARRIER_MODEM_INIT_SUCCESS 0
886#define LWM2M_CARRIER_MODEM_INIT_UPDATED 1
888#define LWM2M_CARRIER_MODEM_INIT_UPDATE_FAILED 2
899#define LWM2M_CARRIER_REQUEST_REBOOT 0
903#define LWM2M_CARRIER_REQUEST_LINK_UP 1
907#define LWM2M_CARRIER_REQUEST_LINK_DOWN 2
914#define LWM2M_CARRIER_REQUEST_REGISTER 3
919#define LWM2M_CARRIER_REQUEST_DEREGISTER 4
933
944
954
968int lwm2m_carrier_request(int request);
969
988int lwm2m_carrier_data_send(const uint16_t *path, uint8_t path_len);
989
1004
1027#define LWM2M_CARRIER_OBJECT_BINARY_APP_DATA_CONTAINER 19
1032#define LWM2M_CARRIER_OBJECT_APP_DATA_CONTAINER 10250
1043#define LWM2M_CARRIER_POWER_SOURCE_DC 0
1044#define LWM2M_CARRIER_POWER_SOURCE_INTERNAL_BATTERY 1
1045#define LWM2M_CARRIER_POWER_SOURCE_EXTERNAL_BATTERY 2
1046#define LWM2M_CARRIER_POWER_SOURCE_ETHERNET 4
1047#define LWM2M_CARRIER_POWER_SOURCE_USB 5
1048#define LWM2M_CARRIER_POWER_SOURCE_AC 6
1049#define LWM2M_CARRIER_POWER_SOURCE_SOLAR 7
1062#define LWM2M_CARRIER_ERROR_CODE_NO_ERROR 0
1063#define LWM2M_CARRIER_ERROR_CODE_LOW_CHARGE 1
1064#define LWM2M_CARRIER_ERROR_CODE_EXTERNAL_SUPPLY_OFF 2
1065#define LWM2M_CARRIER_ERROR_CODE_GPS_FAILURE 3
1066#define LWM2M_CARRIER_ERROR_CODE_LOW_SIGNAL 4
1067#define LWM2M_CARRIER_ERROR_CODE_OUT_OF_MEMORY 5
1068#define LWM2M_CARRIER_ERROR_CODE_SMS_FAILURE 6
1069#define LWM2M_CARRIER_ERROR_CODE_IP_CONNECTIVITY_FAILURE 7
1070#define LWM2M_CARRIER_ERROR_CODE_PERIPHERAL_MALFUNCTION 8
1085#define LWM2M_CARRIER_BATTERY_STATUS_NORMAL 0
1086#define LWM2M_CARRIER_BATTERY_STATUS_CHARGING 1
1087#define LWM2M_CARRIER_BATTERY_STATUS_CHARGE_COMPLETE 2
1088#define LWM2M_CARRIER_BATTERY_STATUS_DAMAGED 3
1089#define LWM2M_CARRIER_BATTERY_STATUS_LOW_BATTERY 4
1090#define LWM2M_CARRIER_BATTERY_STATUS_NOT_INSTALLED 5
1091#define LWM2M_CARRIER_BATTERY_STATUS_UNKNOWN 6
1104#define LWM2M_CARRIER_IDENTITY_ID 0
1105#define LWM2M_CARRIER_IDENTITY_MANUFACTURER 1
1106#define LWM2M_CARRIER_IDENTITY_MODEL 2
1107#define LWM2M_CARRIER_IDENTITY_SW_VERSION 3
1123void lwm2m_carrier_time_read(int32_t *utc_time, int *utc_offset, const char **tz);
1124
1135
1146
1157
1170
1183
1196
1217int lwm2m_carrier_avail_power_sources_set(const uint8_t *power_sources, uint8_t power_source_count);
1218
1234int lwm2m_carrier_power_source_voltage_set(uint8_t power_source, int32_t value);
1235
1251int lwm2m_carrier_power_source_current_set(uint8_t power_source, int32_t value);
1252
1267int lwm2m_carrier_battery_level_set(uint8_t battery_level);
1268
1284int lwm2m_carrier_battery_status_set(int32_t battery_status);
1285
1304
1315
1326int lwm2m_carrier_memory_total_set(uint32_t memory_total);
1327
1337
1357int lwm2m_carrier_identity_read(uint16_t instance_id, uint16_t identity_type, char *buffer,
1358 uint16_t *buffer_len);
1359
1377int lwm2m_carrier_identity_write(uint16_t instance_id, uint16_t identity_type, const char *value);
1378
1391
1408int lwm2m_carrier_location_set(double latitude, double longitude, float altitude,
1409 uint32_t timestamp, float uncertainty);
1410
1432int lwm2m_carrier_velocity_set(int heading, float speed_h, float speed_v, float uncertainty_h,
1433 float uncertainty_v);
1434
1467int lwm2m_carrier_app_data_set(const uint16_t *path, uint16_t path_len, const uint8_t *buffer,
1468 size_t buffer_len);
1469
1484int lwm2m_carrier_log_data_set(const uint8_t *buffer, size_t buffer_len);
1485
1486#ifdef __cplusplus
1487}
1488#endif
1489
1492#endif /* LWM2M_CARRIER_H__ */
void lwm2m_carrier_on_modem_init(int result)
void lwm2m_carrier_on_modem_cfun(int mode)
int lwm2m_carrier_data_send(const uint16_t *path, uint8_t path_len)
int lwm2m_carrier_request(int request)
void lwm2m_carrier_on_modem_shutdown(void)
int lwm2m_carrier_custom_init(lwm2m_carrier_config_t *config)
int lwm2m_carrier_event_handler(const lwm2m_carrier_event_t *event)
uint32_t lwm2m_carrier_event_modem_domain_t
Definition: lwm2m_carrier.h:251
int lwm2m_carrier_main(const lwm2m_carrier_config_t *config)
int lwm2m_carrier_power_source_current_set(uint8_t power_source, int32_t value)
int lwm2m_carrier_utc_offset_write(int offset)
int lwm2m_carrier_timezone_write(const char *tz)
int lwm2m_carrier_identity_read(uint16_t instance_id, uint16_t identity_type, char *buffer, uint16_t *buffer_len)
int lwm2m_carrier_app_data_set(const uint16_t *path, uint16_t path_len, const uint8_t *buffer, size_t buffer_len)
int lwm2m_carrier_log_data_set(const uint8_t *buffer, size_t buffer_len)
int lwm2m_carrier_portfolio_instance_create(uint16_t instance_id)
int lwm2m_carrier_memory_free_read(void)
void lwm2m_carrier_time_read(int32_t *utc_time, int *utc_offset, const char **tz)
int lwm2m_carrier_utc_time_write(int32_t time)
int lwm2m_carrier_battery_level_set(uint8_t battery_level)
int lwm2m_carrier_utc_offset_read(void)
int lwm2m_carrier_battery_status_set(int32_t battery_status)
int lwm2m_carrier_avail_power_sources_set(const uint8_t *power_sources, uint8_t power_source_count)
int lwm2m_carrier_velocity_set(int heading, float speed_h, float speed_v, float uncertainty_h, float uncertainty_v)
char * lwm2m_carrier_timezone_read(void)
int lwm2m_carrier_power_source_voltage_set(uint8_t power_source, int32_t value)
int32_t lwm2m_carrier_utc_time_read(void)
int lwm2m_carrier_error_code_remove(int32_t error)
int lwm2m_carrier_error_code_add(int32_t error)
int lwm2m_carrier_location_set(double latitude, double longitude, float altitude, uint32_t timestamp, float uncertainty)
int lwm2m_carrier_memory_total_set(uint32_t memory_total)
int lwm2m_carrier_identity_write(uint16_t instance_id, uint16_t identity_type, const char *value)
lwm2m_carrier_lg_uplus_config_t lg_uplus
Definition: lwm2m_carrier.h:845
const char * apn
Definition: lwm2m_carrier.h:758
bool is_bootstrap_server
Definition: lwm2m_carrier.h:644
const char * device_type
Definition: lwm2m_carrier.h:809
const char * manufacturer
Definition: lwm2m_carrier.h:783
int32_t coap_con_interval
Definition: lwm2m_carrier.h:732
bool disable_queue_mode
Definition: lwm2m_carrier.h:635
const char * model_number
Definition: lwm2m_carrier.h:796
uint8_t pdn_type
Definition: lwm2m_carrier.h:770
uint32_t server_sec_tag
Definition: lwm2m_carrier.h:668
bool disable_bootstrap_from_smartcard
Definition: lwm2m_carrier.h:624
bool disable_auto_register
Definition: lwm2m_carrier.h:610
const char * hardware_version
Definition: lwm2m_carrier.h:822
int32_t server_lifetime
Definition: lwm2m_carrier.h:704
const char * software_version
Definition: lwm2m_carrier.h:840
uint8_t server_binding
Definition: lwm2m_carrier.h:690
int32_t session_idle_timeout
Definition: lwm2m_carrier.h:721
uint16_t firmware_download_timeout
Definition: lwm2m_carrier.h:747
uint32_t carriers_enabled
Definition: lwm2m_carrier.h:597
const char * server_uri
Definition: lwm2m_carrier.h:654
Definition: lwm2m_carrier.h:569
uint8_t path_len
Definition: lwm2m_carrier.h:282
const uint8_t * buffer
Definition: lwm2m_carrier.h:273
size_t buffer_len
Definition: lwm2m_carrier.h:275
uint8_t type
Definition: lwm2m_carrier.h:284
Definition: lwm2m_carrier.h:271
uint32_t reason
Definition: lwm2m_carrier.h:355
int32_t timeout
Definition: lwm2m_carrier.h:357
Definition: lwm2m_carrier.h:353
int32_t value
Definition: lwm2m_carrier.h:401
uint32_t type
Definition: lwm2m_carrier.h:399
Definition: lwm2m_carrier.h:397
const char * uri
Definition: lwm2m_carrier.h:231
Definition: lwm2m_carrier.h:229
lwm2m_carrier_event_error_t * error
Definition: lwm2m_carrier.h:422
lwm2m_carrier_event_app_data_t * app_data
Definition: lwm2m_carrier.h:418
lwm2m_carrier_event_modem_domain_t * modem_domain
Definition: lwm2m_carrier.h:416
uint32_t type
Definition: lwm2m_carrier.h:410
lwm2m_carrier_event_fota_start_t * fota_start
Definition: lwm2m_carrier.h:414
lwm2m_carrier_event_deferred_t * deferred
Definition: lwm2m_carrier.h:420
Definition: lwm2m_carrier.h:408
uint8_t device_serial_no_type
Definition: lwm2m_carrier.h:562
const char * service_code
Definition: lwm2m_carrier.h:555
Definition: lwm2m_carrier.h:548