summaryrefslogtreecommitdiff
path: root/android/client
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-11-28 09:22:02 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-12-03 09:18:00 +0100
commit23b554cf1bde17d753c44711c67f3ffd79fea671 (patch)
treeb8ec01a99185b5d7cf42f1581eb23307b17e44c8 /android/client
parent7ce786b66980d4eefc782b5b082e54e61d2d8491 (diff)
downloadbluez-23b554cf1bde17d753c44711c67f3ffd79fea671.tar.gz
android/client: Add support for gattc batchscan_enb_batch_scan
Diffstat (limited to 'android/client')
-rw-r--r--android/client/if-gatt.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index d43a5e89c..cf55e9632 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -2057,6 +2057,35 @@ static void batchscan_cfg_storage_p(int argc, const char **argv)
batch_scan_full_max, batch_scan_trunc_max,
batch_scan_notify_threshold);
}
+
+/* enable batch scan */
+static void batchscan_enb_batch_scan_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 batchscan_enb_batch_scan_p(int argc, const char **argv)
+{
+ int client_if;
+ int scan_mode, scan_interval, scan_window;
+ int addr_type;
+ int discard_rule;
+
+ RETURN_IF_NULL(if_gatt);
+ VERIFY_CLIENT_IF(2, client_if);
+ VERIFY_SCAN_MODE(3, scan_mode);
+ VERIFY_SCAN_INTERVAL(4, scan_interval);
+ VERIFY_SCAN_WINDOW(5, scan_window);
+ VERIFY_ADDR_TYPE(6, addr_type);
+ VERIFY_DISCARD_RULE(7, discard_rule);
+
+ EXEC(if_gatt->client->batchscan_enb_batch_scan, client_if, scan_mode,
+ scan_interval, scan_window, addr_type, discard_rule);
+}
#endif
/* get_device_type */
@@ -2158,6 +2187,9 @@ static struct method client_methods[] = {
STD_METHODCH(batchscan_cfg_storage, "<client_if> <batch_scan_full_max>"
" <batch_scan_trunc_max>"
" <batch_scan_notify_threshold>"),
+ STD_METHODCH(batchscan_enb_batch_scan, "<client_if> <scan_mode>"
+ " <scan_interval> <scan_window> <addr_type>"
+ " <discard_rule>"),
#else
STD_METHODCH(scan, "<client_if> [1|0]"),
STD_METHODCH(connect, "<client_if> <addr> [<is_direct>]"),