From 1f3aa4989021959b4d25611cb9829cdb026c2579 Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Tue, 1 Apr 2008 21:48:05 +0000 Subject: [PATCH] Complete asking the server all the events needed to perform a complete(basic) discovery process git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24731 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/bluetooth/DiscoveryAgent.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kits/bluetooth/DiscoveryAgent.cpp b/src/kits/bluetooth/DiscoveryAgent.cpp index 82c70ad599..deb1e17d26 100644 --- a/src/kits/bluetooth/DiscoveryAgent.cpp +++ b/src/kits/bluetooth/DiscoveryAgent.cpp @@ -55,7 +55,6 @@ DiscoveryAgent::StartInquiry(uint32 accessCode, DiscoveryListener* listener, big return B_TIMED_OUT; void* startInquiryCommand = NULL; - int8 bt_status = BT_ERROR; // keep the listener whats the current listener for our inquiry state fLastUsedListener = listener; @@ -71,10 +70,19 @@ DiscoveryAgent::StartInquiry(uint32 accessCode, DiscoveryListener* listener, big request.AddInt32("hci_id", fLocalDevice->GetID()); startInquiryCommand = buildInquiry(accessCode, secs, BT_MAX_RESPONSES, &size); + + // For stating the inquiry request.AddData("raw command", B_ANY_TYPE, startInquiryCommand, size); request.AddInt16("eventExpected", HCI_EVENT_CMD_STATUS); request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_LINK_CONTROL, OCF_INQUIRY)); + // For getting each discovered message + request.AddInt16("eventExpected", HCI_EVENT_INQUIRY_RESULT); + + // For finishing each discovered message + request.AddInt16("eventExpected", HCI_EVENT_INQUIRY_COMPLETE); + + if (btsm->SendMessage(&request, listener) == B_OK) { return B_OK;