Skip to content

Commit

Permalink
net: lwm2m: Make BinaryAppDataContainer instances configurable
Browse files Browse the repository at this point in the history
Add Kconfig variables for BinaryAppDataContainer instance count
and data instance count.

Signed-off-by: Stig Bjørlykke <[email protected]>
  • Loading branch information
stig-bjorlykke committed Nov 26, 2024
1 parent 6d87bd6 commit 9b9f163
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
18 changes: 18 additions & 0 deletions subsys/net/lib/lwm2m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,24 @@ config LWM2M_BINARYAPPDATA_OBJ_SUPPORT
help
Include support for LwM2M BinaryAppDataContainer Object

if LWM2M_BINARYAPPDATA_OBJ_SUPPORT
config LWM2M_BINARYAPPDATA_INSTANCE_COUNT
int "Maximum # of BinaryAppDataContainer object instances"
default 2
range 1 10
help
This setting establishes the total count of BinaryAppDataContainer
instances available to the client.

config LWM2M_BINARYAPPDATA_DATA_INSTANCE_COUNT
int "Maximum # of BinaryAppDataContainer data resource instances"
default 2
range 1 10
help
This setting establishes the total count of BinaryAppDataContainer
data resource instances available to the client.
endif # LWM2M_BINARYAPPDATA_OBJ_SUPPORT

config LWM2M_EVENT_LOG_OBJ_SUPPORT
bool "LwM2M Event Log Object (ID 20)"
help
Expand Down
7 changes: 2 additions & 5 deletions subsys/net/lib/lwm2m/lwm2m_obj_binaryappdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#define BINARYAPPDATA_VERSION_MINOR 0
#define BINARYAPPDATA_MAX_ID 6

/* Support 2 instances of binary data in one object */
#define BINARYAPPDATA_DATA_INSTANCE_MAX 2

/* Support 2 multi instance object */
#define MAX_INSTANCE_COUNT 2
#define MAX_INSTANCE_COUNT CONFIG_LWM2M_BINARYAPPDATA_INSTANCE_COUNT
#define BINARYAPPDATA_DATA_INSTANCE_MAX CONFIG_LWM2M_BINARYAPPDATA_DATA_INSTANCE_COUNT

/*
* Calculate resource instances as follows:
Expand Down

0 comments on commit 9b9f163

Please sign in to comment.