Skip to content

Commit 7d20d3a

Browse files
stig-bjorlykkefabiobaltieri
authored andcommitted
net: lwm2m: Make BinaryAppDataContainer instances configurable
Add Kconfig variables for BinaryAppDataContainer instance count and data instance count. Signed-off-by: Stig Bjørlykke <[email protected]>
1 parent 07b4d3a commit 7d20d3a

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

subsys/net/lib/lwm2m/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,24 @@ config LWM2M_BINARYAPPDATA_OBJ_SUPPORT
660660
help
661661
Include support for LwM2M BinaryAppDataContainer Object
662662

663+
if LWM2M_BINARYAPPDATA_OBJ_SUPPORT
664+
config LWM2M_BINARYAPPDATA_INSTANCE_COUNT
665+
int "Maximum # of BinaryAppDataContainer object instances"
666+
default 2
667+
range 1 10
668+
help
669+
This setting establishes the total count of BinaryAppDataContainer
670+
instances available to the client.
671+
672+
config LWM2M_BINARYAPPDATA_DATA_INSTANCE_COUNT
673+
int "Maximum # of BinaryAppDataContainer data resource instances"
674+
default 2
675+
range 1 10
676+
help
677+
This setting establishes the total count of BinaryAppDataContainer
678+
data resource instances available to the client.
679+
endif # LWM2M_BINARYAPPDATA_OBJ_SUPPORT
680+
663681
config LWM2M_EVENT_LOG_OBJ_SUPPORT
664682
bool "LwM2M Event Log Object (ID 20)"
665683
help

subsys/net/lib/lwm2m/lwm2m_obj_binaryappdata.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
2929
#define BINARYAPPDATA_VERSION_MINOR 0
3030
#define BINARYAPPDATA_MAX_ID 6
3131

32-
/* Support 2 instances of binary data in one object */
33-
#define BINARYAPPDATA_DATA_INSTANCE_MAX 2
34-
35-
/* Support 2 multi instance object */
36-
#define MAX_INSTANCE_COUNT 2
32+
#define MAX_INSTANCE_COUNT CONFIG_LWM2M_BINARYAPPDATA_INSTANCE_COUNT
33+
#define BINARYAPPDATA_DATA_INSTANCE_MAX CONFIG_LWM2M_BINARYAPPDATA_DATA_INSTANCE_COUNT
3734

3835
/*
3936
* Calculate resource instances as follows:

0 commit comments

Comments
 (0)