In some cases the remote name request is never returning us the event containing the name. It fails, the reason could be that the command has some differences in the fields depending on the BT version. This is handling the error code properly in this fail case avoiding the wait.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26637 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -426,7 +426,16 @@ LocalDeviceImpl::CommandStatus(struct hci_ev_cmd_status* event, BMessage* reques
|
||||
|
||||
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));
|
||||
if (event->status==BT_OK) {
|
||||
ClearWantedEvent(request, HCI_EVENT_CMD_STATUS, PACK_OPCODE(OGF_LINK_CONTROL, OCF_REMOTE_NAME_REQUEST));
|
||||
}
|
||||
else {
|
||||
BMessage reply;
|
||||
reply.AddInt8("status", event->status);
|
||||
Output::Instance()->Post("Negative reply for remote friendly name\n", BLACKBOARD_KIT);
|
||||
printf("Sending reply ... %ld\n", request->SendReply(&reply));
|
||||
ClearWantedEvent(request);
|
||||
}
|
||||
}
|
||||
break;
|
||||
/*
|
||||
@@ -504,7 +513,6 @@ LocalDeviceImpl::RemoteNameRequestComplete(struct hci_ev_remote_name_request_com
|
||||
|
||||
// This request is not gonna be used anymore
|
||||
ClearWantedEvent(request);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user