Tilt Five NDK  1.4.1
tiltfive::WandStreamHelper Class Reference

Utility class to manage the wand stream. More...

#include <TiltFiveNative.hpp>

Inheritance diagram for tiltfive::WandStreamHelper:
Collaboration diagram for tiltfive::WandStreamHelper:

Public Member Functions

auto consumeLastAsyncError () -> std::error_code
 Obtain and consume the last asynchronous error. More...
 
auto listWands () -> Result< std::vector< std::shared_ptr< Wand > > >
 Obtain a list of tiltfive::Wand. More...
 
auto sendImpulse (const T5_WandHandle &handle, float amplitude, uint16_t duration) -> Result< void >
 Send a haptic impulse to a specific tiltfive::Wand. More...
 

Detailed Description

Utility class to manage the wand stream.

De-multiplexes the wand stream into abstract tiltfive::Wand objects that can be independently queried for their last known state.

See Using WandStreamHelper for usage.

Definition at line 938 of file TiltFiveNative.hpp.

Member Function Documentation

◆ consumeLastAsyncError()

auto tiltfive::WandStreamHelper::consumeLastAsyncError ( ) -> std::error_code
inline

Obtain and consume the last asynchronous error.

The connection process may produce errors asynchronously which can be detected by calling this.

Returns
The last known error or a default std::error_code if no error was present

Definition at line 1093 of file TiltFiveNative.hpp.

◆ listWands()

auto tiltfive::WandStreamHelper::listWands ( ) -> Result<std::vector<std::shared_ptr<Wand>>>
inline

Obtain a list of tiltfive::Wand.

The tiltfive::WandStreamHelper maintains a stream reader thread while there are any outstanding references to the returned tiltfive::Wand objects, automatically terminating the stream when they go out of scope.

Definition at line 1104 of file TiltFiveNative.hpp.

◆ sendImpulse()

auto tiltfive::WandStreamHelper::sendImpulse ( const T5_WandHandle handle,
float  amplitude,
uint16_t  duration 
) -> Result<void>
inline

Send a haptic impulse to a specific tiltfive::Wand.

Parameters
[in]handle- The handle of the desired tiltfive::Wand to receive the impulse.
[in]amplitude- The amplitude of the impulse, between (0.0 and 1.0].
[in]duration- The duration, in ms, of the impulse. Must be between 1 and 320ms.

Definition at line 1138 of file TiltFiveNative.hpp.


The documentation for this class was generated from the following file: