Diff between df257c1950dac5227b03b6254bbc682712fafb19 and 2ea7214869478e2704e5c0f4079276578d0ce523

Changed Files

File Additions Deletions Status
android/bluetooth.c +20 -2 modified

Full Patch

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 946e932..41225d6 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -2278,6 +2278,15 @@ static void load_link_keys(GSList *keys, bt_bluetooth_ready cb)
 	}
 }
 
+static void load_ltk_complete(uint8_t status, uint16_t length,
+					const void *param, void *user_data)
+{
+	if (status == MGMT_STATUS_SUCCESS)
+		return;
+
+	info("Failed to load LTKs: %s (0x%02x)", mgmt_errstr(status), status);
+}
+
 static void load_ltks(GSList *ltks)
 {
 	struct mgmt_cp_load_long_term_keys *cp;
@@ -2304,12 +2313,21 @@ static void load_ltks(GSList *ltks)
 		memcpy(ltk, ltks->data, sizeof(*ltk));
 
 	if (mgmt_send(mgmt_if, MGMT_OP_LOAD_LONG_TERM_KEYS, adapter.index,
-					cp_size, cp, NULL, NULL, NULL) == 0)
+			cp_size, cp, load_ltk_complete, NULL, NULL) == 0)
 		error("Failed to load LTKs");
 
 	g_free(cp);
 }
 
+static void load_irk_complete(uint8_t status, uint16_t length,
+					const void *param, void *user_data)
+{
+	if (status == MGMT_STATUS_SUCCESS)
+		return;
+
+	info("Failed to load IRKs: %s (0x%02x)", mgmt_errstr(status), status);
+}
+
 static void load_irks(GSList *irks)
 {
 	struct mgmt_cp_load_irks *cp;
@@ -2331,7 +2349,7 @@ static void load_irks(GSList *irks)
 		memcpy(irk, irks->data, sizeof(*irk));
 
 	if (mgmt_send(mgmt_if, MGMT_OP_LOAD_IRKS, adapter.index, cp_size, cp,
-							NULL, NULL, NULL) == 0)
+					load_irk_complete, NULL, NULL) == 0)
 		error("Failed to load IRKs");
 
 	g_free(cp);