- Fix parsing of the inquiry replies. There is a first byte indicating the number responses which was ignored.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24993 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes 2008-04-16 22:21:28 +00:00
parent 01e363a708
commit ae736793e8
3 changed files with 11 additions and 6 deletions

View File

@ -362,6 +362,7 @@ BluetoothServer::HandleSimpleRequest(BMessage* message, BMessage* reply)
// we are gonna need issue the command ... // we are gonna need issue the command ...
if (ldi->ProcessSimpleRequest(DetachCurrentMessage()) == B_OK) if (ldi->ProcessSimpleRequest(DetachCurrentMessage()) == B_OK)
// if (ldi->ProcessSimpleRequest(message) == B_OK)
return B_WOULD_BLOCK; return B_WOULD_BLOCK;
else else
return B_ERROR; return B_ERROR;

View File

@ -115,7 +115,7 @@ printf("### \n");
break; break;
case HCI_EVENT_INQUIRY_RESULT: case HCI_EVENT_INQUIRY_RESULT:
InquiryResult((struct inquiry_info*)(event+1), request); InquiryResult((uint8*)(event+1), request);
break; break;
case HCI_EVENT_CONN_COMPLETE: case HCI_EVENT_CONN_COMPLETE:
@ -357,7 +357,7 @@ LocalDeviceImpl::CommandStatus(struct hci_ev_cmd_status* event, BMessage* reques
Output::Instance()->Post("Negative reply for inquiry status\n", BLACKBOARD_KIT); Output::Instance()->Post("Negative reply for inquiry status\n", BLACKBOARD_KIT);
} }
printf("Sending reply ... %ld\n",request->SendReply(&reply)); printf("Sending reply ... %ld\n", request->SendReply(&reply));
reply.PrintToStream(); reply.PrintToStream();
ClearWantedEvent(request, HCI_EVENT_CMD_STATUS, PACK_OPCODE(OGF_LINK_CONTROL, OCF_INQUIRY)); ClearWantedEvent(request, HCI_EVENT_CMD_STATUS, PACK_OPCODE(OGF_LINK_CONTROL, OCF_INQUIRY));
@ -373,12 +373,14 @@ LocalDeviceImpl::CommandStatus(struct hci_ev_cmd_status* event, BMessage* reques
void void
LocalDeviceImpl::InquiryResult(struct inquiry_info* event, BMessage* request) LocalDeviceImpl::InquiryResult(uint8* numberOfResponses, BMessage* request)
{ {
BMessage reply(BT_MSG_INQUIRY_DEVICE); BMessage reply(BT_MSG_INQUIRY_DEVICE);
reply.AddData("info", B_ANY_TYPE, &event, sizeof(struct inquiry_info));
reply.AddData("info", B_ANY_TYPE, numberOfResponses+1 // skiping here the number of responses
, (*numberOfResponses) * sizeof(struct inquiry_info) );
printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply)); printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply));
@ -392,7 +394,9 @@ LocalDeviceImpl::InquiryComplete(uint8* status, BMessage* request)
reply.AddInt8("status", *status); reply.AddInt8("status", *status);
printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply)); printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply));
// (request->ReturnAddress()).SendMessage(&reply);
ClearWantedEvent(request); ClearWantedEvent(request);
} }

View File

@ -41,7 +41,7 @@ public:
void CommandStatus(struct hci_ev_cmd_status* event, BMessage* request); void CommandStatus(struct hci_ev_cmd_status* event, BMessage* request);
// Inquiry // Inquiry
void InquiryResult(struct inquiry_info* event, BMessage* request); void InquiryResult(uint8* numberOfResponses, BMessage* request);
void InquiryComplete(uint8* status, BMessage* request); void InquiryComplete(uint8* status, BMessage* request);
}; };