[PATCH 2/4] android/bluetooth: Store IRK when storing adapter config

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

 



---
 android/bluetooth.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index e9c5be1..8865eac 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -263,6 +263,8 @@ static void store_adapter_config(void)
 	gsize length = 0;
 	char addr[18];
 	char *data;
+	char key_str[33];
+	int i;
 
 	key_file = g_key_file_new();
 
@@ -279,6 +281,11 @@ static void store_adapter_config(void)
 	g_key_file_set_integer(key_file, "General", "DiscoverableTimeout",
 						adapter.discoverable_timeout);
 
+	for (i = 0; i < 16; i++)
+		sprintf(key_str + (i * 2), "%2.2X", adapter.irk[i]);
+
+	g_key_file_set_string(key_file, "General", "IRK", key_str);
+
 	data = g_key_file_to_data(key_file, &length, NULL);
 
 	g_file_set_contents(SETTINGS_FILE, data, length, NULL);
-- 
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