diff --git a/android/adapter.c b/android/adapter.c
index a6c5704..eebe45e 100644
--- a/android/adapter.c
+++ b/android/adapter.c
g_free(cp);
}
+static void set_mode_complete(uint8_t status, uint16_t length,
+ const void *param, void *user_data)
+{
+ if (status != MGMT_STATUS_SUCCESS) {
+ error("Failed to set mode: %s (0x%02x)",
+ mgmt_errstr(status), status);
+ return;
+ }
+
+ /*
+ * The parameters are identical and also the task that is
+ * required in both cases. So it is safe to just call the
+ * event handling functions here.
+ */
+ new_settings_callback(adapter->index, length, param, NULL);
+}
+
+static bool set_mode(uint16_t opcode, uint8_t mode)
+{
+ struct mgmt_mode cp;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.val = mode;
+
+ DBG("opcode=0x%x mode=0x%x", opcode, mode);
+
+ if (mgmt_send(adapter->mgmt, opcode, adapter->index, sizeof(cp), &cp,
+ set_mode_complete, NULL, NULL) > 0)
+ return true;
+
+ error("Failed to set mode");
+
+ return false;
+}
+
static void read_info_complete(uint8_t status, uint16_t length, const void *param,
void *user_data)
{
load_link_keys(NULL);
+ set_mode(MGMT_OP_SET_PAIRABLE, 0x01);
+
return;
failed:
adapter->ready(-EIO);
}
-static void set_mode_complete(uint8_t status, uint16_t length,
- const void *param, void *user_data)
-{
- if (status != MGMT_STATUS_SUCCESS) {
- error("Failed to set mode: %s (0x%02x)",
- mgmt_errstr(status), status);
- return;
- }
-
- /*
- * The parameters are identical and also the task that is
- * required in both cases. So it is safe to just call the
- * event handling functions here.
- */
- new_settings_callback(adapter->index, length, param, NULL);
-}
-
-static bool set_mode(uint16_t opcode, uint8_t mode)
-{
- struct mgmt_mode cp;
-
- memset(&cp, 0, sizeof(cp));
- cp.val = mode;
-
- DBG("opcode=0x%x mode=0x%x", opcode, mode);
-
- if (mgmt_send(adapter->mgmt, opcode, adapter->index, sizeof(cp), &cp,
- set_mode_complete, NULL, NULL) > 0)
- return true;
-
- error("Failed to set mode");
-
- return false;
-}
-
static bool set_discoverable(uint8_t mode, uint16_t timeout)
{
struct mgmt_cp_set_discoverable cp;