pid=0 and vid=0 means all. This way we can easily disconnect all controllers or initiate a rescan
This commit is contained in:
parent
e69f7abba8
commit
c35be687c0
1 changed files with 14 additions and 0 deletions
|
@ -33,6 +33,20 @@ ControllerManager::~ControllerManager() {
|
|||
}
|
||||
|
||||
void ControllerManager::deviceInsertedOrRemoved(int vid, int pid, const std::string &serial, bool inserted) {
|
||||
if (vid == 0x0 && pid == 0x0) { //All
|
||||
if (inserted) {
|
||||
loadControllers();
|
||||
} else {
|
||||
//Disconnect all
|
||||
TelldusCore::MutexLocker locker(&d->mutex);
|
||||
while(d->controllers.size()) {
|
||||
ControllerMap::iterator it = d->controllers.begin();
|
||||
delete it->second;
|
||||
d->controllers.erase(it);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (vid != 0x1781) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue