- Unregister the device when appears any error Issuing any command. Now at least we realize in userland when a dongle has been unplugged with the first problem appears.
- Move code between parent & children classes of the Accessors - a bit Styling git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -70,6 +70,25 @@ LocalDeviceImpl::LocalDeviceImpl(HCIDelegate* hd) : LocalDeviceHandler(hd)
|
||||
|
||||
}
|
||||
|
||||
|
||||
LocalDeviceImpl::~LocalDeviceImpl()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
LocalDeviceImpl::Unregister()
|
||||
{
|
||||
BMessage* msg = new BMessage(BT_MSG_REMOVE_DEVICE);
|
||||
|
||||
msg->AddInt32("hci_id", fHCIDelegate->Id());
|
||||
|
||||
Output::Instance()->Postf(BLACKBOARD_DEVICEMANAGER, "Unregistering %x\n", fHCIDelegate->Id());
|
||||
|
||||
be_app_messenger.SendMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
#pragma mark - Event handling methods -
|
||||
#endif
|
||||
@@ -751,11 +770,13 @@ LocalDeviceImpl::ProcessSimpleRequest(BMessage* request)
|
||||
|
||||
AddWantedEvent(request);
|
||||
// LEAK: is command buffer freed within the Message?
|
||||
if (((HCITransportAccessor*)fHCIDelegate)->IssueCommand(command, size)
|
||||
if (((HCITransportAccessor*)fHCIDelegate)->IssueCommand(command, size)
|
||||
== B_ERROR) {
|
||||
// TODO: - Reply the request with error!
|
||||
// - Remove the just added request
|
||||
(Output::Instance()->Post("Command issue error\n", BLACKBOARD_KIT));
|
||||
(Output::Instance()->Post("## ERROR Command issue, REMOVING!\n", BLACKBOARD_KIT));
|
||||
ClearWantedEvent(request);
|
||||
|
||||
} else {
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user