IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak_device_descriptor.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10
16#include <peak/dll_interface/peak_dll_interface_util.hpp>
17#include <peak/generic/peak_t_callback_manager.hpp>
18
19#include <cstddef>
20#include <cstdint>
21#include <memory>
22#include <string>
23
24
25namespace peak
26{
27namespace core
28{
29
37{
41
42 Custom = 1000
43};
44
66
67class Interface;
68
103{
104public:
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
115 ~DeviceDescriptor() override;
116 DeviceDescriptor(const DeviceDescriptor& other) = delete;
120
122 PEAK_COMMON_NO_DISCARD std::string Key() const;
123
125 PEAK_COMMON_NO_DISCARD RawInformation Info(int32_t infoCommand) const;
126
137 PEAK_COMMON_NO_DISCARD std::string DisplayName() const;
138
149 PEAK_COMMON_NO_DISCARD std::string VendorName() const;
150
161 PEAK_COMMON_NO_DISCARD std::string ModelName() const;
162
173 PEAK_COMMON_NO_DISCARD std::string Version() const;
174
176 PEAK_COMMON_NO_DISCARD std::string TLType() const;
177
188 PEAK_COMMON_NO_DISCARD std::string UserDefinedName() const;
189
200 PEAK_COMMON_NO_DISCARD std::string SerialNumber() const;
201
213
225
236 PEAK_COMMON_NO_DISCARD std::shared_ptr<Interface> ParentInterface() const;
237
243
265
279 PEAK_COMMON_NO_DISCARD std::shared_ptr<Device> OpenDevice(DeviceAccessType accessType);
280
290 PEAK_COMMON_NO_DISCARD std::shared_ptr<Device> OpenedDevice() const;
291
299 PEAK_COMMON_NO_DISCARD bool IsOpened() const;
300
316 const DeviceOpenedCallback& callback);
317
330
332
338
348
358 void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms);
359
373
384
395
411 const InformationChangedCallback& callback);
412
425
427
428private:
429 static void PEAK_CALL_CONV InformationChangedCallbackCWrapper(
430 const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context);
431
432 friend ClassCreator<DeviceDescriptor>;
434 PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface);
436
437 PEAK_DEVICE_DESCRIPTOR_HANDLE m_backendHandle;
438
439 std::weak_ptr<Interface> m_parentInterface;
440 std::weak_ptr<Device> m_openedDevice;
441
442 std::unique_ptr<
443 TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>
444 m_informationChangedCallbackManager;
445
446 TTriggerCallbackManager<DeviceOpenedCallbackHandle, DeviceOpenedCallback> m_deviceOpenedCallbackManager;
447
448 std::string m_key;
449
450 friend class FirmwareUpdater;
451};
452
453} /* namespace core */
454} /* namespace peak */
455
456/* Implementation */
457namespace peak
458{
459namespace core
460{
461
462inline std::string ToString(DeviceAccessType entry)
463{
464 std::string entryString;
465
466 if (entry == DeviceAccessType::ReadOnly)
467 {
468 entryString = "ReadOnly";
469 }
470 else if (entry == DeviceAccessType::Control)
471 {
472 entryString = "Control";
473 }
474 else if (entry == DeviceAccessType::Exclusive)
475 {
476 entryString = "Exclusive";
477 }
478 else if (entry >= DeviceAccessType::Custom)
479 {
480 entryString = "Custom";
481 }
482
483 return entryString;
484}
485
486inline std::string ToString(DeviceInformationRole entry)
487{
488 std::string entryString;
489
490 if (entry == DeviceInformationRole::ID)
491 {
492 entryString = "ID";
493 }
494 else if (entry == DeviceInformationRole::VendorName)
495 {
496 entryString = "VendorName";
497 }
498 else if (entry == DeviceInformationRole::ModelName)
499 {
500 entryString = "ModelName";
501 }
502 else if (entry == DeviceInformationRole::TLType)
503 {
504 entryString = "TLType";
505 }
506 else if (entry == DeviceInformationRole::DisplayName)
507 {
508 entryString = "DisplayName";
509 }
510 else if (entry == DeviceInformationRole::AccessStatus)
511 {
512 entryString = "AccessStatus";
513 }
515 {
516 entryString = "UserDefinedName";
517 }
518 else if (entry == DeviceInformationRole::SerialNumber)
519 {
520 entryString = "SerialNumber";
521 }
522 else if (entry == DeviceInformationRole::Version)
523 {
524 entryString = "Version";
525 }
527 {
528 entryString = "TimestampTickFrequency";
529 }
530 else if (entry >= DeviceInformationRole::Custom)
531 {
532 entryString = "Custom";
533 }
534
535 return entryString;
536}
537
539 PEAK_DEVICE_DESCRIPTOR_HANDLE deviceDescriptorHandle, const std::weak_ptr<Interface>& parentInterface)
540 : m_backendHandle(deviceDescriptorHandle)
541 , m_parentInterface(parentInterface)
542 , m_informationChangedCallbackManager()
543 , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
544 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetKey(deviceDescriptorHandle, key, keySize);
545 }))
546{
547 m_informationChangedCallbackManager = std::make_unique<
548 TCallbackManager<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE, InformationChangedCallback>>(
549 [&](void* callbackContext) {
550 return QueryNumericFromCInterfaceFunction<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(
552 deviceDescriptorChangedCallbackHandle) {
554 m_backendHandle, InformationChangedCallbackCWrapper, callbackContext,
555 deviceDescriptorChangedCallbackHandle);
556 });
557 },
559 CallAndCheckCInterfaceFunction([&] {
561 m_backendHandle, callbackHandle);
562 });
563 });
564}
565
567{
568 try
569 {
570 m_informationChangedCallbackManager->UnregisterAllCallbacks();
571 }
572 catch (const Exception&)
573 {}
574}
575
576inline std::string DeviceDescriptor::Key() const
577{
578 return m_key;
579}
580
581inline RawInformation DeviceDescriptor::Info(int32_t infoCommand) const
582{
583 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
585 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
586 });
587}
588
589inline std::string DeviceDescriptor::DisplayName() const
590{
591 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* displayName, size_t* displayNameSize) {
593 m_backendHandle, displayName, displayNameSize);
594 });
595}
596
597inline std::string DeviceDescriptor::VendorName() const
598{
599 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* vendorName, size_t* vendorNameSize) {
600 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVendorName(m_backendHandle, vendorName, vendorNameSize);
601 });
602}
603
604inline std::string DeviceDescriptor::ModelName() const
605{
606 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* modelName, size_t* modelNameSize) {
607 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetModelName(m_backendHandle, modelName, modelNameSize);
608 });
609}
610
611inline std::string DeviceDescriptor::Version() const
612{
613 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* version, size_t* versionSize) {
614 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetVersion(m_backendHandle, version, versionSize);
615 });
616}
617
618inline std::string DeviceDescriptor::TLType() const
619{
620 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* tlType, size_t* tlTypeSize) {
621 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetTLType(m_backendHandle, tlType, tlTypeSize);
622 });
623}
624
625inline std::string DeviceDescriptor::UserDefinedName() const
626{
627 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* userDefinedName, size_t* userDefinedNameSize) {
629 m_backendHandle, userDefinedName, userDefinedNameSize);
630 });
631}
632
633inline std::string DeviceDescriptor::SerialNumber() const
634{
635 return QueryStringFromCInterfaceFunctionWithBufferSize([&](char* serialNumber, size_t* serialNumberSize) {
637 m_backendHandle, serialNumber, serialNumberSize);
638 });
639}
640
642{
643 return static_cast<DeviceAccessStatus>(QueryNumericFromCInterfaceFunction<PEAK_DEVICE_ACCESS_STATUS>(
644 [&](PEAK_DEVICE_ACCESS_STATUS* accessStatus) {
645 return PEAK_C_ABI_PREFIX PEAK_DeviceDescriptor_GetAccessStatus(m_backendHandle, accessStatus);
646 }));
647}
648
650{
651 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* timestampTickFrequency) {
653 m_backendHandle, timestampTickFrequency);
654 });
655}
656
657inline std::shared_ptr<Interface> DeviceDescriptor::ParentInterface() const
658{
659 return LockOrThrow(m_parentInterface);
660}
661
663{
664 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isAccessTypeAvailable) {
666 m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), isAccessTypeAvailable);
667 }) > 0;
668}
669
670inline std::shared_ptr<Device> DeviceDescriptor::OpenDevice(DeviceAccessType accessType)
671{
672 auto deviceHandle = QueryNumericFromCInterfaceFunction<PEAK_DEVICE_HANDLE>(
673 [&](PEAK_DEVICE_HANDLE* _deviceHandle) {
675 m_backendHandle, static_cast<PEAK_DEVICE_ACCESS_TYPE>(accessType), _deviceHandle);
676 });
677
678 auto device = std::make_shared<ClassCreator<Device>>(deviceHandle, m_parentInterface);
679 m_openedDevice = device;
680 m_deviceOpenedCallbackManager.TriggerCallbacks(device);
681
682 return device;
683}
684
685inline std::shared_ptr<Device> DeviceDescriptor::OpenedDevice() const
686{
687 return LockOrThrowOpenedModule(m_openedDevice);
688}
689
690inline bool DeviceDescriptor::IsOpened() const
691{
692 return !m_openedDevice.expired();
693}
694
696 const DeviceOpenedCallback& callback)
697{
698 return m_deviceOpenedCallbackManager.RegisterCallback(callback);
699}
700
702{
703 return m_deviceOpenedCallbackManager.UnregisterCallback(callback);
704}
705
707{
708 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* monitoringUpdateInterval_ms) {
710 m_backendHandle, monitoringUpdateInterval_ms);
711 });
712}
713
714inline void DeviceDescriptor::SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
715{
716 return CallAndCheckCInterfaceFunction([&] {
718 m_backendHandle, monitoringUpdateInterval_ms);
719 });
720}
721
723{
724 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isInformationRoleMonitored) {
726 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole), isInformationRoleMonitored);
727 }) > 0;
728}
729
731{
732 return CallAndCheckCInterfaceFunction([&] {
734 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
735 });
736}
737
739{
740 return CallAndCheckCInterfaceFunction([&] {
742 m_backendHandle, static_cast<PEAK_DEVICE_INFORMATION_ROLE>(informationRole));
743 });
744}
745
748{
749 return reinterpret_cast<InformationChangedCallbackHandle>(
750 m_informationChangedCallbackManager->RegisterCallback(callback));
751}
752
754{
755 m_informationChangedCallbackManager->UnregisterCallback(
756 reinterpret_cast<PEAK_DEVICE_DESCRIPTOR_INFORMATION_CHANGED_CALLBACK_HANDLE>(callbackHandle));
757}
758
759inline void PEAK_CALL_CONV DeviceDescriptor::InformationChangedCallbackCWrapper(
760 const PEAK_DEVICE_INFORMATION_ROLE* changedRoles, size_t changedRolesSize, void* context)
761{
762 auto callback = static_cast<DeviceDescriptor::InformationChangedCallback*>(context);
763 std::vector<DeviceInformationRole> changedRolesVec;
764 changedRolesVec.reserve(changedRolesSize);
765 for (size_t i = 0; i < changedRolesSize; ++i)
766 {
767 changedRolesVec.emplace_back(static_cast<DeviceInformationRole>(*(changedRoles + i)));
768 }
769 callback->operator()(changedRolesVec);
770}
771
772inline PEAK_MODULE_DESCRIPTOR_HANDLE DeviceDescriptor::ModuleDescriptorHandle() const
773{
774 auto moduleDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_DESCRIPTOR_HANDLE>(
775 [&](PEAK_MODULE_DESCRIPTOR_HANDLE* _moduleDescriptorHandle) {
777 m_backendHandle, _moduleDescriptorHandle);
778 });
779
780 return moduleDescriptorHandle;
781}
782
783} /* namespace core */
784} /* namespace peak */
PEAK_COMMON_NO_DISCARD std::string Key() const
Returns the unique key.
Definition peak_device_descriptor.hpp:576
PEAK_COMMON_NO_DISCARD std::string ModelName() const
Returns the model name.
Definition peak_device_descriptor.hpp:604
void UnregisterDeviceOpenedCallback(DeviceOpenedCallbackHandle callbackHandle)
Unregisters a device opened callback.
Definition peak_device_descriptor.hpp:701
std::function< void(const std::shared_ptr< core::Device > &openedDevice)> DeviceOpenedCallback
Definition peak_device_descriptor.hpp:110
PEAK_COMMON_NO_DISCARD std::string VendorName() const
Returns the vendor name.
Definition peak_device_descriptor.hpp:597
void RemoveInformationRoleFromMonitoring(DeviceInformationRole informationRole)
Removes the given information role from the monitoring.
Definition peak_device_descriptor.hpp:738
PEAK_COMMON_NO_DISCARD DeviceAccessStatus AccessStatus() const
Returns the access status.
Definition peak_device_descriptor.hpp:641
InformationChangedCallback * InformationChangedCallbackHandle
Definition peak_device_descriptor.hpp:108
~DeviceDescriptor() override
Definition peak_device_descriptor.hpp:566
DeviceDescriptor & operator=(const DeviceDescriptor &other)=delete
PEAK_COMMON_NO_DISCARD std::shared_ptr< Device > OpenDevice(DeviceAccessType accessType)
Opens the Device.
Definition peak_device_descriptor.hpp:670
std::function< void(const std::vector< DeviceInformationRole > &changedRoles)> InformationChangedCallback
Definition peak_device_descriptor.hpp:106
PEAK_COMMON_NO_DISCARD bool IsOpenable(DeviceAccessType accessType=DeviceAccessType::Exclusive) const
Checks whether the device can be opened with a specific access type.
Definition peak_device_descriptor.hpp:662
void AddInformationRoleToMonitoring(DeviceInformationRole informationRole)
Adds the given information role to the monitoring.
Definition peak_device_descriptor.hpp:730
DeviceOpenedCallbackHandle RegisterDeviceOpenedCallback(const DeviceOpenedCallback &callback)
Registers a callback for signaling when the Device is opened with this DeviceDescriptor.
Definition peak_device_descriptor.hpp:695
InformationChangedCallbackHandle RegisterInformationChangedCallback(const InformationChangedCallback &callback)
Registers a callback for signaling changed information.
Definition peak_device_descriptor.hpp:746
PEAK_COMMON_NO_DISCARD std::string DisplayName() const
Returns the display name.
Definition peak_device_descriptor.hpp:589
PEAK_COMMON_NO_DISCARD std::shared_ptr< Interface > ParentInterface() const
Returns the parent interface.
Definition peak_device_descriptor.hpp:657
DeviceDescriptor(DeviceDescriptor &&other)=delete
void UnregisterInformationChangedCallback(InformationChangedCallbackHandle callbackHandle)
Unregisters an information changed callback.
Definition peak_device_descriptor.hpp:753
PEAK_COMMON_NO_DISCARD std::string TLType() const
Returns the TL (transport layer) type.
Definition peak_device_descriptor.hpp:618
PEAK_COMMON_NO_DISCARD std::string Version() const
Returns the version.
Definition peak_device_descriptor.hpp:611
PEAK_COMMON_NO_DISCARD bool IsOpened() const
Returns whether the device is open.
Definition peak_device_descriptor.hpp:690
void SetMonitoringUpdateInterval(uint64_t monitoringUpdateInterval_ms)
Sets the monitoring update interval.
Definition peak_device_descriptor.hpp:714
PEAK_COMMON_NO_DISCARD uint64_t MonitoringUpdateInterval() const
Returns the monitoring update interval.
Definition peak_device_descriptor.hpp:706
DeviceOpenedCallback * DeviceOpenedCallbackHandle
Definition peak_device_descriptor.hpp:112
PEAK_COMMON_NO_DISCARD std::shared_ptr< Device > OpenedDevice() const
Returns the Device that was opened with this DeviceDescriptor.
Definition peak_device_descriptor.hpp:685
PEAK_COMMON_NO_DISCARD RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_device_descriptor.hpp:581
PEAK_COMMON_NO_DISCARD uint64_t TimestampTickFrequency() const
Returns the timestamp tick frequency.
Definition peak_device_descriptor.hpp:649
PEAK_COMMON_NO_DISCARD std::string SerialNumber() const
Returns the serial number.
Definition peak_device_descriptor.hpp:633
friend class FirmwareUpdater
Definition peak_device_descriptor.hpp:450
PEAK_COMMON_NO_DISCARD bool IsInformationRoleMonitored(DeviceInformationRole informationRole) const
Checks whether the given information role is monitored.
Definition peak_device_descriptor.hpp:722
PEAK_COMMON_NO_DISCARD std::string UserDefinedName() const
Returns the user defined name.
Definition peak_device_descriptor.hpp:625
DeviceDescriptor(const DeviceDescriptor &other)=delete
DeviceDescriptor & operator=(DeviceDescriptor &&other)=delete
The base class for all exceptions thrown by the library.
Definition peak_exception.hpp:24
virtual PEAK_MODULE_DESCRIPTOR_HANDLE ModuleDescriptorHandle() const =0
Implements versioning functionality.
Definition peak_version.hpp:33
@ Custom
Definition peak_buffer.hpp:54
DeviceAccessType
Different modes to open the device with.
Definition peak_device_descriptor.hpp:37
DeviceInformationRole
Different types of information about the device.
Definition peak_device_descriptor.hpp:52
DeviceAccessStatus
Current accessibility of the device.
Definition peak_common_device_enums.hpp:23
@ ReadOnly
Definition peak_device_descriptor.hpp:38
@ Exclusive
Definition peak_device_descriptor.hpp:40
@ Custom
Definition peak_device_descriptor.hpp:42
@ Control
Definition peak_device_descriptor.hpp:39
@ Version
Definition peak_device_descriptor.hpp:61
@ DisplayName
Definition peak_device_descriptor.hpp:57
@ TimestampTickFrequency
Definition peak_device_descriptor.hpp:62
@ ModelName
Definition peak_device_descriptor.hpp:55
@ AccessStatus
Definition peak_device_descriptor.hpp:58
@ TLType
Definition peak_device_descriptor.hpp:56
@ Custom
Definition peak_device_descriptor.hpp:64
@ SerialNumber
Definition peak_device_descriptor.hpp:60
@ ID
Definition peak_device_descriptor.hpp:53
@ VendorName
Definition peak_device_descriptor.hpp:54
@ UserDefinedName
Definition peak_device_descriptor.hpp:59
@ ReadOnly
Definition peak_common_device_enums.hpp:25
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:32
std::string ToString(BufferPayloadType entry)
Definition peak_buffer.hpp:635
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
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:415
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:587
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:41
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:161
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:143
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:383
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:387
int32_t PEAK_DEVICE_ACCESS_STATUS
Definition peak_backend.h:132
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:13
The struct returned by all raw information functions.
Definition peak_common_structs.hpp:21