From 84ae21bb319cba6887499066983da6f8afc43690 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 5 Nov 2014 14:41:51 +0200 Subject: [PATCH] android/client: Add support for new API for gatt scan() Fixes number of parameters in gatt scan() --- 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 d59302200..64429e4f4 100644 --- a/android/client/if-gatt.c +++ b/android/client/if-gatt.c @@ -933,6 +933,7 @@ static void scan_p(int argc, const char **argv) RETURN_IF_NULL(if_gatt); +#if ANDROID_VERSION < PLATFORM_VER(5, 0, 0) VERIFY_CLIENT_IF(2, client_if); /* start */ @@ -940,6 +941,13 @@ static void scan_p(int argc, const char **argv) start = atoi(argv[3]); EXEC(if_gatt->client->scan, client_if, start); +#else + /* start */ + if (argc >= 3) + start = atoi(argv[2]); + + EXEC(if_gatt->client->scan, start); +#endif } /* connect */ -- 2.47.3