summaryrefslogtreecommitdiffstats
path: root/binding/afm-nfc-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/afm-nfc-binding.c')
-rw-r--r--binding/afm-nfc-binding.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c
index d605632..ef87a7d 100644
--- a/binding/afm-nfc-binding.c
+++ b/binding/afm-nfc-binding.c
@@ -103,34 +103,28 @@ static void record_found(const char *tag_name, void *ptr)
gchar *str = g_variant_print(v, 0);
str[strlen(str) - 1] = '\0';
- AFB_API_DEBUG(afbBindingV3root,
- "%s tag, record %s= %s", tag_name, s, str);
+ AFB_API_WARNING(afbBindingV3root,
+ "%s tag, record %s= %s", tag_name, s, str);
json_object_object_add(jdict, s,
json_object_new_string(str + 1));
g_free(str);
}
+ json_object_object_add(jresp, "record", jdict);
+
neardal_free_record(record);
- /*
- * get record dictionary and look for 'Representation' field which should
- * contain the uid value the identity agent needs.
- *
- */
- if (json_object_object_get_ex(jdict, "Representation", &jtemp)) {
- const char *uid = json_object_get_string(jtemp);
+ AFB_API_WARNING(afbBindingV3root, "sending: %s",
+ json_object_to_json_string_ext(jresp, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY));
- pthread_mutex_lock(&mutex);
- data->jresp = jresp;
- json_object_object_add(jresp, "uid", json_object_new_string(uid));
- pthread_mutex_unlock(&mutex);
+ pthread_mutex_lock(&mutex);
+ data->jresp = jresp;
+ json_object_get(jresp);
+ pthread_mutex_unlock(&mutex);
- afb_event_push(presence_event, jresp);
- AFB_API_DEBUG(afbBindingV3root,
- "sent presence event, record content %s, tag %s",
- uid, tag_name);
- }
+ afb_event_push(presence_event, jresp);
+ AFB_API_WARNING(afbBindingV3root, "sent presence event");
return;
}