Handle the command status sent before the arrival of a remote name request.

Avoid unhandled event in the bluetooth_server
	by Mika Lindqvist
  


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26196 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-07-01 19:15:15 +00:00
parent ab563fc0a5
commit 18dbcd22a0
2 changed files with 11 additions and 3 deletions
+6 -3
View File
@@ -64,15 +64,18 @@ RemoteDevice::GetFriendlyName(bool alwaysAsk)
remoteNameCommand = buildRemoteNameRequest(fBdaddr, fPageRepetitionMode, fClockOffset, &size); // Fill correctily
request.AddData("raw command", B_ANY_TYPE, remoteNameCommand, size);
request.AddInt16("eventExpected", HCI_EVENT_CMD_STATUS);
request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_LINK_CONTROL, OCF_REMOTE_NAME_REQUEST));
request.AddInt16("eventExpected", HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE);
request.AddInt16("eventExpected", HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE);
//request.AddInt16("opcodeExpected", PACK_OPCODE(OGF_LINK_CONTROL, OCF_REMOTE_NAME_REQUEST));
if (btsm->SendMessage(&request, &reply) == B_OK)
{
BString name;
int8 status;
if (reply.FindInt8("status", &status) == B_OK &&
reply.FindString("friendlyname", &name) == B_OK ) {
return name;
@@ -368,6 +368,11 @@ LocalDeviceImpl::CommandStatus(struct hci_ev_cmd_status* event, BMessage* reques
}
break;
case PACK_OPCODE(OGF_LINK_CONTROL, OCF_REMOTE_NAME_REQUEST):
{
ClearWantedEvent(request, HCI_EVENT_CMD_STATUS, PACK_OPCODE(OGF_LINK_CONTROL, OCF_REMOTE_NAME_REQUEST));
}
break;
default:
Output::Instance()->Post("Command Status not handled\n", BLACKBOARD_KIT);
break;