Files
Plugin/Source/SenseGloveCoreKismet/Public/SGCoreKismet/SGBetaDeviceKismetLibrary.h
T

123 lines
4.4 KiB
C++

/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2022 SenseGlove
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
* Represents a Sense Glove Device that has no specific class within the API.
* Used to test different iterations of the same product before integrating it
* into the Core API.
* Allows access to raw sensor values and commands of such a device.
*/
#pragma once
#include "SGKismet/SGBlueprintFunctionLibrary.h"
#include "SGTypes/SGCoreTypes.h"
#include "SGBetaDeviceKismetLibrary.generated.h"
class USGBetaDevice;
/**
* A Device that adheres to the SenseGlove communications protocol, but which has no implementation in this API.
*/
UCLASS(meta=(ScriptName = "SesneGloveBetaDeviceKismetLibrary"))
class SENSEGLOVECOREKISMET_API USGBetaDeviceKismetLibrary final : public USGBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/**
* Deserialize a beta device from its basic constants string. Returns nullptr is unsuccessful.
*/
UFUNCTION(BlueprintCallable, Category="SenseGlove | Core | Beta Device", meta=(WorldContext="WorldContextObject"))
static USGBetaDevice* Parse(UObject* WorldContextObject, const FString& String);
/**
* Get the DeviceType enumerator of this SenseGlove, used in DeviceList enumeration.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static ESGDeviceType GetDeviceType(const USGBetaDevice* BetaDevice);
/**
* Get the unique identifier of this device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString GetDeviceId(const USGBetaDevice* BetaDevice);
/**
* Retrieve this device's hardware version.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString GetHardwareVersion(const USGBetaDevice* BetaDevice);
/**
* Retrieve this device's firmware version.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static int32 GetFirmwareVersion(const USGBetaDevice* BetaDevice);
/**
* Retrieve this device's sub-firmware version.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static int32 GetSubFirmwareVersion(const USGBetaDevice* BetaDevice);
/**
* Retrieve the constants string for additional processing.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString GetConstantsString(const USGBetaDevice* BetaDevice);
/**
* Retrieve a raw sensor string from this Beta Device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString GetSensorData(const USGBetaDevice* BetaDevice);
/**
* Retrieve the last command retrieved from this Beta Device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString GetLastCommand(const USGBetaDevice* BetaDevice);
/**
* Send a raw string command to this device.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static bool SendHaptics(const USGBetaDevice* BetaDevice, const FString& Command);
/**
* Create a string representation of this device for reporting purposes.
*/
UFUNCTION(BlueprintPure, Category="SenseGlove | Core | Beta Device")
static FString ToString(const USGBetaDevice* BetaDevice);
};