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
This commit is contained in:
@@ -46,7 +46,8 @@ BluetoothServer::BluetoothServer() : BApplication(BLUETOOTH_SIGNATURE)
|
|||||||
fDeviceManager = new DeviceManager();
|
fDeviceManager = new DeviceManager();
|
||||||
fLocalDevicesList.MakeEmpty();
|
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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,24 +76,21 @@ printf("### \n");
|
|||||||
// Events here might have not been initated by us
|
// Events here might have not been initated by us
|
||||||
// TODO: ML mark as handled pass a reply by parameter and reply in common
|
// TODO: ML mark as handled pass a reply by parameter and reply in common
|
||||||
switch (event->ecode) {
|
switch (event->ecode) {
|
||||||
case HCI_EVENT_HARDWARE_ERROR:
|
case HCI_EVENT_HARDWARE_ERROR:
|
||||||
//HardwareError(event);
|
//HardwareError(event);
|
||||||
return;
|
return;
|
||||||
case HCI_EVENT_CONN_REQUEST:
|
case HCI_EVENT_CONN_REQUEST:
|
||||||
ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL); // incoming request
|
ConnectionRequest((struct hci_ev_conn_request*)(event+1), NULL);
|
||||||
return;
|
return;
|
||||||
break;
|
|
||||||
|
|
||||||
case HCI_EVENT_CONN_COMPLETE:
|
case HCI_EVENT_CONN_COMPLETE:
|
||||||
ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL); // should belong to a request?
|
// should belong to a request? can be sporadic or initiated by us¿?...
|
||||||
return; // can be sporadic or initiated by us¿?...
|
ConnectionComplete((struct hci_ev_conn_complete*)(event+1), NULL);
|
||||||
break;
|
return;
|
||||||
|
|
||||||
case HCI_EVENT_PIN_CODE_REQ:
|
|
||||||
PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL);
|
|
||||||
return;
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
case HCI_EVENT_PIN_CODE_REQ:
|
||||||
|
PinCodeRequest((struct hci_ev_pin_code_req*)(event+1), NULL);
|
||||||
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// lets go on
|
// lets go on
|
||||||
@@ -136,10 +133,11 @@ printf("### \n");
|
|||||||
InquiryResult((uint8*)(event+1), request);
|
InquiryResult((uint8*)(event+1), request);
|
||||||
break;
|
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);
|
DisconnectionComplete((struct hci_ev_disconnection_complete_reply*)(event+1), request);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_AUTH_COMPLETE:
|
case HCI_EVENT_AUTH_COMPLETE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -484,7 +482,7 @@ LocalDeviceImpl::InquiryComplete(uint8* status, BMessage* request)
|
|||||||
|
|
||||||
|
|
||||||
printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply));
|
printf("%s: Sending reply ... %ld\n",__FUNCTION__, request->SendReply(&reply));
|
||||||
// (request->ReturnAddress()).SendMessage(&reply);
|
// (request->ReturnAddress()).SendMessage(&reply);
|
||||||
|
|
||||||
ClearWantedEvent(request);
|
ClearWantedEvent(request);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user