diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-05-09 19:06:11 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-05-12 19:21:39 -0700 |
commit | f20d1e390f25dd9f566c69968286b2ff4406ca87 (patch) | |
tree | 172fabe412cea2f7b7edbd531b5183ef238ab8f5 /binding/bluetooth-map-api.c | |
parent | 063ca7cb02117d8788af450e3d382705440fe8f0 (diff) |
binding: bluetooth-map: add parser for bMessage output
Parser to output more user-readable JSON of incoming messages
Bug-AGL: SPEC-2351 SPEC-2392
Change-Id: Ib758f8901ff01579899112c75119596c4a0726be
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/bluetooth-map-api.c')
-rw-r--r-- | binding/bluetooth-map-api.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/binding/bluetooth-map-api.c b/binding/bluetooth-map-api.c index c897838..df90ae5 100644 --- a/binding/bluetooth-map-api.c +++ b/binding/bluetooth-map-api.c @@ -402,10 +402,9 @@ static void map_notification_event(struct map_state *ns, gchar *filename) if (!g_file_get_contents(filename, &buf, NULL, NULL)) return; - jresp = json_object_new_object(); - json_object_object_add(jresp, "bmessage", json_object_new_string(buf)); - - afb_event_push(ns->notification_event, jresp); + jresp = bmessage_parse(buf); + if (jresp) + afb_event_push(ns->notification_event, jresp); g_free(buf); } |