[RFC 4/8] android/bluetooth: Move start discovery function up in the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jakub Tyszkowski <jakub.tyszkowski@xxxxxxxxx>

This is needed for next patch
---
 android/bluetooth.c | 62 ++++++++++++++++++++++++++---------------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 8f66dd1..a28fb01 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -999,6 +999,37 @@ static void clear_device_found(gpointer data, gpointer user_data)
 	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)
 {
@@ -2452,37 +2483,6 @@ static void get_adapter_properties(void)
 	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;
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux