summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-05 14:56:47 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-05 14:59:13 -0800
commitb3f7623fbab34ea73ab9a9c067572a5764fa07bd (patch)
tree98dccf6ad1b8680ad46c03578551705886080998 /src/main.c
parent348feb005a12b0c0db20e5276f5142fb8ff3bd3d (diff)
downloadbluez-b3f7623fbab34ea73ab9a9c067572a5764fa07bd.tar.gz
main.conf: Enable passing false to DeviceID
This adds support for setting DeviceID to false so plaforms can disable DeviceID. Fixes: https://github.com/bluez/bluez/issues/101
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b66e2b8cb..572dc939c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -188,10 +188,16 @@ static void parse_did(const char *did)
int result;
uint16_t vendor, product, version , source;
- /* version and source are optional */
+ vendor = 0x0000;
+ product = 0x0000;
version = 0x0000;
source = 0x0002;
+ if (!strcasecmp(did, "false")) {
+ source = 0x0000;
+ goto done;
+ }
+
result = sscanf(did, "bluetooth:%4hx:%4hx:%4hx",
&vendor, &product, &version);
if (result != EOF && result >= 2) {