/* Save model publication to config file */
if (!mesh_config_model_pub_add(node_config_get(node), ele_addr,
- vendor ? id : MODEL_ID(id),
- vendor, &db_pub))
+ vendor ? id : MODEL_ID(id),
+ vendor, &db_pub))
status = MESH_STATUS_STORAGE_FAIL;
}
}
static uint16_t cfg_sub_get_msg(struct mesh_node *node, const uint8_t *pkt,
- uint16_t size)
+ uint16_t size)
{
uint16_t ele_addr, n, sub_len;
uint32_t id;
if (opcode == OP_CONFIG_MODEL_SUB_VIRT_OVERWRITE ||
opcode == OP_CONFIG_MODEL_SUB_OVERWRITE)
+
if (!mesh_config_model_sub_del_all(cfg, ele_addr, id, vendor))
- return false;
+ return false;
return mesh_config_model_sub_add(cfg, ele_addr, id, vendor, &db_sub);
}
if (msg[n] == MESH_STATUS_SUCCESS &&
!save_cfg_sub(node, ele_addr, id, vendor, NULL, false,
addr, opcode))
-
msg[n] = MESH_STATUS_STORAGE_FAIL;
if (vendor) {
if (msg[n] == MESH_STATUS_SUCCESS) {
struct mesh_config *cfg = node_config_get(node);
+
if (!mesh_config_model_sub_del_all(cfg, ele_addr,
vendor ? id : MODEL_ID(id),
vendor))