1# SPDX-License-Identifier: Apache-2.0
2
3zephyr_library()
4
5zephyr_include_directories(.)
6
7zephyr_library_sources(
8    lwm2m_engine.c
9    lwm2m_registry.c
10    lwm2m_observation.c
11    lwm2m_message_handling.c
12    lwm2m_obj_security.c
13    lwm2m_obj_server.c
14    lwm2m_obj_device.c
15    lwm2m_rw_link_format.c
16    lwm2m_rw_plain_text.c
17    lwm2m_rw_opaque.c
18    lwm2m_util.c
19    lwm2m_rd_client.c
20    )
21
22# LWM2M Object Support
23zephyr_library_sources_ifdef(CONFIG_LWM2M_CONN_MON_OBJ_SUPPORT
24    lwm2m_obj_connmon.c
25    )
26zephyr_library_sources_ifdef(CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT
27    lwm2m_obj_firmware.c
28    )
29zephyr_library_sources_ifdef(CONFIG_LWM2M_SWMGMT_OBJ_SUPPORT
30    lwm2m_obj_swmgmt.c
31    )
32zephyr_library_sources_ifdef(CONFIG_LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT
33    lwm2m_obj_firmware_pull.c
34    lwm2m_pull_context.c
35    )
36zephyr_library_sources_ifdef(CONFIG_LWM2M_LOCATION_OBJ_SUPPORT
37    lwm2m_obj_location.c
38    )
39zephyr_library_sources_ifdef(CONFIG_LWM2M_GATEWAY_OBJ_SUPPORT
40    lwm2m_obj_gateway.c
41    )
42zephyr_library_sources_ifdef(CONFIG_LWM2M_PORTFOLIO_OBJ_SUPPORT
43    lwm2m_obj_portfolio.c
44    )
45zephyr_library_sources_ifdef(CONFIG_LWM2M_EVENT_LOG_OBJ_SUPPORT
46    lwm2m_obj_event_log.c
47    )
48zephyr_library_sources_ifdef(CONFIG_LWM2M_BINARYAPPDATA_OBJ_SUPPORT
49    lwm2m_obj_binaryappdata.c
50    )
51zephyr_library_sources_ifdef(CONFIG_LWM2M_ACCESS_CONTROL_ENABLE
52    lwm2m_obj_access_control.c
53    )
54zephyr_library_sources_ifdef(CONFIG_LWM2M_UCIFI_LPWAN
55    ucifi_lpwan.c
56    )
57
58# TLV Support
59zephyr_library_sources_ifdef(CONFIG_LWM2M_RW_OMA_TLV_SUPPORT
60    lwm2m_rw_oma_tlv.c
61    )
62# JSON Support
63zephyr_library_sources_ifdef(CONFIG_LWM2M_RW_JSON_SUPPORT
64    lwm2m_rw_json.c
65    )
66# SENML JSON support
67zephyr_library_sources_ifdef(CONFIG_LWM2M_RW_SENML_JSON_SUPPORT
68    lwm2m_rw_senml_json.c
69    )
70# CBOR support
71zephyr_library_sources_ifdef(CONFIG_LWM2M_RW_CBOR_SUPPORT
72    lwm2m_rw_cbor.c
73    )
74# SENML CBOR support
75zephyr_library_sources_ifdef(CONFIG_LWM2M_RW_SENML_CBOR_SUPPORT
76    lwm2m_rw_senml_cbor.c
77    lwm2m_senml_cbor_decode.c
78    lwm2m_senml_cbor_encode.c
79    )
80
81# IPSO Objects
82zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_TEMP_SENSOR
83    ipso_temp_sensor.c
84    )
85zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_GENERIC_SENSOR
86    ipso_generic_sensor.c
87    )
88zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_HUMIDITY_SENSOR
89    ipso_humidity_sensor.c
90    )
91zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_PRESSURE_SENSOR
92    ipso_pressure_sensor.c
93    )
94zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_LIGHT_CONTROL
95    ipso_light_control.c
96    )
97zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_ACCELEROMETER
98    ipso_accelerometer.c
99    )
100zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_BUZZER
101    ipso_buzzer.c
102    )
103zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_TIMER
104    ipso_timer.c
105    )
106zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_ONOFF_SWITCH
107    ipso_onoff_switch.c
108    )
109zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_PUSH_BUTTON
110    ipso_push_button.c
111    )
112zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_CURRENT_SENSOR
113    ipso_current_sensor.c
114    )
115zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_VOLTAGE_SENSOR
116    ipso_voltage_sensor.c
117    )
118zephyr_library_sources_ifdef(CONFIG_LWM2M_IPSO_FILLING_SENSOR
119    ipso_filling_sensor.c
120    )
121zephyr_library_sources_ifdef(CONFIG_LWM2M_UCIFI_BATTERY
122    ucifi_battery.c
123    )
124
125# Shell commands
126zephyr_library_sources_ifdef(CONFIG_LWM2M_SHELL
127    lwm2m_shell.c
128)
129
130zephyr_linker_sources(SECTIONS iterables.ld)
131
132zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
133