OSDN Git Service

adapter: Insert DeviceID record if setting DeviceID data to controller
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 19 Sep 2013 14:00:41 +0000 (16:00 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 23 Sep 2013 07:42:57 +0000 (10:42 +0300)
DeviceID is special since its record is registered on start by
sdpd-server and always has handle 0x10000.

src/adapter.c

index 5434a07..7c44145 100644 (file)
@@ -5622,9 +5622,13 @@ static int adapter_register(struct btd_adapter *adapter)
 
        adapter->initialized = TRUE;
 
-       if (main_opts.did_source)
+       if (main_opts.did_source) {
+               /* DeviceID record is added by sdpd-server before any other
+                * record is registered. */
+               adapter_service_insert(adapter, sdp_record_find(0x10000));
                set_did(adapter, main_opts.did_vendor, main_opts.did_product,
                                main_opts.did_version, main_opts.did_source);
+       }
 
        DBG("Adapter %s registered", adapter->path);