Skip to main content

USkineticDevice

Inherits from UDataAsset

Public Functions

Name
ESkineticErrorScanDevices()
intScanStatus(ESkineticError & Error)
TArray< FDeviceInfo >GetScannedDevices()
ESkineticErrorConnect()
ESkineticErrorConnectToSpecificDevice(int64 SerialNumber)
ESkineticErrorDisconnect()
EConnectionStatusConnectionStatus()
FStringGetSDKVersion()
FStringGetDeviceVersion()
int64GetDeviceSerialNumber(ESkineticError & Error)
ESkineticTypeGetDeviceType()
intGetGlobalIntensityBoost(ESkineticError & Error)
ESkineticErrorSetGlobalIntensityBoost(int BoostPercent)
EEffectStateEffectState(int EffectID)
ESkineticErrorStopAll()
ESkineticErrorPauseAll()
ESkineticErrorResumeAll()
voidSetPreferredOutput(EOutputType NewOutputType)
TArray< FString >GetDeviceNamesOptions() const
TArray< FString >GetOutputAPIOptions() const
TArray< FString >GetSamplingRateOptions() const
intGetMaxChannels() const
floatGetDefaultLowLatency() const
floatGetDefaultHighLatency() const
voidFetchOutputDevicesList()
voidFetchAPIList()
voidFetchSamplingRateList()
voidFetchOutputDevicesInfo()
FStringConvertSerialNumberToString(int64 SerialNumber)
TSoftObjectPtr< USkineticDevice >GetDefaultDevice()

Public Attributes

Name
EConnectionTypeConnectionType
FOnConnectionStatusChangedOnConnectionStatusChangedCallback
EOutputTypeOutputType
EAudioPresetAudioPreset
FStringDeviceName
FStringAudioAPI
FStringSampleRate
intBufferSize
intNbStreamChannels
floatSuggestedLatency

Public Functions Documentation

function ScanDevices

ESkineticError ScanDevices()

Return: Error code.

Initialize a scanning routine to find all available Skinetic device with the connection type specified in the asset. ScanStatus() return the status of the scan, and the result can be accessed using GetScannedDevices().

function ScanStatus

int ScanStatus(
ESkineticError & Error
)

Parameters:

  • Error contains the corresponding error in case of failure.

Return: the current status or -1 on failure.

Check the status of the asynchronous scanning routine. The method returns:

  • 1 if the scan is ongoing.
  • 0 if the scan is completed.
  • -1 if the connection failed. The asynchronous scan routine is terminated on failure. Once the scan is completed, the result can be obtain by calling GetScannedDevices().

function GetScannedDevices

TArray< FDeviceInfo > GetScannedDevices()

Return: a list of DeviceInfo, empty if no match or an error occurs.

This function returns a list of all FDeviceInfo of each Skinetic devices found during the scan which match the specified output type.

function Connect

ESkineticError Connect()

Return: NoError on success, corresponding Error code otherwise.

Initialize connection to the first found Skinetic Device using the selected type of connection. Connection status is available using ConnectionStatus() or the corresponding callback function.

function ConnectToSpecificDevice

ESkineticError ConnectToSpecificDevice(
int64 SerialNumber
)

Parameters:

  • SerialNumber Serial number of the device to connect to. If set to 0, the connection will be performed on the first found device.

Return: NoError on success, corresponding Error code otherwise.

Initialize connection to a Skinetic Device using the selected type of connection and the Serial Number specified. Connection status is available using ConnectionStatus() or the corresponding callback function.

function Disconnect

ESkineticError Disconnect()

Return: NoError on success, corresponding Error code otherwise.

Disconnect the current Skinetic device.

function ConnectionStatus

EConnectionStatus ConnectionStatus()

Return: the current status of connection

Check the status of the asynchronous connection routine. The asynchronous connection routine is terminated on failure.

function GetSDKVersion

FString GetSDKVersion()

Return: the version string.

Get SDK version as a string. The format of the string is: major.minor.revision

function GetDeviceVersion

FString GetDeviceVersion()

Return: the version string if Skinetic is connected, an ERROR message otherwise.

Get the connected device's version as a string. The format of the string is: major.minor.revision

function GetDeviceSerialNumber

int64 GetDeviceSerialNumber(
ESkineticError & Error
)

Parameters:

  • Error contains the corresponding error in case of failure.

Return: the serial number if a Skinetic device is connected, -1 otherwise.

Get the connected device's serial number.

function GetDeviceType

ESkineticType GetDeviceType()

Return: the type of the connected Skinetic device if it is connected, Unknown otherwise.

Get the connected device's type.

function GetGlobalIntensityBoost

int GetGlobalIntensityBoost(
ESkineticError & Error
)

Parameters:

  • Error contains the corresponding error in case of failure.

Return: the percentage of effect's intensity boost, an ERROR otherwise.

Get the amount of effect's intensity boost. The boost increase the overall intensity of all haptic effects. However, the higher the boost activation is, the more the haptic effects are degraded.

function SetGlobalIntensityBoost

ESkineticError SetGlobalIntensityBoost(
int BoostPercent
)

Parameters:

  • BoostPercent percentage of the boost.

Return: NoError on success, corresponding Error code otherwise.

Set the amount of effect's intensity boost. The boost increase the overall intensity of all haptic effects. However, the higher the boost activation is, the more the haptic effects are degraded.

function EffectState

EEffectState EffectState(
int EffectID
)

Parameters:

  • EffectID index identifying the effect.

Return: the current state of the effect.

Get the current state of an effect. If the EffectID is invalid, the 'stop' state will be return.

function StopAll

ESkineticError StopAll()

Return: NoError on success, an ERROR otherwise.

Stop all playing haptic effect.

function PauseAll

ESkineticError PauseAll()

Return: NoError on success, an ERROR otherwise.

Pause all haptic effect that are currently playing.

function ResumeAll

ESkineticError ResumeAll()

Return: 0 on success, an ERROR otherwise.

Resume the paused haptic effects.

function SetPreferredOutput

void SetPreferredOutput(
EOutputType NewOutputType
)

Parameters:

  • NewOutputType method of connection to use

Set the preferred output type on the current device.

function GetDeviceNamesOptions

inline TArray< FString > GetDeviceNamesOptions() const

Return: locally stored list of available audio devices

[EXPERIMENTAL] Audio device name list accessor

function GetOutputAPIOptions

inline TArray< FString > GetOutputAPIOptions() const

Return: locally stored list of available audio API

[EXPERIMENTAL] Audio API list accessor

function GetSamplingRateOptions

inline TArray< FString > GetSamplingRateOptions() const

Return: locally stored list of available sampling rates

[EXPERIMENTAL] Sampling rates list accessor

function GetMaxChannels

inline int GetMaxChannels() const

Return: locally stored max channels value

[EXPERIMENTAL] Max Channels accessor

function GetDefaultLowLatency

inline float GetDefaultLowLatency() const

Return: locally stored default Low latency bound

[EXPERIMENTAL] Default Low latency bound accessor

function GetDefaultHighLatency

inline float GetDefaultHighLatency() const

Return: locally stored default high latency bound

[EXPERIMENTAL] Default High latency bound accessor

function FetchOutputDevicesList

void FetchOutputDevicesList()

[EXPERIMENTAL] Store the list of available audio devices as a local variable.

function FetchAPIList

void FetchAPIList()

[EXPERIMENTAL] Store the list of available audio API for the selected device name as a local variable.

function FetchSamplingRateList

void FetchSamplingRateList()

[EXPERIMENTAL] Store the list of available Sampling Rate for the selected device name and API as a local variable.

function FetchOutputDevicesInfo

void FetchOutputDevicesInfo()

[EXPERIMENTAL] Store MaxChannels, DefaultLowLatency and DefaultHighLatency for the selected device name and API as local variables.

function ConvertSerialNumberToString

static FString ConvertSerialNumberToString(
int64 SerialNumber
)

Parameters:

  • SerialNumber Serial number to convert.

Return: the serial number as a formatted string

Converts Skinetic serial number to a formatted string.

function GetDefaultDevice

static TSoftObjectPtr< USkineticDevice > GetDefaultDevice()

Return: pointer to the default Skinetic Device asset or null if not found.

Return the Skinetic Device set as default in Project > Skinetic settings.

Public Attributes Documentation

variable ConnectionType

EConnectionType ConnectionType;

Preferred connection method to use for the current device.

variable OnConnectionStatusChangedCallback

FOnConnectionStatusChanged OnConnectionStatusChangedCallback;

Callback to assign to automatically trigger an event when the connection status changed.

variable OutputType

EOutputType OutputType;

Type of output

variable AudioPreset

EAudioPreset AudioPreset;

[EXPERIMENTAL] Selected preset of audio device.

variable DeviceName

FString DeviceName;

[EXPERIMENTAL] Name of the targeted audio device. Parameter ignored when using a AudioPreset other than AudioDevice

variable AudioAPI

FString AudioAPI;

[EXPERIMENTAL] Name of the targeted API. Parameter ignored when using a AudioPreset other than AudioDevice Default value "any_API" uses any available API which match the configuration, if any.

variable SampleRate

FString SampleRate;

[EXPERIMENTAL] Sample rate of the audio stream. Parameter ignored when using a AudioPreset other than AudioDevice

variable BufferSize

int BufferSize;

[EXPERIMENTAL] Size of a chunk of data sent over the audio stream.

variable NbStreamChannels

int NbStreamChannels;

[EXPERIMENTAL] Number of channels to use while streaming to the haptic output. Parameter ignored when using a AudioPreset other than AudioDevice

Setting -1 will use the number of actuator of the layout, or a portion of it.

variable SuggestedLatency

float SuggestedLatency;

[EXPERIMENTAL] Desired latency in seconds. The value is rounded to the closest available latency value from the audio API. Parameter ignored when using a AudioPreset other than AudioDevice


Updated on 2023-12-21 at 15:25:56 +0000