- Implement RemoteDevice::GetFriendlyName() in kit and handle the required reply in the server.

- Now a discovery process is nicer.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25053 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-04-19 16:53:06 +00:00
parent a8c6c1c0a6
commit 39399f65f0
4 changed files with 92 additions and 7 deletions
+31 -2
View File
@@ -128,6 +128,7 @@ printf("### \n");
break;
case HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE:
RemoteNameRequestComplete((struct hci_remote_name_request_complete_reply*)(event+1), request);
break;
case HCI_EVENT_ENCRYPT_CHANGE:
@@ -149,11 +150,11 @@ printf("### \n");
break;
case HCI_EVENT_CMD_COMPLETE:
CommandComplete((struct hci_ev_cmd_complete*)(event+1), request);
CommandComplete((struct hci_ev_cmd_complete*)(event+1), request);
break;
case HCI_EVENT_CMD_STATUS:
CommandStatus((struct hci_ev_cmd_status*)(event+1), request);
CommandStatus((struct hci_ev_cmd_status*)(event+1), request);
break;
case HCI_EVENT_FLUSH_OCCUR:
@@ -402,6 +403,34 @@ LocalDeviceImpl::InquiryComplete(uint8* status, BMessage* request)
}
void
LocalDeviceImpl::RemoteNameRequestComplete(struct hci_remote_name_request_complete_reply* remotename, BMessage* request)
{
BMessage reply;
reply.AddInt8("status", remotename->status);
if (remotename->status == BT_OK) {
reply.AddString("friendlyname", (const char*)remotename->remote_name );
Output::Instance()->Post("Positive reply for remote friendly name\n", BLACKBOARD_KIT);
} else {
Output::Instance()->Post("Negative reply for remote friendly name\n", BLACKBOARD_KIT);
}
printf("Sending reply ... %ld\n", request->SendReply(&reply));
reply.PrintToStream();
// This request is not genna be used anymore
// Although there are many middle events that should be tracked
ClearWantedEvent(request);
}
#if 0
#pragma mark - Request Methods -
#endif