nRF Connect SDK API 2.8.99
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
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
564
569typedef struct {
570
598
611
622
631
640 const char *server_uri;
641
655
677
691
708
719
734
744 const char *apn;
745
756 uint8_t pdn_type;
757
769 const char *manufacturer;
770
782 const char *model_number;
783
795 const char *device_type;
796
808 const char *hardware_version;
809
826 const char *software_version;
827
833
851
870#define LWM2M_CARRIER_MODEM_INIT_SUCCESS 0
872#define LWM2M_CARRIER_MODEM_INIT_UPDATED 1
874#define LWM2M_CARRIER_MODEM_INIT_UPDATE_FAILED 2
885#define LWM2M_CARRIER_MODEM_MODE_POWER_OFF 0
887#define LWM2M_CARRIER_MODEM_MODE_LTE_ACTIVATED 1
889#define LWM2M_CARRIER_MODEM_MODE_LTE_DEACTIVATED 2
900#define LWM2M_CARRIER_REQUEST_REBOOT 0
904#define LWM2M_CARRIER_REQUEST_LINK_UP 1
908#define LWM2M_CARRIER_REQUEST_LINK_DOWN 2
915#define LWM2M_CARRIER_REQUEST_REGISTER 3
920#define LWM2M_CARRIER_REQUEST_DEREGISTER 4
934
945
955
969int lwm2m_carrier_request(int request);
970
989int lwm2m_carrier_data_send(const uint16_t *path, uint8_t path_len);
990
1005
1028#define LWM2M_CARRIER_OBJECT_BINARY_APP_DATA_CONTAINER 19
1033#define LWM2M_CARRIER_OBJECT_APP_DATA_CONTAINER 10250
1044#define LWM2M_CARRIER_POWER_SOURCE_DC 0
1045#define LWM2M_CARRIER_POWER_SOURCE_INTERNAL_BATTERY 1
1046#define LWM2M_CARRIER_POWER_SOURCE_EXTERNAL_BATTERY 2
1047#define LWM2M_CARRIER_POWER_SOURCE_ETHERNET 4
1048#define LWM2M_CARRIER_POWER_SOURCE_USB 5
1049#define LWM2M_CARRIER_POWER_SOURCE_AC 6
1050#define LWM2M_CARRIER_POWER_SOURCE_SOLAR 7
1063#define LWM2M_CARRIER_ERROR_CODE_NO_ERROR 0
1064#define LWM2M_CARRIER_ERROR_CODE_LOW_CHARGE 1
1065#define LWM2M_CARRIER_ERROR_CODE_EXTERNAL_SUPPLY_OFF 2
1066#define LWM2M_CARRIER_ERROR_CODE_GPS_FAILURE 3
1067#define LWM2M_CARRIER_ERROR_CODE_LOW_SIGNAL 4
1068#define LWM2M_CARRIER_ERROR_CODE_OUT_OF_MEMORY 5
1069#define LWM2M_CARRIER_ERROR_CODE_SMS_FAILURE 6
1070#define LWM2M_CARRIER_ERROR_CODE_IP_CONNECTIVITY_FAILURE 7
1071#define LWM2M_CARRIER_ERROR_CODE_PERIPHERAL_MALFUNCTION 8
1086#define LWM2M_CARRIER_BATTERY_STATUS_NORMAL 0
1087#define LWM2M_CARRIER_BATTERY_STATUS_CHARGING 1
1088#define LWM2M_CARRIER_BATTERY_STATUS_CHARGE_COMPLETE 2
1089#define LWM2M_CARRIER_BATTERY_STATUS_DAMAGED 3
1090#define LWM2M_CARRIER_BATTERY_STATUS_LOW_BATTERY 4
1091#define LWM2M_CARRIER_BATTERY_STATUS_NOT_INSTALLED 5
1092#define LWM2M_CARRIER_BATTERY_STATUS_UNKNOWN 6
1105#define LWM2M_CARRIER_IDENTITY_ID 0
1106#define LWM2M_CARRIER_IDENTITY_MANUFACTURER 1
1107#define LWM2M_CARRIER_IDENTITY_MODEL 2
1108#define LWM2M_CARRIER_IDENTITY_SW_VERSION 3
1124void lwm2m_carrier_time_read(int32_t *utc_time, int *utc_offset, const char **tz);
1125
1136
1147
1158
1171
1184
1197
1218int lwm2m_carrier_avail_power_sources_set(const uint8_t *power_sources, uint8_t power_source_count);
1219
1235int lwm2m_carrier_power_source_voltage_set(uint8_t power_source, int32_t value);
1236
1252int lwm2m_carrier_power_source_current_set(uint8_t power_source, int32_t value);
1253
1268int lwm2m_carrier_battery_level_set(uint8_t battery_level);
1269
1285int lwm2m_carrier_battery_status_set(int32_t battery_status);
1286
1305
1316
1327int lwm2m_carrier_memory_total_set(uint32_t memory_total);
1328
1338
1358int lwm2m_carrier_identity_read(uint16_t instance_id, uint16_t identity_type, char *buffer,
1359 uint16_t *buffer_len);
1360
1378int lwm2m_carrier_identity_write(uint16_t instance_id, uint16_t identity_type, const char *value);
1379
1392
1409int lwm2m_carrier_location_set(double latitude, double longitude, float altitude,
1410 uint32_t timestamp, float uncertainty);
1411
1433int lwm2m_carrier_velocity_set(int heading, float speed_h, float speed_v, float uncertainty_h,
1434 float uncertainty_v);
1435
1468int lwm2m_carrier_app_data_set(const uint16_t *path, uint16_t path_len, const uint8_t *buffer,
1469 size_t buffer_len);
1470
1485int lwm2m_carrier_log_data_set(const uint8_t *buffer, size_t buffer_len);
1486
1487#ifdef __cplusplus
1488}
1489#endif
1490
1493#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:831
const char * apn
Definition lwm2m_carrier.h:744
bool is_bootstrap_server
Definition lwm2m_carrier.h:630
const char * device_type
Definition lwm2m_carrier.h:795
const char * manufacturer
Definition lwm2m_carrier.h:769
int32_t coap_con_interval
Definition lwm2m_carrier.h:718
bool disable_queue_mode
Definition lwm2m_carrier.h:621
const char * model_number
Definition lwm2m_carrier.h:782
uint8_t pdn_type
Definition lwm2m_carrier.h:756
uint32_t server_sec_tag
Definition lwm2m_carrier.h:654
bool disable_auto_register
Definition lwm2m_carrier.h:610
const char * hardware_version
Definition lwm2m_carrier.h:808
int32_t server_lifetime
Definition lwm2m_carrier.h:690
const char * software_version
Definition lwm2m_carrier.h:826
uint8_t server_binding
Definition lwm2m_carrier.h:676
int32_t session_idle_timeout
Definition lwm2m_carrier.h:707
uint16_t firmware_download_timeout
Definition lwm2m_carrier.h:733
uint32_t carriers_enabled
Definition lwm2m_carrier.h:597
const char * server_uri
Definition lwm2m_carrier.h:640
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