diff options
author | Inga Stotland <inga.stotland@intel.com> | 2019-10-01 09:27:28 -0700 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2019-10-01 09:51:54 -0700 |
commit | 550dc90dfca02370973e99b8e903576fa7e9d818 (patch) | |
tree | 89c9248506633cdb40d8c3aeaba693f6d7ab70c6 /mesh/model.c | |
parent | f82256202f73ab111e8586d75db1e0412f2120d6 (diff) | |
download | bluez-550dc90dfca02370973e99b8e903576fa7e9d818.tar.gz |
mesh: Make mesh-config API more consistent
This changes the prototypes for mesh_config_model_binding_add() and
mesh_config_model_binding_del() to take the element's address as input
parameter instead of the element's index. The change aligns the API
with other functions that handle storage of model states.
Diffstat (limited to 'mesh/model.c')
-rw-r--r-- | mesh/model.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/mesh/model.c b/mesh/model.c index a06b684a5..f4b856108 100644 --- a/mesh/model.c +++ b/mesh/model.c @@ -561,7 +561,6 @@ static int update_binding(struct mesh_node *node, uint16_t addr, uint32_t id, int status; struct mesh_model *mod; bool is_present, is_vendor; - uint8_t ele_idx; mod = find_model(node, addr, id, &status); if (!mod) { @@ -586,12 +585,10 @@ static int update_binding(struct mesh_node *node, uint16_t addr, uint32_t id, if (is_present && !unbind) return MESH_STATUS_SUCCESS; - ele_idx = (uint8_t) node_get_element_idx(node, addr); - if (unbind) { model_unbind_idx(node, mod, app_idx); if (!mesh_config_model_binding_del(node_config_get(node), - ele_idx, is_vendor, id, app_idx)) + addr, is_vendor, id, app_idx)) return MESH_STATUS_STORAGE_FAIL; return MESH_STATUS_SUCCESS; @@ -601,7 +598,7 @@ static int update_binding(struct mesh_node *node, uint16_t addr, uint32_t id, return MESH_STATUS_INSUFF_RESOURCES; if (!mesh_config_model_binding_add(node_config_get(node), - ele_idx, is_vendor, id, app_idx)) + addr, is_vendor, id, app_idx)) return MESH_STATUS_STORAGE_FAIL; model_bind_idx(node, mod, app_idx); |