- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user