18 #include <peak/generic/peak_t_callback_manager.hpp> 25 #include <type_traits> 26 #include <unordered_map> 27 #include <unordered_set> 88 using SystemFoundCallback = std::function<void(const std::shared_ptr<const core::System>& foundSystem)>;
100 using DeviceFoundCallback = std::function<void(const std::shared_ptr<core::DeviceDescriptor>& foundDevice)>;
232 std::vector<std::shared_ptr<const core::System>>
Systems()
const;
242 std::vector<std::shared_ptr<const core::Interface>>
Interfaces()
const;
252 std::vector<std::shared_ptr<core::DeviceDescriptor>>
Devices()
const;
409 void GetLostDevicesFromLostInterfaces(
410 const std::unordered_set<std::string>& lostInterfaces, std::vector<std::string>& lostDevices);
412 void TriggerSystemFoundCallbacks(
const std::shared_ptr<const core::System>& foundSystem)
const;
413 void TriggerInterfaceFoundCallbacks(
const std::shared_ptr<const core::Interface>& foundInterface)
const;
414 void TriggerInterfaceLostCallbacks(
const std::string& lostInterfaceKey)
const;
415 void TriggerDeviceFoundCallbacks(
const std::shared_ptr<core::DeviceDescriptor>& foundDevice)
const;
416 void TriggerDeviceLostCallbacks(
const std::string& lostDeviceKey)
const;
418 void CheckDevicesOpened()
const;
420 std::mutex m_updateMutex;
421 std::atomic<core::Timeout> m_interfaceUpdateTimeout_ms{ 100 };
422 std::atomic<core::Timeout> m_deviceUpdateTimeout_ms{ 300 };
424 std::vector<std::string> m_producerLibrariesToAdd;
426 std::unordered_map<std::string, std::shared_ptr<core::ProducerLibrary>> m_producerLibraries;
427 std::vector<std::shared_ptr<const core::System>> m_systems;
428 std::vector<std::shared_ptr<const core::Interface>> m_interfaces;
429 std::vector<std::shared_ptr<core::DeviceDescriptor>> m_devices;
433 std::weak_ptr<core::Device> device;
434 std::string displayName;
436 std::vector<OpenedDevice> m_openedDevices;
438 core::TTriggerCallbackManager<SystemFoundCallbackHandle, SystemFoundCallback> m_systemFoundCallbackManager;
439 core::TTriggerCallbackManager<InterfaceFoundCallbackHandle, InterfaceFoundCallback> m_interfaceFoundCallbackManager;
440 core::TTriggerCallbackManager<InterfaceLostCallbackHandle, InterfaceLostCallback> m_interfaceLostCallbackManager;
441 core::TTriggerCallbackManager<DeviceFoundCallbackHandle, DeviceFoundCallback> m_deviceFoundCallbackManager;
442 core::TTriggerCallbackManager<DeviceLostCallbackHandle, DeviceLostCallback> m_deviceLostCallbackManager;
444 std::mutex m_producerLibrariesToAddMutex;
445 mutable std::mutex m_systemsMutex;
446 mutable std::recursive_mutex m_interfacesMutex;
447 mutable std::recursive_mutex m_devicesMutex;
448 mutable std::mutex m_openedDevicesMutex;
451 template <
typename T,
452 typename std::enable_if<(noexcept(std::declval<T>()())
453 || (std::is_pointer<
typename std::decay<T>::type>::value && __cplusplus < 201703L)
456 && std::is_same<
void, decltype(std::declval<T>()())>::value && std::is_move_constructible<T>::value
457 && std::is_nothrow_move_constructible<T>::value,
460 template <
typename T>
467 RAIIGuard(T&& fun) noexcept
468 : m_fun(std::forward<T>(fun))
470 RAIIGuard(RAIIGuard
const&) =
delete;
471 RAIIGuard(RAIIGuard&& other) noexcept
472 : m_fun(std::move(other.m_fun))
474 ~RAIIGuard() noexcept
479 template <
typename T>
480 static RAIIGuard<T> makeRAIIGuard(T&& fun) noexcept
482 return { std::forward<T>(fun) };
485 template<
typename T = DeviceManager>
486 class LifetimeTracker
489 static void Create();
490 static void Destroy();
494 static T* m_instance;
495 static std::mutex m_mtx;
496 static size_t m_initializedCount;
507 T* DeviceManager::LifetimeTracker<T>::m_instance = {};
510 std::mutex DeviceManager::LifetimeTracker<T>::m_mtx = {};
513 size_t DeviceManager::LifetimeTracker<T>::m_initializedCount = {};
516 void DeviceManager::LifetimeTracker<T>::Create()
518 std::lock_guard<decltype(m_mtx)> lock{m_mtx};
522 m_instance =
new T{};
525 m_initializedCount++;
529 void DeviceManager::LifetimeTracker<T>::Destroy()
531 std::lock_guard<decltype(m_mtx)> lock{m_mtx};
533 if (0 == m_initializedCount)
538 m_initializedCount--;
540 if (0 == m_initializedCount)
545 m_instance =
nullptr;
551 T& DeviceManager::LifetimeTracker<T>::Instance()
553 if (m_instance ==
nullptr)
562 return DeviceManager::LifetimeTracker<>::Instance();
565 inline DeviceManager::~DeviceManager()
572 std::lock_guard<std::mutex> lock(m_producerLibrariesToAddMutex);
574 m_producerLibrariesToAdd.emplace_back(ctiPath);
580 std::lock_guard<std::mutex> lockUpdate(m_updateMutex);
582 std::vector<std::shared_ptr<core::System>> allFoundSystems;
583 std::vector<std::shared_ptr<core::Interface>> allFoundInterfaces;
584 std::vector<std::string> allLostInterfaces;
585 std::vector<std::shared_ptr<core::DeviceDescriptor>> allFoundDevices;
586 std::vector<std::string> allLostDevices;
588 auto interfaceUpdateTimeout_ms = m_interfaceUpdateTimeout_ms.load();
589 auto deviceUpdateTimeout_ms = m_deviceUpdateTimeout_ms.load();
591 std::vector<std::string> ctiPaths;
599 std::lock_guard<std::mutex> lock(m_producerLibrariesToAddMutex);
601 ctiPaths.reserve(ctiPaths.size() + m_producerLibrariesToAdd.size());
603 std::begin(m_producerLibrariesToAdd), std::end(m_producerLibrariesToAdd), std::back_inserter(ctiPaths));
605 m_producerLibrariesToAdd.clear();
607 for (
const auto& ctiPath : ctiPaths)
609 if (!m_producerLibraries.count(ctiPath))
614 auto system = producerLibrary->System()->OpenSystem();
616 m_producerLibraries.emplace(ctiPath, producerLibrary);
617 allFoundSystems.emplace_back(system);
635 errorCallback(
"[CTI - " + ctiPath +
"]: " + ex.what());
644 auto interfaceUpdateFunc = [&interfaceUpdateTimeout_ms, &errorCallback](
const std::shared_ptr<core::System>& system)
645 -> std::tuple<std::vector<std::shared_ptr<core::Interface>>, std::vector<std::string>> {
646 std::vector<std::shared_ptr<core::Interface>> foundInterfaces;
647 std::vector<std::string> lostInterfaces;
651 auto foundCallbackHandle = system->RegisterInterfaceFoundCallback(
652 [&foundInterfaces](
const std::shared_ptr<core::InterfaceDescriptor>& foundInterface) {
653 foundInterfaces.emplace_back(foundInterface->OpenInterface());
655 auto const foundCallbackCleanupGuard = makeRAIIGuard([system, &foundCallbackHandle]() noexcept {
658 system->UnregisterInterfaceFoundCallback(foundCallbackHandle);
666 auto keysById = std::unordered_map<std::string, std::string>();
667 for (
const auto& iface : system->Interfaces())
669 keysById.emplace(iface->ID(), iface->Key());
671 auto lostCallbackHandle = system->RegisterInterfaceLostCallback(
672 [&lostInterfaces, &keysById](
const std::string& lostInterfaceId) {
673 auto idKeyPairIt = keysById.find(lostInterfaceId);
675 if (idKeyPairIt != keysById.end())
677 lostInterfaces.emplace_back((*idKeyPairIt).second);
680 auto const lostCallbackCleanupGuard = makeRAIIGuard([system, &lostCallbackHandle]() noexcept {
683 system->UnregisterInterfaceLostCallback(lostCallbackHandle);
691 system->UpdateInterfaces(interfaceUpdateTimeout_ms);
699 errorCallback(
"[System - " + system->Key() +
"]: " + ex.what());
706 return std::make_tuple(foundInterfaces, lostInterfaces);
710 const std::launch launchPolicy =
712 std::vector<std::future<std::tuple<std::vector<std::shared_ptr<core::Interface>>, std::vector<std::string>>>>
713 interfaceUpdateFutures;
714 for (
const auto& system : m_systems)
716 interfaceUpdateFutures.emplace_back(
717 std::async(launchPolicy, interfaceUpdateFunc, std::const_pointer_cast<core::System>(system)));
719 for (
const auto& system : allFoundSystems)
721 interfaceUpdateFutures.emplace_back(std::async(launchPolicy, interfaceUpdateFunc, system));
723 for (
auto& future : interfaceUpdateFutures)
725 auto foundLostInterfacesTuple = future.get();
726 auto foundInterfaces = std::get<0>(foundLostInterfacesTuple);
727 auto lostInterfaces = std::get<1>(foundLostInterfacesTuple);
728 allFoundInterfaces.reserve(allFoundInterfaces.size() + foundInterfaces.size());
729 std::move(std::begin(foundInterfaces), std::end(foundInterfaces), std::back_inserter(allFoundInterfaces));
730 allLostInterfaces.reserve(allLostInterfaces.size() + lostInterfaces.size());
731 std::move(std::begin(lostInterfaces), std::end(lostInterfaces), std::back_inserter(allLostInterfaces));
734 auto deviceUpdateFunc = [
this, &deviceUpdateTimeout_ms, &errorCallback](
735 const std::shared_ptr<core::Interface>& iface)
736 -> std::tuple<std::vector<std::shared_ptr<core::DeviceDescriptor>>, std::vector<std::string>> {
737 std::vector<std::shared_ptr<core::DeviceDescriptor>> foundDevices;
738 std::vector<std::string> lostDevices;
742 auto foundCallbackHandle = iface->RegisterDeviceFoundCallback(
743 [
this, &foundDevices](
const std::shared_ptr<core::DeviceDescriptor>& foundDevice) {
744 foundDevice->RegisterDeviceOpenedCallback(
745 [
this](
const std::shared_ptr<core::Device>& openedDevice) {
746 std::lock_guard<std::mutex> lock(m_openedDevicesMutex);
749 m_openedDevices.erase(std::remove_if(std::begin(m_openedDevices), std::end(m_openedDevices),
750 [](
const OpenedDevice& dev) {
return dev.device.expired(); }),
751 std::end(m_openedDevices));
755 device.device = openedDevice;
756 device.displayName = openedDevice->DisplayName();
757 m_openedDevices.push_back(device);
760 foundDevices.emplace_back(foundDevice);
762 auto const foundCallbackCleanupGuard = makeRAIIGuard([iface, &foundCallbackHandle]() noexcept {
765 iface->UnregisterDeviceFoundCallback(foundCallbackHandle);
773 auto keysById = std::unordered_map<std::string, std::string>();
774 for (
const auto& device : iface->Devices())
776 keysById.emplace(device->ID(), device->Key());
778 auto lostCallbackHandle = iface->RegisterDeviceLostCallback(
779 [&lostDevices, &keysById](
const std::string& lostDeviceId) {
780 auto idKeyPairIt = keysById.find(lostDeviceId);
782 if (idKeyPairIt != keysById.end())
784 lostDevices.emplace_back((*idKeyPairIt).second);
787 auto const lostCallbackCleanupGuard = makeRAIIGuard([iface, &lostCallbackHandle]() noexcept {
790 iface->UnregisterDeviceLostCallback(lostCallbackHandle);
798 iface->UpdateDevices(deviceUpdateTimeout_ms);
806 errorCallback(
"[Interface - " + iface->Key() +
"]: " + ex.what());
813 return std::make_tuple(foundDevices, lostDevices);
817 std::vector<std::future<std::tuple<std::vector<std::shared_ptr<core::DeviceDescriptor>>, std::vector<std::string>>>>
819 for (
const auto& iface : m_interfaces)
821 deviceUpdateFutures.emplace_back(
822 std::async(launchPolicy, deviceUpdateFunc, std::const_pointer_cast<core::Interface>(iface)));
824 for (
const auto& iface : allFoundInterfaces)
826 deviceUpdateFutures.emplace_back(std::async(launchPolicy, deviceUpdateFunc, iface));
828 for (
auto& future : deviceUpdateFutures)
830 auto foundLostDevicesTuple = future.get();
831 auto foundDevices = std::get<0>(foundLostDevicesTuple);
832 auto lostDevices = std::get<1>(foundLostDevicesTuple);
833 allFoundDevices.reserve(allFoundDevices.size() + foundDevices.size());
834 std::move(std::begin(foundDevices), std::end(foundDevices), std::back_inserter(allFoundDevices));
835 allLostDevices.reserve(allLostDevices.size() + lostDevices.size());
836 std::move(std::begin(lostDevices), std::end(lostDevices), std::back_inserter(allLostDevices));
841 std::lock_guard<std::mutex> lock(m_systemsMutex);
842 std::lock_guard<std::recursive_mutex> lock2(m_interfacesMutex);
843 std::lock_guard<std::recursive_mutex> lock3(m_devicesMutex);
845 m_systems.reserve(m_systems.size() + allFoundSystems.size());
846 std::copy(std::begin(allFoundSystems), std::end(allFoundSystems), std::back_inserter(m_systems));
848 for (
const auto& lostInterfaceKey : allLostInterfaces)
850 m_interfaces.erase(std::find_if(std::begin(m_interfaces), std::end(m_interfaces),
851 [&lostInterfaceKey](
const std::shared_ptr<const core::Interface>& interfaceToCheck) ->
bool {
852 return interfaceToCheck->Key() == lostInterfaceKey;
855 m_interfaces.reserve(m_interfaces.size() + allFoundInterfaces.size());
856 std::copy(std::begin(allFoundInterfaces), std::end(allFoundInterfaces), std::back_inserter(m_interfaces));
858 for (
const auto& lostDeviceKey : allLostDevices)
860 m_devices.erase(std::find_if(std::begin(m_devices), std::end(m_devices),
861 [&lostDeviceKey](
const std::shared_ptr<core::DeviceDescriptor>& deviceToCheck) ->
bool {
862 return deviceToCheck->Key() == lostDeviceKey;
865 m_devices.reserve(m_devices.size() + allFoundDevices.size());
866 std::copy(std::begin(allFoundDevices), std::end(allFoundDevices), std::back_inserter(m_devices));
870 for (
const auto& foundSystem : allFoundSystems)
872 TriggerSystemFoundCallbacks(foundSystem);
875 for (
const auto& foundInterface : allFoundInterfaces)
877 TriggerInterfaceFoundCallbacks(foundInterface);
879 std::unordered_set<std::string> allLostInterfacesLookUp;
880 for (
const auto& lostInterfaceKey : allLostInterfaces)
882 TriggerInterfaceLostCallbacks(lostInterfaceKey);
883 allLostInterfacesLookUp.emplace(lostInterfaceKey);
886 for (
const auto& foundDevice : allFoundDevices)
888 TriggerDeviceFoundCallbacks(foundDevice);
890 GetLostDevicesFromLostInterfaces(allLostInterfacesLookUp, allLostDevices);
891 for (
const auto& lostDeviceKey : allLostDevices)
893 TriggerDeviceLostCallbacks(lostDeviceKey);
899 std::lock_guard<std::mutex> lockUpdate(m_updateMutex);
904 CheckDevicesOpened();
908 std::lock_guard<std::mutex> lock(m_systemsMutex);
909 std::lock_guard<std::recursive_mutex> lock2(m_interfacesMutex);
910 std::lock_guard<std::recursive_mutex> lock3(m_devicesMutex);
913 auto origDevices = m_devices;
915 for (
const auto& lostDevice : origDevices)
917 TriggerDeviceLostCallbacks(lostDevice->Key());
922 auto origInterfaces = m_interfaces;
923 m_interfaces.clear();
924 for (
const auto& lostInterface : origInterfaces)
926 TriggerInterfaceLostCallbacks(lostInterface->Key());
931 m_producerLibraries.clear();
935 std::lock_guard<std::mutex> lock(m_producerLibrariesToAddMutex);
936 m_producerLibrariesToAdd.clear();
940 inline void DeviceManager::CheckDevicesOpened()
const 942 size_t openDevicesFound = 0;
943 std::string deviceDisplayNames;
946 std::lock_guard<std::mutex> lock(m_openedDevicesMutex);
948 for (
const auto& openedDevice : m_openedDevices)
950 auto openDevice = openedDevice.device.lock();
954 deviceDisplayNames += openedDevice.displayName;
955 deviceDisplayNames +=
" ";
960 if (openDevicesFound > 0)
963 "Can't reset the device manager while there are devices open. The following devices (" 964 + std::to_string(openDevicesFound) +
") are open: " + deviceDisplayNames);
970 return m_interfaceUpdateTimeout_ms;
975 m_interfaceUpdateTimeout_ms = timeout_ms;
980 return m_deviceUpdateTimeout_ms;
985 m_deviceUpdateTimeout_ms = timeout_ms;
990 std::lock_guard<std::mutex> lock(m_systemsMutex);
997 std::lock_guard<std::recursive_mutex> lock(m_interfacesMutex);
1004 std::lock_guard<std::recursive_mutex> lock(m_devicesMutex);
1012 return m_systemFoundCallbackManager.RegisterCallback(callback);
1017 m_systemFoundCallbackManager.UnregisterCallback(callbackHandle);
1023 return m_interfaceFoundCallbackManager.RegisterCallback(callback);
1028 m_interfaceFoundCallbackManager.UnregisterCallback(callbackHandle);
1034 return m_interfaceLostCallbackManager.RegisterCallback(callback);
1039 m_interfaceLostCallbackManager.UnregisterCallback(callbackHandle);
1045 return m_deviceFoundCallbackManager.RegisterCallback(callback);
1050 m_deviceFoundCallbackManager.UnregisterCallback(callbackHandle);
1056 return m_deviceLostCallbackManager.RegisterCallback(callback);
1061 m_deviceLostCallbackManager.UnregisterCallback(callbackHandle);
1064 inline void DeviceManager::GetLostDevicesFromLostInterfaces(
1065 const std::unordered_set<std::string>& lostInterfaces, std::vector<std::string>& lostDevices)
1067 std::lock_guard<std::recursive_mutex> lock(m_devicesMutex);
1069 for (
const auto& device : m_devices)
1071 if (lostInterfaces.count(device->ParentInterface()->Key()))
1073 lostDevices.emplace_back(device->Key());
1078 inline void DeviceManager::TriggerSystemFoundCallbacks(
const std::shared_ptr<const core::System>& foundSystem)
const 1080 m_systemFoundCallbackManager.TriggerCallbacks(foundSystem);
1083 inline void DeviceManager::TriggerInterfaceFoundCallbacks(
1084 const std::shared_ptr<const core::Interface>& foundInterface)
const 1086 m_interfaceFoundCallbackManager.TriggerCallbacks(foundInterface);
1089 inline void DeviceManager::TriggerInterfaceLostCallbacks(
const std::string& lostInterfaceKey)
const 1091 m_interfaceLostCallbackManager.TriggerCallbacks(lostInterfaceKey);
1094 inline void DeviceManager::TriggerDeviceFoundCallbacks(
const std::shared_ptr<core::DeviceDescriptor>& foundDevice)
const 1096 m_deviceFoundCallbackManager.TriggerCallbacks(foundDevice);
1099 inline void DeviceManager::TriggerDeviceLostCallbacks(
const std::string& lostDeviceKey)
const 1101 m_deviceLostCallbackManager.TriggerCallbacks(lostDeviceKey);
std::function< void(const std::string &errorDescription)> UpdateErrorCallback
Definition: peak_device_manager.hpp:108
void AddProducerLibrary(const std::string &ctiPath)
Adds the given producer library (CTI).
Definition: peak_device_manager.hpp:570
std::function< void(const std::string &lostInterfaceKey)> InterfaceLostCallback
Definition: peak_device_manager.hpp:96
static std::shared_ptr< ProducerLibrary > Open(const std::string &ctiPath)
Opens the given producer library (CTI).
Definition: peak_producer_library.hpp:109
std::vector< std::shared_ptr< core::DeviceDescriptor > > Devices() const
Returns the found devices.
Definition: peak_device_manager.hpp:1002
void SetDeviceUpdateTimeout(core::Timeout timeout_ms)
Sets the device update timeout.
Definition: peak_device_manager.hpp:983
UpdatePolicy
Enum holding the possible update policies.
Definition: peak_device_manager.hpp:75
ResetPolicy
Enum holding the possible reset policies.
Definition: peak_device_manager.hpp:81
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
DeviceLostCallbackHandle RegisterDeviceLostCallback(const DeviceLostCallback &callback)
Registers a callback for signaling a lost device.
Definition: peak_device_manager.hpp:1053
The exception thrown for signaling that the library was not initialized.
Definition: peak_exception.hpp:123
std::function< void(const std::shared_ptr< const core::Interface > &foundInterface)> InterfaceFoundCallback
Definition: peak_device_manager.hpp:92
std::vector< std::shared_ptr< const core::Interface > > Interfaces() const
Returns the found and opened interfaces.
Definition: peak_device_manager.hpp:995
InterfaceLostCallback * InterfaceLostCallbackHandle
Definition: peak_device_manager.hpp:98
std::function< void(const std::shared_ptr< const core::System > &foundSystem)> SystemFoundCallback
Definition: peak_device_manager.hpp:88
SystemFoundCallbackHandle RegisterSystemFoundCallback(const SystemFoundCallback &callback)
Registers a callback for signaling a found system.
Definition: peak_device_manager.hpp:1009
void Reset(ResetPolicy resetPolicy=ResetPolicy::ErrorOnOpenDevices)
Resets the DeviceManager.
Definition: peak_device_manager.hpp:897
void UnregisterSystemFoundCallback(SystemFoundCallbackHandle callbackHandle)
Unregisters a system found callback.
Definition: peak_device_manager.hpp:1015
A collection of global library functions.
Definition: peak_library.hpp:30
core::Timeout InterfaceUpdateTimeout() const
Returns the interface update timeout.
Definition: peak_device_manager.hpp:968
void UnregisterInterfaceFoundCallback(InterfaceFoundCallbackHandle callbackHandle)
Unregisters a interface found callback.
Definition: peak_device_manager.hpp:1026
InterfaceFoundCallbackHandle RegisterInterfaceFoundCallback(const InterfaceFoundCallback &callback)
Registers a callback for signaling a found interface.
Definition: peak_device_manager.hpp:1020
void Update(UpdatePolicy updatePolicy=UpdatePolicy::ScanEnvironmentForProducerLibraries, const UpdateErrorCallback &errorCallback=UpdateErrorCallback())
Starts an update.
Definition: peak_device_manager.hpp:577
static std::vector< std::string > CollectCTIPaths()
Collects producer library paths found in the current environment.
Definition: peak_environment_inspector.hpp:71
DeviceLostCallback * DeviceLostCallbackHandle
Definition: peak_device_manager.hpp:106
Represents a timeout value in milliseconds.
Definition: peak_timeout.hpp:30
The exception thrown for internal errors.
Definition: peak_exception.hpp:57
The base class for all exceptions thrown by the library.
Definition: peak_exception.hpp:25
DeviceFoundCallbackHandle RegisterDeviceFoundCallback(const DeviceFoundCallback &callback)
Registers a callback for signaling a found device.
Definition: peak_device_manager.hpp:1042
The global DeviceManager (singleton) searches all installed producer libraries (*.cti) and enumerates the modules contained in them.
Definition: peak_device_manager.hpp:71
std::function< void(const std::shared_ptr< core::DeviceDescriptor > &foundDevice)> DeviceFoundCallback
Definition: peak_device_manager.hpp:100
static DeviceManager & Instance()
Returns the global DeviceManager.
Definition: peak_device_manager.hpp:560
InterfaceLostCallbackHandle RegisterInterfaceLostCallback(const InterfaceLostCallback &callback)
Registers a callback for signaling a lost interface.
Definition: peak_device_manager.hpp:1031
std::function< void(const std::string &lostDeviceKey)> DeviceLostCallback
Definition: peak_device_manager.hpp:104
void UnregisterDeviceLostCallback(DeviceLostCallbackHandle callbackHandle)
Unregisters a device lost callback.
Definition: peak_device_manager.hpp:1059
SystemFoundCallback * SystemFoundCallbackHandle
Definition: peak_device_manager.hpp:90
The exception thrown for signaling a feature is not available in the device.
Definition: peak_exception.hpp:97
InterfaceFoundCallback * InterfaceFoundCallbackHandle
Definition: peak_device_manager.hpp:94
DeviceFoundCallback * DeviceFoundCallbackHandle
Definition: peak_device_manager.hpp:102
std::vector< std::shared_ptr< const core::System > > Systems() const
Returns the found and opened systems.
Definition: peak_device_manager.hpp:988
void UnregisterInterfaceLostCallback(InterfaceLostCallbackHandle callbackHandle)
Unregisters an interface lost callback.
Definition: peak_device_manager.hpp:1037
core::Timeout DeviceUpdateTimeout() const
Returns the device update timeout.
Definition: peak_device_manager.hpp:978
void UnregisterDeviceFoundCallback(DeviceFoundCallbackHandle callbackHandle)
Unregisters a device found callback.
Definition: peak_device_manager.hpp:1048
void SetInterfaceUpdateTimeout(core::Timeout timeout_ms)
Sets the interface update timeout.
Definition: peak_device_manager.hpp:973