Diff between 2f83ab18a4e197e0a7ddb70bfb3c79862c66acf7 and b27875e9ec05a6a7f2036f50c55f8393d213edf6

Changed Files

File Additions Deletions Status
src/main.c +10 -0 modified

Full Patch

diff --git a/src/main.c b/src/main.c
index a42a4af..3843d3b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -267,6 +267,8 @@ static void parse_config(GKeyFile *config)
 
 static void init_defaults(void)
 {
+	uint8_t major, minor;
+
 	/* Default HCId settings */
 	memset(&main_opts, 0, sizeof(main_opts));
 	main_opts.name = g_strdup("BlueZ");
@@ -277,6 +279,14 @@ static void init_defaults(void)
 	main_opts.reverse_sdp = TRUE;
 	main_opts.name_resolv = TRUE;
 	main_opts.debug_keys = FALSE;
+
+	if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
+		return;
+
+        main_opts.did_source = 0x0002;		/* USB */
+        main_opts.did_vendor = 0x1d6b;		/* Linux Foundation */
+        main_opts.did_product = 0x0246;		/* BlueZ */
+        main_opts.did_version = (major << 8 | minor);
 }
 
 static GMainLoop *event_loop;