- 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:
Oliver Ruiz Dorantes
2009-07-07 19:46:40 +00:00
parent ff1a0e63f8
commit ccf28e4dd1
9 changed files with 140 additions and 109 deletions
+23 -2
View File
@@ -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;
}