void CPeripheralBus::Register(const PeripheralPtr& peripheral) { if (!peripheral) return; bool bPeripheralAdded = false; { CSingleLock lock(m_critSection); if (!HasPeripheral(peripheral->Location())) { m_peripherals.push_back(peripheral); bPeripheralAdded = true; } } if (bPeripheralAdded) { CLog::Log(LOGNOTICE, "%s - new %s device registered on %s->%s: %s (%s:%s)", __FUNCTION__, PeripheralTypeTranslator::TypeToString(peripheral->Type()), PeripheralTypeTranslator::BusTypeToString(m_type), peripheral->Location().c_str(), peripheral->DeviceName().c_str(), peripheral->VendorIdAsString(), peripheral->ProductIdAsString()); m_manager.OnDeviceAdded(*this, *peripheral); } }