From d23283c43e93d8d470354a50ea6d816549d65136 Mon Sep 17 00:00:00 2001 From: Oliver Ruiz Dorantes Date: Tue, 25 Nov 2008 22:38:55 +0000 Subject: [PATCH] Increase the priority of the thread handling the HCI events, + a bit formatting git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28728 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/bluetooth/BluetoothServer.cpp | 3 +- src/servers/bluetooth/LocalDeviceImpl.cpp | 36 +++++++++++------------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/servers/bluetooth/BluetoothServer.cpp b/src/servers/bluetooth/BluetoothServer.cpp index b9c9d5d5c5..2c54c98668 100644 --- a/src/servers/bluetooth/BluetoothServer.cpp +++ b/src/servers/bluetooth/BluetoothServer.cpp @@ -46,7 +46,8 @@ BluetoothServer::BluetoothServer() : BApplication(BLUETOOTH_SIGNATURE) fDeviceManager = new DeviceManager(); fLocalDevicesList.MakeEmpty(); - fEventListener = spawn_thread(notification_Thread, "BT port listener" , B_DISPLAY_PRIORITY , this); + // TODO: Some events should be handled faster than in KL... + fEventListener = spawn_thread(notification_Thread, "BT port listener" , B_URGENT_DISPLAY_PRIORITY , this); } diff --git a/src/servers/bluetooth/LocalDeviceImpl.cpp b/src/servers/bluetooth/LocalDeviceImpl.cpp index 8142a3c9bf..f3409bc56f 100644 --- a/src/servers/bluetooth/LocalDeviceImpl.cpp +++ b/src/servers/bluetooth/LocalDeviceImpl.cpp @@ -76,24 +76,21 @@ printf("### \n"); // Events here might have not been initated by us // TODO: ML mark as handled pass a reply by parameter and reply in common switch (event->ecode) { - case HCI_EVENT_HARDWARE_ERROR: - //HardwareError(event); - return; - case HCI_EVENT_CONN_REQUEST: - ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL); // incoming request - return; - break; + case HCI_EVENT_HARDWARE_ERROR: + //HardwareError(event); + return; + case HCI_EVENT_CONN_REQUEST: + ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL); + return; - case HCI_EVENT_CONN_COMPLETE: - ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL); // should belong to a request? - return; // can be sporadic or initiated by us¿?... - break; - - case HCI_EVENT_PIN_CODE_REQ: - PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL); - return; - break; + case HCI_EVENT_CONN_COMPLETE: + // should belong to a request? can be sporadic or initiated by us¿?... + ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL); + return; + case HCI_EVENT_PIN_CODE_REQ: + PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL); + return; default: // lets go on @@ -136,10 +133,11 @@ printf("### \n"); InquiryResult((uint8*)(event+1), request); break; - case HCI_EVENT_DISCONNECTION_COMPLETE: + case HCI_EVENT_DISCONNECTION_COMPLETE: + // should belong to a request? can be sporadic or initiated by us¿?... DisconnectionComplete((struct hci_ev_disconnection_complete_reply*)(event+1), request); break; - + case HCI_EVENT_AUTH_COMPLETE: break; @@ -484,7 +482,7 @@ LocalDeviceImpl::InquiryComplete(uint8* status, BMessage* request) printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply)); -// (request->ReturnAddress()).SendMessage(&reply); +// (request->ReturnAddress()).SendMessage(&reply); ClearWantedEvent(request); }