summaryrefslogtreecommitdiff
path: root/mesh/mesh-config-json.c
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2020-08-06 18:38:25 -0700
committerBrian Gix <brian.gix@intel.com>2020-08-10 14:47:08 -0700
commit5a12b9b757a4610a60da3940649ffa8daf7cf40c (patch)
treed60f42e7c4808d5e300ad034d97c776eef5f7c74 /mesh/mesh-config-json.c
parentca5dfd4ea071c86ff291c688ec9ca3a9b02ae509 (diff)
downloadbluez-5a12b9b757a4610a60da3940649ffa8daf7cf40c.tar.gz
mesh: Clean up handling of config subscription messages
This provides better functional grouping based on whether a group or a virtual label is used for the subscription address. Also, use a single point for sending out the composed Config Server status messages.
Diffstat (limited to 'mesh/mesh-config-json.c')
-rw-r--r--mesh/mesh-config-json.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index deb0019f9..a40f92c01 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
@@ -1069,11 +1069,11 @@ static bool parse_model_subscriptions(json_object *jsubs,
switch (len) {
case 4:
- if (sscanf(str, "%04hx", &subs[i].src.addr) != 1)
+ if (sscanf(str, "%04hx", &subs[i].addr.grp) != 1)
goto fail;
break;
case 32:
- if (!str2hex(str, len, subs[i].src.virt_addr, 16))
+ if (!str2hex(str, len, subs[i].addr.label, 16))
goto fail;
subs[i].virt = true;
break;
@@ -2068,10 +2068,10 @@ bool mesh_config_model_sub_add(struct mesh_config *cfg, uint16_t ele_addr,
return false;
if (!sub->virt) {
- snprintf(buf, 5, "%4.4x", sub->src.addr);
+ snprintf(buf, 5, "%4.4x", sub->addr.grp);
len = 4;
} else {
- hex2str(sub->src.virt_addr, 16, buf, 33);
+ hex2str(sub->addr.label, 16, buf, 33);
len = 32;
}
@@ -2122,10 +2122,10 @@ bool mesh_config_model_sub_del(struct mesh_config *cfg, uint16_t ele_addr,
return true;
if (!sub->virt) {
- snprintf(buf, 5, "%4.4x", sub->src.addr);
+ snprintf(buf, 5, "%4.4x", sub->addr.grp);
len = 4;
} else {
- hex2str(sub->src.virt_addr, 16, buf, 33);
+ hex2str(sub->addr.label, 16, buf, 33);
len = 32;
}