Go to the documentation of this file.
16 #ifndef SURGSIM_DEVICES_MULTIAXIS_WIN32_WDKHIDDEVICEHANDLE_H
17 #define SURGSIM_DEVICES_MULTIAXIS_WIN32_WDKHIDDEVICEHANDLE_H
58 static std::unique_ptr<WdkHidDeviceHandle>
open(
const std::string& path,
59 std::shared_ptr<SurgSim::Framework::Logger> logger);
63 bool getDeviceIds(
int* vendorId,
int* productId)
const override;
114 std::unique_ptr<State>
m_state;
120 #endif // SURGSIM_DEVICES_MULTIAXIS_WIN32_WDKHIDDEVICEHANDLE_H
static std::vector< std::string > enumeratePaths(SurgSim::Framework::Logger *logger)
Enumerates input devices.
Definition: WdkHidDeviceHandle.cpp:100
WdkHidDeviceHandle & operator=(const WdkHidDeviceHandle &other)
bool finishAsynchronousRead(size_t *numBytesRead)
Checks if an asynchronous read from the device has completed.
Definition: WdkHidDeviceHandle.cpp:350
~WdkHidDeviceHandle()
Destructor.
Definition: WdkHidDeviceHandle.cpp:96
bool hasTranslationAndRotationAxes() const override
Queries if this device has 3 translation and 3 rotation axes.
Definition: WdkHidDeviceHandle.cpp:284
Definition: CompoundShapeToGraphics.cpp:29
Access to an input/HID device using the HID API from the Windows Driver Kit.
Definition: WdkHidDeviceHandle.h:43
bool getDeviceIds(int *vendorId, int *productId) const override
Gets the device identifiers.
Definition: WdkHidDeviceHandle.cpp:242
WdkHidDeviceHandle(std::shared_ptr< SurgSim::Framework::Logger > &&logger)
Constructor.
Definition: WdkHidDeviceHandle.cpp:91
static std::unique_ptr< WdkHidDeviceHandle > open(const std::string &path, std::shared_ptr< SurgSim::Framework::Logger > logger)
Opens the given path and creates an access wrapper for the device.
Definition: WdkHidDeviceHandle.cpp:184
Definition: WdkHidDeviceHandle.cpp:61
bool startAsynchronousRead()
Starts an asynchronous read from the device.
Definition: WdkHidDeviceHandle.cpp:315
void cancelAsynchronousRead()
Cancels an asynchronous read from the device.
Definition: WdkHidDeviceHandle.cpp:385
std::string getDeviceName() const override
Gets the name returned by the operating system for this device.
Definition: WdkHidDeviceHandle.cpp:212
void prepareForShutdown() override
Prepares the handle for sampling thread shutdown.
Definition: WdkHidDeviceHandle.cpp:496
std::unique_ptr< State > m_state
Definition: WdkHidDeviceHandle.h:113
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool getCapabilities(struct _HIDP_CAPS *capabilities) const
Gets the device capabilities.
Definition: WdkHidDeviceHandle.cpp:260
bool updateStates(AxisStates *axisStates, ButtonStates *buttonStates, bool *updated) override
Updates the axis and states from the device input, if any.
Definition: WdkHidDeviceHandle.cpp:429
An object that can be used to control logging parameters, such as verbosity and log output destinatio...
Definition: Logger.h:51
void decodeStateUpdates(const unsigned char *rawData, size_t rawDataSize, AxisStates *axisStates, ButtonStates *buttonStates, bool *updated)
Decode the raw state update data received from the device.
Definition: WdkHidDeviceHandle.cpp:513