Skip to content

Commit 43c08d5

Browse files
MrOneTwocarlescufi
authored andcommitted
lwm2m: Fix multi res inst, create flags and post write callback for SWMGMT
The multi resource and create flags were reversed, meaning that resources were defined as multi resource but weren't being created by default. That doesn't reflect the LWM2M Software Management, which specifies which objects can be multi resource and which are mandatory. The post write callbacks were assigned to the validate callbacks. Signed-off-by: Michal Ciesielski <[email protected]>
1 parent 20d34bd commit 43c08d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsys/net/lib/lwm2m/lwm2m_obj_swmgmt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,19 +731,19 @@ static struct lwm2m_engine_obj_inst *swmgmt_create(uint16_t obj_inst_id)
731731
res_inst_idx, &instance->package_name, PACKAGE_NAME_LEN, 0);
732732

733733
INIT_OBJ_RES_LEN(SWMGMT_PACKAGE_VERSION_ID, res[index], res_idx, res_inst[index],
734-
res_inst_idx, 1, true, false, &instance->package_version,
734+
res_inst_idx, 1, false, true, &instance->package_version,
735735
PACKAGE_VERSION_LEN, 0, state_read_pkg_version, NULL, NULL, NULL, NULL);
736736

737737
INIT_OBJ_RES_OPT(SWMGMT_PACKAGE_ID, res[index], res_idx, res_inst[index], res_inst_idx, 1,
738-
true, false, NULL, NULL, package_write_cb, NULL, NULL);
738+
false, false, NULL, NULL, NULL, package_write_cb, NULL);
739739

740740
#ifdef CONFIG_LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT
741741
INIT_OBJ_RES(SWMGMT_PACKAGE_URI_ID, res[index], res_idx, res_inst[index], res_inst_idx, 1,
742-
true, true, instance->package_uri, PACKAGE_URI_LEN, NULL, NULL, NULL,
742+
false, true, instance->package_uri, PACKAGE_URI_LEN, NULL, NULL, NULL,
743743
package_uri_write_cb, NULL);
744744
#else
745745
INIT_OBJ_RES_OPT(SWMGMT_PACKAGE_URI_ID, res[index], res_idx, res_inst[index], res_inst_idx,
746-
1, true, false, NULL, NULL, package_uri_write_cb, NULL, NULL);
746+
1, false, true, NULL, NULL, NULL, package_uri_write_cb, NULL);
747747
#endif
748748

749749
INIT_OBJ_RES_EXECUTE(SWMGMT_INSTALL_ID, res[index], res_idx, install_cb);

0 commit comments

Comments
 (0)