IDS peak genericC++  v1.7.2
peak_device_descriptor.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
19 #include <peak/dll_interface/peak_dll_interface_util.hpp>
20 #include <peak/generic/peak_t_callback_manager.hpp>
21 
22 #include <cstddef>
23 #include <cstdint>
24 #include <memory>
25 #include <string>
26 
27 
28 namespace peak
29 {
30 namespace core
31 {
32 
38 enum class DeviceAccessType
39 {
40  ReadOnly = 2,
41  Control,
42  Exclusive,
43 
44  Custom = 1000
45 };
46 
53 {
54  ID = 0,
55  VendorName,
56  ModelName,
57  TLType,
62  Version,
64 
65  Custom = 1000
66 };
67 
68 class Interface;
69 
103 {
104 public:
106  using InformationChangedCallback = std::function<void(const std::vector<DeviceInformationRole>& changedRoles)>;
110  using DeviceOpenedCallback = std::function<void(const std::shared_ptr<core::Device>& openedDevice)>;
113 
114  DeviceDescriptor() = delete;
115  ~DeviceDescriptor() override;
116  DeviceDescriptor(const DeviceDescriptor& other) = delete;
117  DeviceDescriptor& operator=(const DeviceDescriptor& other) = delete;
118  DeviceDescriptor(DeviceDescriptor&& other) = delete;
119  DeviceDescriptor& operator=(DeviceDescriptor&& other) = delete;
120 
122  std::string Key() const;
123 
125  RawInformation Info(int32_t infoCommand) const;
126 
137  std::string DisplayName() const;
138 
149  std::string VendorName() const;
150 
161  std::string ModelName() const;
162 
173  std::string Version() const;
174 
176  std::string TLType() const;
177 
188  std::string UserDefinedName() const;
189 
200  std::string SerialNumber() const;
201 
213 
224  uint64_t TimestampTickFrequency() const;
225 
236  std::shared_ptr<Interface> ParentInterface() const;
237 
242 
264  bool IsOpenable(DeviceAccessType accessType = DeviceAccessType::Exclusive) const;
265 
279  std::shared_ptr<Device> OpenDevice(DeviceAccessType accessType);
280 
290  std::shared_ptr<Device> OpenedDevice() const;
291 
306  DeviceOpenedCallbackHandle RegisterDeviceOpenedCallback(const DeviceOpenedCallback& callback);
307 
319  void UnregisterDeviceOpenedCallback(DeviceOpenedCallbackHandle callbackHandle);
320 
322 
327 
337  uint64_t MonitoringUpdateInterval() const;
338 
348  void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms);
349 
362  bool IsInformationRoleMonitored(DeviceInformationRole informationRole) const;
363 
373  void AddInformationRoleToMonitoring(DeviceInformationRole informationRole);
374 
384  void RemoveInformationRoleFromMonitoring(DeviceInformationRole informationRole);
385 
400  InformationChangedCallbackHandle RegisterInformationChangedCallback(const InformationChangedCallback& callback);
401 
413  void UnregisterInformationChangedCallback(InformationChangedCallbackHandle callbackHandle);
414 
416 
417 private:
418  static void PEAK_CALL_CONV InformationChangedCallbackCWrapper(
419  const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context);
420 
421  friend ClassCreator<DeviceDescriptor>;
423  PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface);
424  PEAK_MODULE_DESCRIPTOR_HANDLE ModuleDescriptorHandle() const override;
425 
426  PEAK_DEVICE_DESCRIPTOR_HANDLE m_backendHandle;
427 
428  std::weak_ptr<Interface> m_parentInterface;
429  std::weak_ptr<Device> m_openedDevice;
430 
431  std::unique_ptr<
432  TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>
433  m_informationChangedCallbackManager;
434 
435  TTriggerCallbackManager<DeviceOpenedCallbackHandle, DeviceOpenedCallback> m_deviceOpenedCallbackManager;
436 
437  std::string m_key;
438 
439  friend class FirmwareUpdater;
440 };
441 
442 } /* namespace core */
443 } /* namespace peak */
444 
445 /* Implementation */
446 namespace peak
447 {
448 namespace core
449 {
450 
451 inline std::string ToString(DeviceAccessType entry)
452 {
453  std::string entryString;
454 
455  if (entry == DeviceAccessType::ReadOnly)
456  {
457  entryString = "ReadOnly";
458  }
459  else if (entry == DeviceAccessType::Control)
460  {
461  entryString = "Control";
462  }
463  else if (entry == DeviceAccessType::Exclusive)
464  {
465  entryString = "Exclusive";
466  }
467  else if (entry >= DeviceAccessType::Custom)
468  {
469  entryString = "Custom";
470  }
471 
472  return entryString;
473 }
474 
475 inline std::string ToString(DeviceInformationRole entry)
476 {
477  std::string entryString;
478 
479  if (entry == DeviceInformationRole::ID)
480  {
481  entryString = "ID";
482  }
483  else if (entry == DeviceInformationRole::VendorName)
484  {
485  entryString = "VendorName";
486  }
487  else if (entry == DeviceInformationRole::ModelName)
488  {
489  entryString = "ModelName";
490  }
491  else if (entry == DeviceInformationRole::TLType)
492  {
493  entryString = "TLType";
494  }
495  else if (entry == DeviceInformationRole::DisplayName)
496  {
497  entryString = "DisplayName";
498  }
499  else if (entry == DeviceInformationRole::AccessStatus)
500  {
501  entryString = "AccessStatus";
502  }
503  else if (entry == DeviceInformationRole::UserDefinedName)
504  {
505  entryString = "UserDefinedName";
506  }
507  else if (entry == DeviceInformationRole::SerialNumber)
508  {
509  entryString = "SerialNumber";
510  }
511  else if (entry == DeviceInformationRole::Version)
512  {
513  entryString = "Version";
514  }
516  {
517  entryString = "TimestampTickFrequency";
518  }
519  else if (entry >= DeviceInformationRole::Custom)
520  {
521  entryString = "Custom";
522  }
523 
524  return entryString;
525 }
526 
528  PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface)
529  : m_backendHandle(deviceDescriptorHandle)
530  , m_parentInterface(parentInterface)
531  , m_informationChangedCallbackManager()
532  , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
533  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetKey(deviceDescriptorHandle, key, keySize);
534  }))
535 {
536  m_informationChangedCallbackManager = std::make_unique<
537  TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>(
538  [&](void* callbackContext) {
539  return QueryNumericFromCInterfaceFunction<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(
541  deviceDescriptorChangedCallbackHandle) {
543  m_backendHandle, InformationChangedCallbackCWrapper, callbackContext,
544  deviceDescriptorChangedCallbackHandle);
545  });
546  },
548  CallAndCheckCInterfaceFunction([&] {
550  m_backendHandle, callbackHandle);
551  });
552  });
553 }
554 
556 {
557  try
558  {
559  m_informationChangedCallbackManager->UnregisterAllCallbacks();
560  }
561  catch (const Exception&)
562  {}
563 }
564 
565 inline std::string DeviceDescriptor::Key() const
566 {
567  return m_key;
568 }
569 
570 inline RawInformation DeviceDescriptor::Info(int32_t infoCommand) const
571 {
572  return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
574  m_backendHandle, infoCommand, dataType, buffer, bufferSize);
575  });
576 }
577 
578 inline std::string DeviceDescriptor::DisplayName() const
579 {
580  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* displayName, size_t* displayNameSize) {
582  m_backendHandle, displayName, displayNameSize);
583  });
584 }
585 
586 inline std::string DeviceDescriptor::VendorName() const
587 {
588  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* vendorName, size_t* vendorNameSize) {
589  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVendorName(m_backendHandle, vendorName, vendorNameSize);
590  });
591 }
592 
593 inline std::string DeviceDescriptor::ModelName() const
594 {
595  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* modelName, size_t* modelNameSize) {
596  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetModelName(m_backendHandle, modelName, modelNameSize);
597  });
598 }
599 
600 inline std::string DeviceDescriptor::Version() const
601 {
602  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* version, size_t* versionSize) {
603  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVersion(m_backendHandle, version, versionSize);
604  });
605 }
606 
607 inline std::string DeviceDescriptor::TLType() const
608 {
609  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* tlType, size_t* tlTypeSize) {
610  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetTLType(m_backendHandle, tlType, tlTypeSize);
611  });
612 }
613 
614 inline std::string DeviceDescriptor::UserDefinedName() const
615 {
616  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* userDefinedName, size_t* userDefinedNameSize) {
618  m_backendHandle, userDefinedName, userDefinedNameSize);
619  });
620 }
621 
622 inline std::string DeviceDescriptor::SerialNumber() const
623 {
624  return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* serialNumber, size_t* serialNumberSize) {
626  m_backendHandle, serialNumber, serialNumberSize);
627  });
628 }
629 
631 {
632  return static_cast<DeviceAccessStatus>(QueryNumericFromCInterfaceFunction<PEAK_DEVICE_ACCESS_STATUS>(
633  [&](PEAK_DEVICE_ACCESS_STATUS* accessStatus) {
634  return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetAccessStatus(m_backendHandle, accessStatus);
635  }));
636 }
637 
639 {
640  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestampTickFrequency) {
642  m_backendHandle, timestampTickFrequency);
643  });
644 }
645 
646 inline std::shared_ptr<Interface> DeviceDescriptor::ParentInterface() const
647 {
648  return LockOrThrow(m_parentInterface);
649 }
650 
651 inline bool DeviceDescriptor::IsOpenable(DeviceAccessType accessType) const
652 {
653  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessTypeAvailable) {
655  m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), isAccessTypeAvailable);
656  }) > 0;
657 }
658 
659 inline std::shared_ptr<Device> DeviceDescriptor::OpenDevice(DeviceAccessType accessType)
660 {
661  auto deviceHandle = QueryNumericFromCInterfaceFunction<PEAK_DEVICE_HANDLE>(
662  [&](PEAK_DEVICE_HANDLE* _deviceHandle) {
664  m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), _deviceHandle);
665  });
666 
667  auto device = std::make_shared<ClassCreator<Device>>(deviceHandle, m_parentInterface);
668  m_openedDevice = device;
669  m_deviceOpenedCallbackManager.TriggerCallbacks(device);
670 
671  return device;
672 }
673 
674 inline std::shared_ptr<Device> DeviceDescriptor::OpenedDevice() const
675 {
676  return LockOrThrowOpenedModule(m_openedDevice);
677 }
678 
680  const DeviceOpenedCallback& callback)
681 {
682  return m_deviceOpenedCallbackManager.RegisterCallback(callback);
683 }
684 
686 {
687  return m_deviceOpenedCallbackManager.UnregisterCallback(callback);
688 }
689 
691 {
692  return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* monitoringUpdateInterval_ms) {
694  m_backendHandle, monitoringUpdateInterval_ms);
695  });
696 }
697 
698 inline void DeviceDescriptor::SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
699 {
700  return CallAndCheckCInterfaceFunction([&] {
702  m_backendHandle, monitoringUpdateInterval_ms);
703  });
704 }
705 
707 {
708  return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isInformationRoleMonitored) {
710  m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole), isInformationRoleMonitored);
711  }) > 0;
712 }
713 
715 {
716  return CallAndCheckCInterfaceFunction([&] {
718  m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
719  });
720 }
721 
723 {
724  return CallAndCheckCInterfaceFunction([&] {
726  m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
727  });
728 }
729 
732 {
733  return reinterpret_cast<InformationChangedCallbackHandle>(
734  m_informationChangedCallbackManager->RegisterCallback(callback));
735 }
736 
738 {
739  m_informationChangedCallbackManager->UnregisterCallback(
740  reinterpret_cast<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(callbackHandle));
741 }
742 
743 inline void PEAK_CALL_CONV DeviceDescriptor::InformationChangedCallbackCWrapper(
744  const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context)
745 {
746  auto callback = static_cast<DeviceDescriptor::InformationChangedCallback*>(context);
747  std::vector<DeviceInformationRole> changedRolesVec;
748  changedRolesVec.reserve(changedRolesSize);
749  for (size_t i = 0; i < changedRolesSize; ++i)
750  {
751  changedRolesVec.emplace_back(static_cast<DeviceInformationRole>(*(changedRoles + i)));
752  }
753  callback->operator()(changedRolesVec);
754 }
755 
756 inline PEAK_MODULE_DESCRIPTOR_HANDLE DeviceDescriptor::ModuleDescriptorHandle() const
757 {
758  auto moduleDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_DESCRIPTOR_HANDLE>(
759  [&](PEAK_MODULE_DESCRIPTOR_HANDLE* _moduleDescriptorHandle) {
761  m_backendHandle, _moduleDescriptorHandle);
762  });
763 
764  return moduleDescriptorHandle;
765 }
766 
767 } /* namespace core */
768 } /* namespace peak */
std::string Key() const
Returns the unique key.
Definition: peak_device_descriptor.hpp:565
std::function< void(const std::shared_ptr< core::Device > &openedDevice)> DeviceOpenedCallback
Definition: peak_device_descriptor.hpp:110
Encapsulates the GenTL functions associated with a GenTL Device module&#39;s ID.
Definition: peak_device_descriptor.hpp:102
PEAK_C_API PEAK_DeviceDescriptor_GetVendorName(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *vendorName, size_t *vendorNameSize)
Asks the given device descriptor for its vendor name.
int8_t PEAK_BOOL8
Definition: peak_backend.h:26
PEAK_C_API PEAK_DeviceDescriptor_OpenDevice(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_ACCESS_TYPE accessType, PEAK_DEVICE_HANDLE *deviceHandle)
Opens the device being associated with the given interface descriptor for the given access type...
int32_t PEAK_DEVICE_INFORMATION_ROLE
Definition: peak_backend.h:146
PEAK_C_API PEAK_DeviceDescriptor_IsInformationRoleMonitored(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_INFORMATION_ROLE informationRole, PEAK_BOOL8 *isInformationRoleMonitored)
Asks the given device descriptor whether the given information role is monitored. ...
PEAK_C_API PEAK_DeviceDescriptor_GetAccessStatus(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_ACCESS_STATUS *accessStatus)
Asks the given device descriptor for its access status.
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
void UnregisterDeviceOpenedCallback(DeviceOpenedCallbackHandle callbackHandle)
Unregisters a device opened callback.
Definition: peak_device_descriptor.hpp:685
std::string ToString(BufferPayloadType entry)
Definition: peak_buffer.hpp:505
std::string VendorName() const
Returns the vendor name.
Definition: peak_device_descriptor.hpp:586
PEAK_C_API PEAK_DeviceDescriptor_GetVersion(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *version, size_t *versionSize)
Asks the given device descriptor for its version.
PEAK_C_API PEAK_DeviceDescriptor_GetTLType(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *tlType, size_t *tlTypeSize)
Asks the given device descriptor for its TL type.
std::function< void(const std::vector< DeviceInformationRole > &changedRoles)> InformationChangedCallback
Definition: peak_device_descriptor.hpp:106
bool IsOpenable(DeviceAccessType accessType=DeviceAccessType::Exclusive) const
Checks whether the device can be opened with a specific access type.
Definition: peak_device_descriptor.hpp:651
DeviceAccessStatus
Current accessibility of the device.
Definition: peak_common_device_enums.hpp:24
DeviceInformationRole
Different types of information about the device.
Definition: peak_device_descriptor.hpp:52
void AddInformationRoleToMonitoring(DeviceInformationRole informationRole)
Adds the given information role to the monitoring.
Definition: peak_device_descriptor.hpp:714
bool IsInformationRoleMonitored(DeviceInformationRole informationRole) const
Checks whether the given information role is monitored.
Definition: peak_device_descriptor.hpp:706
DeviceOpenedCallbackHandle RegisterDeviceOpenedCallback(const DeviceOpenedCallback &callback)
Registers a callback for signaling when the Device is opened with this DeviceDescriptor.
Definition: peak_device_descriptor.hpp:679
Allows to update the firmware of a device.
Definition: peak_firmware_updater.hpp:45
Represents a GenTL Interface module.
Definition: peak_interface.hpp:46
InformationChangedCallback * InformationChangedCallbackHandle
Definition: peak_device_descriptor.hpp:108
std::string TLType() const
Returns the TL (transport layer) type.
Definition: peak_device_descriptor.hpp:607
std::shared_ptr< Interface > ParentInterface() const
Returns the parent interface.
Definition: peak_device_descriptor.hpp:646
std::string Version() const
Returns the version.
Definition: peak_device_descriptor.hpp:600
struct PEAK_MODULE_DESCRIPTOR * PEAK_MODULE_DESCRIPTOR_HANDLE
Definition: peak_backend.h:399
PEAK_C_API PEAK_DeviceDescriptor_ToModuleDescriptor(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_MODULE_DESCRIPTOR_HANDLE *moduleDescriptorHandle)
Casts the given device descriptor to a module descriptor.
PEAK_C_API PEAK_DeviceDescriptor_GetModelName(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *modelName, size_t *modelNameSize)
Asks the given device descriptor for its model name.
PEAK_C_API PEAK_DeviceDescriptor_AddInformationRoleToMonitoring(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_INFORMATION_ROLE informationRole)
Tells the given device descriptor to add the given information role to the monitoring.
PEAK_C_API PEAK_DeviceDescriptor_GetDisplayName(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *displayName, size_t *displayNameSize)
Asks the given device descriptor for its display name.
std::string DisplayName() const
Returns the display name.
Definition: peak_device_descriptor.hpp:578
PEAK_C_API PEAK_DeviceDescriptor_RegisterInformationChangedCallback(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK callback, void *callbackContext, PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE *callbackHandle)
Registers a callback signaling changed information at the given device descriptor.
std::shared_ptr< Device > OpenDevice(DeviceAccessType accessType)
Opens the Device.
Definition: peak_device_descriptor.hpp:659
PEAK_C_API PEAK_DeviceDescriptor_GetSerialNumber(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *serialNumber, size_t *serialNumberSize)
Asks the given device descriptor for its serial number.
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition: peak_device_descriptor.hpp:570
The base class for all openable modules.
Definition: peak_module_descriptor.hpp:30
std::string SerialNumber() const
Returns the serial number.
Definition: peak_device_descriptor.hpp:622
The base class for all exceptions thrown by the library.
Definition: peak_exception.hpp:25
PEAK_C_API PEAK_DeviceDescriptor_GetIsOpenable(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_ACCESS_TYPE accessType, PEAK_BOOL8 *isOpenable)
Asks the given device descriptor whether the device can be opened with this specific access type...
PEAK_C_API PEAK_DeviceDescriptor_GetTimestampTickFrequency(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, uint64_t *timestampTickFrequency)
Asks the given device descriptor for its timestamp tick frequency.
uint64_t TimestampTickFrequency() const
Returns the timestamp tick frequency.
Definition: peak_device_descriptor.hpp:638
PEAK_C_API PEAK_DeviceDescriptor_GetInfo(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, int32_t infoCommand, int32_t *infoDataType, uint8_t *info, size_t *infoSize)
Asks the given device descriptor for an information based on a specific command.
PEAK_C_API PEAK_DeviceDescriptor_UnregisterInformationChangedCallback(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE callbackHandle)
Unregisters the information changed callback with the given handle from the given device descriptor...
struct PEAK_DEVICE_DESCRIPTOR * PEAK_DEVICE_DESCRIPTOR_HANDLE
Definition: peak_backend.h:367
DeviceOpenedCallback * DeviceOpenedCallbackHandle
Definition: peak_device_descriptor.hpp:112
#define PEAK_CALL_CONV
Definition: peak_dynamic_loader.h:29
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16
PEAK_C_API PEAK_DeviceDescriptor_RemoveInformationRoleFromMonitoring(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_DEVICE_INFORMATION_ROLE informationRole)
Tells the given device descriptor to remove the given information role from the monitoring.
PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK * PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE
Definition: peak_backend.h:567
std::string UserDefinedName() const
Returns the user defined name.
Definition: peak_device_descriptor.hpp:614
InformationChangedCallbackHandle RegisterInformationChangedCallback(const InformationChangedCallback &callback)
Registers a callback for signaling changed information.
Definition: peak_device_descriptor.hpp:730
int32_t PEAK_DEVICE_ACCESS_STATUS
Definition: peak_backend.h:117
uint64_t MonitoringUpdateInterval() const
Returns the monitoring update interval.
Definition: peak_device_descriptor.hpp:690
PEAK_C_API PEAK_DeviceDescriptor_GetUserDefinedName(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *userDefinedName, size_t *userDefinedNameSize)
Asks the given device descriptor for its user-defined name.
DeviceAccessStatus AccessStatus() const
Returns the access status.
Definition: peak_device_descriptor.hpp:630
PEAK_C_API PEAK_DeviceDescriptor_SetMonitoringUpdateInterval(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, uint64_t monitoringUpdateInterval_ms)
Tells the given device descriptor to set the given monitoring update interval.
void RemoveInformationRoleFromMonitoring(DeviceInformationRole informationRole)
Removes the given information role from the monitoring.
Definition: peak_device_descriptor.hpp:722
The struct returned by all raw information functions.
Definition: peak_common_structs.hpp:24
void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
Sets the monitoring update interval.
Definition: peak_device_descriptor.hpp:698
std::shared_ptr< Device > OpenedDevice() const
Returns the Device that was opened with this DeviceDescriptor.
Definition: peak_device_descriptor.hpp:674
PEAK_C_API PEAK_DeviceDescriptor_GetMonitoringUpdateInterval(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, uint64_t *monitoringUpdateInterval_ms)
Asks the given device descriptor for its monitoring update interval.
struct PEAK_DEVICE * PEAK_DEVICE_HANDLE
Definition: peak_backend.h:371
~DeviceDescriptor() override
Definition: peak_device_descriptor.hpp:555
std::string ModelName() const
Returns the model name.
Definition: peak_device_descriptor.hpp:593
PEAK_C_API PEAK_DeviceDescriptor_GetKey(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *key, size_t *keySize)
Asks the given device descriptor for its key.
DeviceAccessType
Different modes to open the device with.
Definition: peak_device_descriptor.hpp:38
void UnregisterInformationChangedCallback(InformationChangedCallbackHandle callbackHandle)
Unregisters an information changed callback.
Definition: peak_device_descriptor.hpp:737