From c621c15d5e719ff91d5fa37bc31955be220bd335 Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Thu, 31 Oct 2013 11:45:09 +0100 Subject: [PATCH] android/client: Add init/cleanup for GATT This patch adds gatt functions code. --- android/client/if-gatt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c index 1d3730d9f..d5e2d72a5 100644 --- a/android/client/if-gatt.c +++ b/android/client/if-gatt.c @@ -496,12 +496,20 @@ static const btgatt_callbacks_t gatt_cbacks = { static void init_p(int argc, const char **argv) { + RETURN_IF_NULL(if_gatt); + + EXEC(if_gatt->init, &gatt_cbacks); } /* cleanup */ static void cleanup_p(int argc, const char **argv) { + RETURN_IF_NULL(if_gatt); + + EXECV(if_gatt->cleanup); + + if_gatt = NULL; } static struct method methods[] = { -- 2.47.3