From a774d59ff04123b36bb8eb09232178f3c368bd2c Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Mon, 17 Mar 2008 22:41:47 +0000 Subject: [PATCH] Implement handling of the scan mode event reply git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24426 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/bluetooth/LocalDeviceImpl.cpp | 25 ++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/servers/bluetooth/LocalDeviceImpl.cpp b/src/servers/bluetooth/LocalDeviceImpl.cpp index faadc4e61f..7a01e34ad3 100644 --- a/src/servers/bluetooth/LocalDeviceImpl.cpp +++ b/src/servers/bluetooth/LocalDeviceImpl.cpp @@ -279,6 +279,29 @@ LocalDeviceImpl::CommandComplete(struct hci_ev_cmd_complete* event, BMessage* re ClearWantedEvent(request, PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_READ_LOCAL_NAME)); } + break; + + case PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_WRITE_SCAN_ENABLE): + { + uint8* statusReply = (uint8*)(event+1); + + reply.AddInt8("status", *statusReply); + + if (*statusReply == BT_OK) { + + Output::Instance()->Post("Positive reply for scanmode\n", BLACKBOARD_KIT); + + } else { + + Output::Instance()->Post("Negative reply for scanmode\n", BLACKBOARD_KIT); + + } + + printf("Sending reply ... %ld\n",request->SendReply(&reply)); + reply.PrintToStream(); + + ClearWantedEvent(request, PACK_OPCODE(OGF_CONTROL_BASEBAND, OCF_WRITE_SCAN_ENABLE)); + } break; default: @@ -369,7 +392,7 @@ LocalDeviceImpl::ProcessSimpleRequest(BMessage* request) ssize_t size; void* command = NULL; - if (request->FindData("raw command", B_ANY_TYPE, 0, (const void **)command, &size) == B_OK) + if (request->FindData("raw command", B_ANY_TYPE, 0, (const void **)&command, &size) == B_OK) if (((HCITransportAccessor*)fHCIDelegate)->IssueCommand(command, size) == B_ERROR) (Output::Instance()->Post("Command issue error\n", BLACKBOARD_EVENTS)); else