From 6ab89f4f40b910dc35bc8142f4c542899f9d88a2 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 19 Jul 2018 11:05:23 -0700 Subject: binding: nfc: remove current_uid from globals declarations current_uid is no longer needed now that the json_object response is cached Bug-AGL: SPEC-1554 Change-Id: If6019ff52dcb61f18616c927a489e0fb0ed90c35 Signed-off-by: Matt Ranostay --- binding/afm-nfc-binding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding/afm-nfc-binding.c b/binding/afm-nfc-binding.c index 85719b5..b3f7fe2 100644 --- a/binding/afm-nfc-binding.c +++ b/binding/afm-nfc-binding.c @@ -40,7 +40,6 @@ #define WAIT_FOR_REMOVE(dev) { while (0 == nfc_initiator_target_is_present(dev, NULL)) {} } static afb_event_t presence_event; -static char *current_uid = NULL; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static const nfc_modulation modulations[] = { @@ -65,7 +64,7 @@ static void send_detect_event(char *current_id, nfc_binding_data *data) jresp = json_object_new_object(); json_object_object_add(jresp, "status", json_object_new_string("detected")); - json_object_object_add(jresp, "uid", json_object_new_string(current_uid)); + json_object_object_add(jresp, "uid", json_object_new_string(current_id)); if (data->jresp) { json_object_put(data->jresp); @@ -86,6 +85,7 @@ static void *nfc_loop_thread(void *ptr) nfc_target nt; json_object *jresp; int res = nfc_initiator_poll_target(data->dev, modulations, ARRAY_SIZE(modulations), 0xff, 2, &nt); + char *current_uid; if (res < 0) break; -- cgit 1.2.3-korg