- Implement retrieval of Device Classes.

- Implement DeviceClass for easy analisys of discovered devices's type.
- Make harder the intantiation of RemoteDevices.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28809 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-12-13 23:41:32 +00:00
parent a2f8edf787
commit 33fe7b32db
9 changed files with 423 additions and 41 deletions
+27 -2
View File
@@ -278,6 +278,31 @@ LocalDeviceImpl::CommandComplete(struct hci_ev_cmd_complete* event, BMessage* re
ClearWantedEvent(request);
}
break;
case PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_CLASS_OF_DEV):
{
struct hci_read_dev_class_reply* classDev = (struct hci_read_dev_class_reply*)(event+1);
if (classDev->status == BT_OK) {
reply.AddData("devclass", B_ANY_TYPE, &classDev->dev_class, sizeof(classDev->dev_class));
reply.AddInt8("status", classDev->status);
printf("Sending reply ... %ld\n",request->SendReply(&reply));
reply.PrintToStream();
Output::Instance()->Post("Positive reply for getDeviceClass\n", BLACKBOARD_KIT);
} else {
reply.AddInt8("status", classDev->status);
request->SendReply(&reply);
Output::Instance()->Post("Negative reply for getDeviceClass\n", BLACKBOARD_KIT);
}
// This request is not gonna be used anymore
ClearWantedEvent(request);
}
break;
case PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_LOCAL_NAME):
{
@@ -377,7 +402,6 @@ LocalDeviceImpl::CommandComplete(struct hci_ev_cmd_complete* event, BMessage* re
}
break;
default:
Output::Instance()->Post("Command Complete not handled\n", BLACKBOARD_KIT);
break;
@@ -560,8 +584,9 @@ LocalDeviceImpl::ConnectionComplete(struct hci_ev_conn_complete* event, BMessage
{
if (event->status == BT_OK) {
uint8 cod[3] = {0,0,0};
ConnectionIncoming* iConnection = new ConnectionIncoming(new RemoteDevice(event->bdaddr));
ConnectionIncoming* iConnection = new ConnectionIncoming(new RemoteDevice(event->bdaddr, cod));
iConnection->Show();
printf("%s: Address %s handle=%#x type=%d encrypt=%d\n", __FUNCTION__, bdaddrUtils::ToString(event->bdaddr), event->handle,
event->link_type, event->encrypt_mode);