diff --git a/src/device.c b/src/device.c
index 3b59d7f..f2df9de 100644
--- a/src/device.c
+++ b/src/device.c
req = g_new0(struct browse_req, 1);
req->device = btd_device_ref(device);
-
adapter_get_address(adapter, &src);
+ device->browse = req;
+
+ if (device->attrib) {
+ gatt_discover_primary(device->attrib, NULL, primary_cb, req);
+ goto done;
+ }
+
sec_level = secure ? BT_IO_SEC_HIGH : BT_IO_SEC_LOW;
attcb = g_new0(struct att_callbacks, 1);
return -EIO;
}
+done:
if (conn)
req->conn = dbus_connection_ref(conn);
- device->browse = req;
-
if (msg) {
const char *sender = dbus_message_get_sender(msg);