IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
peak_device_descriptor.hpp
Go to the documentation of this file.
1
10
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
28namespace peak
29{
30namespace core
31{
32
40{
44
45 Custom = 1000
46};
47
69
70class Interface;
71
106{
107public:
109 using InformationChangedCallback = std::function<void(const std::vector<DeviceInformationRole>& changedRoles)>;
113 using DeviceOpenedCallback = std::function<void(const std::shared_ptr<core::Device>& openedDevice)>;
116
118 ~DeviceDescriptor() override;
119 DeviceDescriptor(const DeviceDescriptor& other) = delete;
123
125 std::string Key() const;
126
128 RawInformation Info(int32_t infoCommand) const;
129
140 std::string DisplayName() const;
141
152 std::string VendorName() const;
153
164 std::string ModelName() const;
165
176 std::string Version() const;
177
179 std::string TLType() const;
180
191 std::string UserDefinedName() const;
192
203 std::string SerialNumber() const;
204
216
227 uint64_t TimestampTickFrequency() const;
228
239 std::shared_ptr<Interface> ParentInterface() const;
240
246
268
282 std::shared_ptr<Device> OpenDevice(DeviceAccessType accessType);
283
293 std::shared_ptr<Device> OpenedDevice() const;
294
310
323
325
331
340 uint64_t MonitoringUpdateInterval() const;
341
351 void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms);
352
365 bool IsInformationRoleMonitored(DeviceInformationRole informationRole) const;
366
377
388
404
417
419
420private:
421 static void PEAK_CALL_CONV InformationChangedCallbackCWrapper(
422 const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context);
423
424 friend ClassCreator<DeviceDescriptor>;
426 PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface);
428
429 PEAK_DEVICE_DESCRIPTOR_HANDLE m_backendHandle;
430
431 std::weak_ptr<Interface> m_parentInterface;
432 std::weak_ptr<Device> m_openedDevice;
433
434 std::unique_ptr<
435 TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>
436 m_informationChangedCallbackManager;
437
438 TTriggerCallbackManager<DeviceOpenedCallbackHandle, DeviceOpenedCallback> m_deviceOpenedCallbackManager;
439
440 std::string m_key;
441
442 friend class FirmwareUpdater;
443};
444
445} /* namespace core */
446} /* namespace peak */
447
448/* Implementation */
449namespace peak
450{
451namespace core
452{
453
454inline std::string ToString(DeviceAccessType entry)
455{
456 std::string entryString;
457
458 if (entry == DeviceAccessType::ReadOnly)
459 {
460 entryString = "ReadOnly";
461 }
462 else if (entry == DeviceAccessType::Control)
463 {
464 entryString = "Control";
465 }
466 else if (entry == DeviceAccessType::Exclusive)
467 {
468 entryString = "Exclusive";
469 }
470 else if (entry >= DeviceAccessType::Custom)
471 {
472 entryString = "Custom";
473 }
474
475 return entryString;
476}
477
478inline std::string ToString(DeviceInformationRole entry)
479{
480 std::string entryString;
481
482 if (entry == DeviceInformationRole::ID)
483 {
484 entryString = "ID";
485 }
486 else if (entry == DeviceInformationRole::VendorName)
487 {
488 entryString = "VendorName";
489 }
490 else if (entry == DeviceInformationRole::ModelName)
491 {
492 entryString = "ModelName";
493 }
494 else if (entry == DeviceInformationRole::TLType)
495 {
496 entryString = "TLType";
497 }
498 else if (entry == DeviceInformationRole::DisplayName)
499 {
500 entryString = "DisplayName";
501 }
502 else if (entry == DeviceInformationRole::AccessStatus)
503 {
504 entryString = "AccessStatus";
505 }
507 {
508 entryString = "UserDefinedName";
509 }
510 else if (entry == DeviceInformationRole::SerialNumber)
511 {
512 entryString = "SerialNumber";
513 }
514 else if (entry == DeviceInformationRole::Version)
515 {
516 entryString = "Version";
517 }
519 {
520 entryString = "TimestampTickFrequency";
521 }
522 else if (entry >= DeviceInformationRole::Custom)
523 {
524 entryString = "Custom";
525 }
526
527 return entryString;
528}
529
531 PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface)
532 : m_backendHandle(deviceDescriptorHandle)
533 , m_parentInterface(parentInterface)
534 , m_informationChangedCallbackManager()
535 , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
536 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetKey(deviceDescriptorHandle, key, keySize);
537 }))
538{
539 m_informationChangedCallbackManager = std::make_unique<
540 TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>(
541 [&](void* callbackContext) {
542 return QueryNumericFromCInterfaceFunction<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(
544 deviceDescriptorChangedCallbackHandle) {
546 m_backendHandle, InformationChangedCallbackCWrapper, callbackContext,
547 deviceDescriptorChangedCallbackHandle);
548 });
549 },
551 CallAndCheckCInterfaceFunction([&] {
553 m_backendHandle, callbackHandle);
554 });
555 });
556}
557
559{
560 try
561 {
562 m_informationChangedCallbackManager->UnregisterAllCallbacks();
563 }
564 catch (const Exception&)
565 {}
566}
567
568inline std::string DeviceDescriptor::Key() const
569{
570 return m_key;
571}
572
573inline RawInformation DeviceDescriptor::Info(int32_t infoCommand) const
574{
575 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
577 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
578 });
579}
580
581inline std::string DeviceDescriptor::DisplayName() const
582{
583 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* displayName, size_t* displayNameSize) {
585 m_backendHandle, displayName, displayNameSize);
586 });
587}
588
589inline std::string DeviceDescriptor::VendorName() const
590{
591 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* vendorName, size_t* vendorNameSize) {
592 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVendorName(m_backendHandle, vendorName, vendorNameSize);
593 });
594}
595
596inline std::string DeviceDescriptor::ModelName() const
597{
598 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* modelName, size_t* modelNameSize) {
599 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetModelName(m_backendHandle, modelName, modelNameSize);
600 });
601}
602
603inline std::string DeviceDescriptor::Version() const
604{
605 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* version, size_t* versionSize) {
606 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVersion(m_backendHandle, version, versionSize);
607 });
608}
609
610inline std::string DeviceDescriptor::TLType() const
611{
612 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* tlType, size_t* tlTypeSize) {
613 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetTLType(m_backendHandle, tlType, tlTypeSize);
614 });
615}
616
617inline std::string DeviceDescriptor::UserDefinedName() const
618{
619 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* userDefinedName, size_t* userDefinedNameSize) {
621 m_backendHandle, userDefinedName, userDefinedNameSize);
622 });
623}
624
625inline std::string DeviceDescriptor::SerialNumber() const
626{
627 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* serialNumber, size_t* serialNumberSize) {
629 m_backendHandle, serialNumber, serialNumberSize);
630 });
631}
632
634{
635 return static_cast<DeviceAccessStatus>(QueryNumericFromCInterfaceFunction<PEAK_DEVICE_ACCESS_STATUS>(
636 [&](PEAK_DEVICE_ACCESS_STATUS* accessStatus) {
637 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetAccessStatus(m_backendHandle, accessStatus);
638 }));
639}
640
642{
643 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestampTickFrequency) {
645 m_backendHandle, timestampTickFrequency);
646 });
647}
648
649inline std::shared_ptr<Interface> DeviceDescriptor::ParentInterface() const
650{
651 return LockOrThrow(m_parentInterface);
652}
653
655{
656 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessTypeAvailable) {
658 m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), isAccessTypeAvailable);
659 }) > 0;
660}
661
662inline std::shared_ptr<Device> DeviceDescriptor::OpenDevice(DeviceAccessType accessType)
663{
664 auto deviceHandle = QueryNumericFromCInterfaceFunction<PEAK_DEVICE_HANDLE>(
665 [&](PEAK_DEVICE_HANDLE* _deviceHandle) {
667 m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), _deviceHandle);
668 });
669
670 auto device = std::make_shared<ClassCreator<Device>>(deviceHandle, m_parentInterface);
671 m_openedDevice = device;
672 m_deviceOpenedCallbackManager.TriggerCallbacks(device);
673
674 return device;
675}
676
677inline std::shared_ptr<Device> DeviceDescriptor::OpenedDevice() const
678{
679 return LockOrThrowOpenedModule(m_openedDevice);
680}
681
683 const DeviceOpenedCallback& callback)
684{
685 return m_deviceOpenedCallbackManager.RegisterCallback(callback);
686}
687
689{
690 return m_deviceOpenedCallbackManager.UnregisterCallback(callback);
691}
692
694{
695 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* monitoringUpdateInterval_ms) {
697 m_backendHandle, monitoringUpdateInterval_ms);
698 });
699}
700
701inline void DeviceDescriptor::SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
702{
703 return CallAndCheckCInterfaceFunction([&] {
705 m_backendHandle, monitoringUpdateInterval_ms);
706 });
707}
708
710{
711 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isInformationRoleMonitored) {
713 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole), isInformationRoleMonitored);
714 }) > 0;
715}
716
718{
719 return CallAndCheckCInterfaceFunction([&] {
721 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
722 });
723}
724
726{
727 return CallAndCheckCInterfaceFunction([&] {
729 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
730 });
731}
732
735{
736 return reinterpret_cast<InformationChangedCallbackHandle>(
737 m_informationChangedCallbackManager->RegisterCallback(callback));
738}
739
741{
742 m_informationChangedCallbackManager->UnregisterCallback(
743 reinterpret_cast<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(callbackHandle));
744}
745
746inline void PEAK_CALL_CONV DeviceDescriptor::InformationChangedCallbackCWrapper(
747 const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context)
748{
749 auto callback = static_cast<DeviceDescriptor::InformationChangedCallback*>(context);
750 std::vector<DeviceInformationRole> changedRolesVec;
751 changedRolesVec.reserve(changedRolesSize);
752 for (size_t i = 0; i < changedRolesSize; ++i)
753 {
754 changedRolesVec.emplace_back(static_cast<DeviceInformationRole>(*(changedRoles + i)));
755 }
756 callback->operator()(changedRolesVec);
757}
758
759inline PEAK_MODULE_DESCRIPTOR_HANDLE DeviceDescriptor::ModuleDescriptorHandle() const
760{
761 auto moduleDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_DESCRIPTOR_HANDLE>(
762 [&](PEAK_MODULE_DESCRIPTOR_HANDLE* _moduleDescriptorHandle) {
764 m_backendHandle, _moduleDescriptorHandle);
765 });
766
767 return moduleDescriptorHandle;
768}
769
770} /* namespace core */
771} /* namespace peak */
std::string Key() const
Returns the unique key.
Definition peak_device_descriptor.hpp:568
std::string ModelName() const
Returns the model name.
Definition peak_device_descriptor.hpp:596
void UnregisterDeviceOpenedCallback(DeviceOpenedCallbackHandle callbackHandle)
Unregisters a device opened callback.
Definition peak_device_descriptor.hpp:688
std::function< void(const std::shared_ptr< core::Device > &openedDevice)> DeviceOpenedCallback
Definition peak_device_descriptor.hpp:113
std::string VendorName() const
Returns the vendor name.
Definition peak_device_descriptor.hpp:589
void RemoveInformationRoleFromMonitoring(DeviceInformationRole informationRole)
Removes the given information role from the monitoring.
Definition peak_device_descriptor.hpp:725
DeviceAccessStatus AccessStatus() const
Returns the access status.
Definition peak_device_descriptor.hpp:633
InformationChangedCallback * InformationChangedCallbackHandle
Definition peak_device_descriptor.hpp:111
~DeviceDescriptor() override
Definition peak_device_descriptor.hpp:558
DeviceDescriptor & operator=(const DeviceDescriptor &other)=delete
std::shared_ptr< Device > OpenDevice(DeviceAccessType accessType)
Opens the Device.
Definition peak_device_descriptor.hpp:662
std::function< void(const std::vector< DeviceInformationRole > &changedRoles)> InformationChangedCallback
Definition peak_device_descriptor.hpp:109
bool IsOpenable(DeviceAccessType accessType=DeviceAccessType::Exclusive) const
Checks whether the device can be opened with a specific access type.
Definition peak_device_descriptor.hpp:654
void AddInformationRoleToMonitoring(DeviceInformationRole informationRole)
Adds the given information role to the monitoring.
Definition peak_device_descriptor.hpp:717
DeviceOpenedCallbackHandle RegisterDeviceOpenedCallback(const DeviceOpenedCallback &callback)
Registers a callback for signaling when the Device is opened with this DeviceDescriptor.
Definition peak_device_descriptor.hpp:682
InformationChangedCallbackHandle RegisterInformationChangedCallback(const InformationChangedCallback &callback)
Registers a callback for signaling changed information.
Definition peak_device_descriptor.hpp:733
std::string DisplayName() const
Returns the display name.
Definition peak_device_descriptor.hpp:581
std::shared_ptr< Interface > ParentInterface() const
Returns the parent interface.
Definition peak_device_descriptor.hpp:649
DeviceDescriptor(DeviceDescriptor &&other)=delete
void UnregisterInformationChangedCallback(InformationChangedCallbackHandle callbackHandle)
Unregisters an information changed callback.
Definition peak_device_descriptor.hpp:740
std::string TLType() const
Returns the TL (transport layer) type.
Definition peak_device_descriptor.hpp:610
std::string Version() const
Returns the version.
Definition peak_device_descriptor.hpp:603
void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
Sets the monitoring update interval.
Definition peak_device_descriptor.hpp:701
uint64_t MonitoringUpdateInterval() const
Returns the monitoring update interval.
Definition peak_device_descriptor.hpp:693
DeviceOpenedCallback * DeviceOpenedCallbackHandle
Definition peak_device_descriptor.hpp:115
std::shared_ptr< Device > OpenedDevice() const
Returns the Device that was opened with this DeviceDescriptor.
Definition peak_device_descriptor.hpp:677
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_device_descriptor.hpp:573
uint64_t TimestampTickFrequency() const
Returns the timestamp tick frequency.
Definition peak_device_descriptor.hpp:641
std::string SerialNumber() const
Returns the serial number.
Definition peak_device_descriptor.hpp:625
friend class FirmwareUpdater
Definition peak_device_descriptor.hpp:442
bool IsInformationRoleMonitored(DeviceInformationRole informationRole) const
Checks whether the given information role is monitored.
Definition peak_device_descriptor.hpp:709
std::string UserDefinedName() const
Returns the user defined name.
Definition peak_device_descriptor.hpp:617
DeviceDescriptor(const DeviceDescriptor &other)=delete
DeviceDescriptor & operator=(DeviceDescriptor &&other)=delete
The base class for all exceptions thrown by the library.
Definition peak_exception.hpp:28
virtual PEAK_MODULE_DESCRIPTOR_HANDLE ModuleDescriptorHandle() const =0
Implements versioning functionality.
Definition peak_version.hpp:35
@ Custom
Definition peak_buffer.hpp:56
DeviceAccessType
Different modes to open the device with.
Definition peak_device_descriptor.hpp:40
DeviceInformationRole
Different types of information about the device.
Definition peak_device_descriptor.hpp:55
DeviceAccessStatus
Current accessibility of the device.
Definition peak_common_device_enums.hpp:26
@ ReadOnly
Definition peak_device_descriptor.hpp:41
@ Exclusive
Definition peak_device_descriptor.hpp:43
@ Custom
Definition peak_device_descriptor.hpp:45
@ Control
Definition peak_device_descriptor.hpp:42
@ Version
Definition peak_device_descriptor.hpp:64
@ DisplayName
Definition peak_device_descriptor.hpp:60
@ TimestampTickFrequency
Definition peak_device_descriptor.hpp:65
@ ModelName
Definition peak_device_descriptor.hpp:58
@ AccessStatus
Definition peak_device_descriptor.hpp:61
@ TLType
Definition peak_device_descriptor.hpp:59
@ Custom
Definition peak_device_descriptor.hpp:67
@ SerialNumber
Definition peak_device_descriptor.hpp:63
@ ID
Definition peak_device_descriptor.hpp:56
@ VendorName
Definition peak_device_descriptor.hpp:57
@ UserDefinedName
Definition peak_device_descriptor.hpp:62
@ ReadOnly
Definition peak_common_device_enums.hpp:28
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
std::string ToString(BufferPayloadType entry)
Definition peak_buffer.hpp:612
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
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.
struct PEAK_MODULE_DESCRIPTOR * PEAK_MODULE_DESCRIPTOR_HANDLE
Definition peak_backend.h:417
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.
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.
PEAK_C_API PEAK_DeviceDescriptor_GetKey(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *key, size_t *keySize)
Asks the given device descriptor for its key.
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.
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.
PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK * PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE
Definition peak_backend.h:589
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.
PEAK_C_API PEAK_DeviceDescriptor_GetTimestampTickFrequency(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, uint64_t *timestampTickFrequency)
Asks the given device descriptor for its timestamp tick frequency.
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.
PEAK_C_API PEAK_DeviceDescriptor_GetVersion(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *version, size_t *versionSize)
Asks the given device descriptor for its version.
int8_t PEAK_BOOL8
Definition peak_backend.h:43
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_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_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.
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_GetVendorName(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, char *vendorName, size_t *vendorNameSize)
Asks the given device descriptor for its vendor name.
int32_t PEAK_DEVICE_INFORMATION_ROLE
Definition peak_backend.h:163
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.
int32_t PEAK_DEVICE_ACCESS_TYPE
Definition peak_backend.h:145
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.
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.
struct PEAK_DEVICE_DESCRIPTOR * PEAK_DEVICE_DESCRIPTOR_HANDLE
Definition peak_backend.h:385
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.
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_ToModuleDescriptor(PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, PEAK_MODULE_DESCRIPTOR_HANDLE *moduleDescriptorHandle)
Casts the given device descriptor to a module descriptor.
struct PEAK_DEVICE * PEAK_DEVICE_HANDLE
Definition peak_backend.h:389
int32_t PEAK_DEVICE_ACCESS_STATUS
Definition peak_backend.h:134
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:16
#define PEAK_CALL_CONV
Definition peak_dynamic_loader.h:30
The struct returned by all raw information functions.
Definition peak_common_structs.hpp:25