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