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:
@@ -64,15 +64,18 @@ RemoteDevice::GetFriendlyName(bool alwaysAsk)
|
|||||||
remoteNameCommand = buildRemoteNameRequest(fBdaddr, fPageRepetitionMode, fClockOffset, &size); // Fill correctily
|
remoteNameCommand = buildRemoteNameRequest(fBdaddr, fPageRepetitionMode, fClockOffset, &size); // Fill correctily
|
||||||
|
|
||||||
request.AddData("raw command", B_ANY_TYPE, remoteNameCommand, size);
|
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)
|
if (btsm->SendMessage(&request, &reply) == B_OK)
|
||||||
{
|
{
|
||||||
BString name;
|
BString name;
|
||||||
int8 status;
|
int8 status;
|
||||||
|
|
||||||
if (reply.FindInt8("status", &status) == B_OK &&
|
if (reply.FindInt8("status", &status) == B_OK &&
|
||||||
reply.FindString("friendlyname", &name) == B_OK ) {
|
reply.FindString("friendlyname", &name) == B_OK ) {
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -368,6 +368,11 @@ LocalDeviceImpl::CommandStatus(struct hci_ev_cmd_status* event, BMessage* reques
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
Output::Instance()->Post("Command Status not handled\n", BLACKBOARD_KIT);
|
Output::Instance()->Post("Command Status not handled\n", BLACKBOARD_KIT);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user