summaryrefslogtreecommitdiff
path: root/android/client
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-11-21 12:40:51 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-11-21 14:35:47 +0100
commit9ca3bc13467db116526003bea7befc9f04fb2a75 (patch)
treeeddefd493ea7478e2214a9b46a6c8cc07a9debeb /android/client
parent28449c86c106e57c3b69b0024b2a53a8c24269c9 (diff)
downloadbluez-9ca3bc13467db116526003bea7befc9f04fb2a75.tar.gz
android/client: Add support for gattc scan_filter_enable
Diffstat (limited to 'android/client')
-rw-r--r--android/client/if-gatt.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index c06a1a5cb..2b874c393 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -1761,6 +1761,31 @@ static void scan_filter_clear_p(int argc, const char **argv)
EXEC(if_gatt->client->scan_filter_clear, client_if, filt_index);
}
+
+/* scan filter enable */
+static void scan_filter_enable_c(int argc, const char **argv,
+ enum_func *enum_func, void **user)
+{
+ if (argc == 2) {
+ *user = client_if_str;
+ *enum_func = enum_one_string;
+ }
+}
+
+static void scan_filter_enable_p(int argc, const char **argv)
+{
+ int client_if;
+ int enable = 0;
+
+ RETURN_IF_NULL(if_gatt);
+ VERIFY_CLIENT_IF(2, client_if);
+
+ /* enable */
+ if (argc >= 4)
+ enable = atoi(argv[3]);
+
+ EXEC(if_gatt->client->scan_filter_clear, client_if, enable);
+}
#endif
/* get_device_type */
@@ -1839,6 +1864,7 @@ static struct method client_methods[] = {
" [<p_uuid>] <p_uuid_mask> <addr> <addr_type>"
" <data_len> [<p_data>] <mask_len> [<p_mask>]"),
STD_METHODCH(scan_filter_clear, "<client_if> <filt_index>"),
+ STD_METHODCH(scan_filter_enable, "<client_if> [<enable>]"),
#else
STD_METHODCH(scan, "<client_if> [1|0]"),
STD_METHODCH(connect, "<client_if> <addr> [<is_direct>]"),