diff --git a/android/bluetooth.c b/android/bluetooth.c
index 8f66dd1..3e2e547 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
dev->found = false;
}
+static uint8_t get_adapter_discovering_type(void)
+{
+ uint8_t type;
+
+ if (adapter.current_settings & MGMT_SETTING_BREDR)
+ type = SCAN_TYPE_BREDR;
+ else
+ type = 0;
+
+ if (adapter.current_settings & MGMT_SETTING_LE)
+ type |= SCAN_TYPE_LE;
+
+ return type;
+}
+
+static bool start_discovery(uint8_t type)
+{
+ struct mgmt_cp_start_discovery cp;
+
+ cp.type = get_adapter_discovering_type() & type;
+
+ DBG("type=0x%x", cp.type);
+
+ if (mgmt_send(mgmt_if, MGMT_OP_START_DISCOVERY, adapter.index,
+ sizeof(cp), &cp, NULL, NULL, NULL) > 0)
+ return true;
+
+ error("Failed to start discovery");
+
+ return false;
+}
+
static void mgmt_discovering_event(uint16_t index, uint16_t length,
const void *param, void *user_data)
{
get_adapter_discoverable_timeout();
}
-static uint8_t get_adapter_discovering_type(void)
-{
- uint8_t type;
-
- if (adapter.current_settings & MGMT_SETTING_BREDR)
- type = SCAN_TYPE_BREDR;
- else
- type = 0;
-
- if (adapter.current_settings & MGMT_SETTING_LE)
- type |= SCAN_TYPE_LE;
-
- return type;
-}
-
-static bool start_discovery(uint8_t type)
-{
- struct mgmt_cp_start_discovery cp;
-
- cp.type = get_adapter_discovering_type() & type;
-
- DBG("type=0x%x", cp.type);
-
- if (mgmt_send(mgmt_if, MGMT_OP_START_DISCOVERY, adapter.index,
- sizeof(cp), &cp, NULL, NULL, NULL) > 0)
- return true;
-
- error("Failed to start discovery");
- return false;
-}
-
static void cancel_pending_confirm_name(gpointer data, gpointer user_data)
{
struct device *dev = data;