try to offload android to sgcore/sgconnect third-party libraries and drop linux third-party libraries for earlier versions of the engine prior to 4.27

This commit is contained in:
Mamadou Babaei
2023-02-03 13:43:40 +01:00
parent 16df85607d
commit f9dbc1f11e
108 changed files with 422 additions and 393 deletions
@@ -1,215 +0,0 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "SGAndroid/SGConnectJNI.h"
#if PLATFORM_ANDROID
#include "Android/AndroidApplication.h"
#include "Android/AndroidJava.h"
#endif /* PLATFORM_ANDROID */
static constexpr char SGCONNECT_JAVA_CLASS_NAME[] = "com.senseglove.sgconnect.SGConnect";
int32 FSGConnectJNI::Init()
{
int32 Result = -999;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "Init", "()I");
if (Method)
{
Result = Env->CallStaticIntMethod(Class, Method);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
int32 FSGConnectJNI::Dispose()
{
int32 Result = -999;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "Dispose", "()I");
if (Method)
{
Result = Env->CallStaticIntMethod(Class, Method);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
FString FSGConnectJNI::GetLibraryVersion()
{
FString Result;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "GetLibraryVersion", "()Ljava/lang/String;");
if (Method)
{
jstring ResultJString = (jstring)Env->CallStaticObjectMethod(Class, Method);
const char* ResultChars = Env->GetStringUTFChars(ResultJString, nullptr);
Result = FString(UTF8_TO_TCHAR(ResultChars));
Env->ReleaseStringUTFChars(ResultJString, ResultChars);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
int32 FSGConnectJNI::ActiveDevices()
{
int32 Result = -999;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "ActiveDevices", "()I");
if (Method)
{
Result = Env->CallStaticIntMethod(Class, Method);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
FString FSGConnectJNI::GetDeviceString(const int32 DeviceAddress)
{
FString Result;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "GetDeviceString", "(I)Ljava/lang/String;");
if (Method)
{
jstring ResultJString = (jstring)Env->CallStaticObjectMethod(Class, Method, DeviceAddress);
const char* ResultChars = Env->GetStringUTFChars(ResultJString, nullptr);
Result = FString(UTF8_TO_TCHAR(ResultChars));
Env->ReleaseStringUTFChars(ResultJString, ResultChars);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
FString FSGConnectJNI::GetSensorString(const int32 DeviceAddress)
{
FString Result;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "GetSensorString", "(I)Ljava/lang/String;");
if (Method)
{
jstring ResultJString = (jstring)Env->CallStaticObjectMethod(Class, Method, DeviceAddress);
const char* ResultChars = Env->GetStringUTFChars(ResultJString, nullptr);
Result = FString(UTF8_TO_TCHAR(ResultChars));
Env->ReleaseStringUTFChars(ResultJString, ResultChars);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
int32 FSGConnectJNI::WriteHaptics(const int32 DeviceAddress, const FString& Haptics)
{
int32 Result = -999;
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (Env)
{
jclass Class = FAndroidApplication::FindJavaClass(SGCONNECT_JAVA_CLASS_NAME);
if (!Env->IsSameObject(Class, nullptr))
{
jmethodID Method = Env->GetStaticMethodID(Class, "ActiveDevices", "(ILjava/lang/String;)I");
if (Method)
{
jstring HapticsString = Env->NewStringUTF(TCHAR_TO_UTF8(*Haptics));
Result = Env->CallStaticIntMethod(Class, Method, HapticsString, DeviceAddress, HapticsString);
Env->DeleteLocalRef(HapticsJString);
}
}
}
#endif /* PLATFORM_ANDROID */
return Result;
}
@@ -35,4 +35,4 @@
#pragma once
#include "CoreMinimal.h"
#include "CoreMinimal.h"
@@ -35,6 +35,17 @@
#include "SenseGloveAndroidModule.h"
#if PLATFORM_ANDROID
#include "Android/AndroidApplication.h"
#include "Android/AndroidJava.h"
#endif /* PLATFORM_ANDROID */
#if PLATFORM_ANDROID
#include "SGConnectImpl/SGExportedFunctions.h"
#include "SGCoreImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
#endif /* PLATFORM_ANDROID */
#include "SGLog/SGLog.h"
#define LOCTEXT_NAMESPACE "FSenseGloveAndroidModule"
@@ -42,6 +53,32 @@
void FSenseGloveAndroidModule::StartupModule()
{
SGLOG("Starting up SenseGloveAndroid module...");
#if PLATFORM_ANDROID
JNIEnv* Env = FAndroidApplication::GetJavaEnv();
if (!Env)
{
SGLOG_ERROR("Failed to get the Android JNI environmnet!");
return;
}
FSGIC_JNIEnv_Ptr EnvContainer{Env};
/*ensureAlwaysMsgf(SGConnectImpl_Android_Initialize(&EnvContainer),
TEXT("Failed to initialize the SGConnect JNI bridge to SGConnect for Android!"));
ensureAlwaysMsgf(SGCoreImpl_Android_Initialize(&EnvContainer),
TEXT("Failed to initialize the SGCore JNI bridge to SGConnect for Android!"));*/
const int32 r1 = SGConnectImpl_Android_Initialize(&EnvContainer);
const int32 r2 = SGCoreImpl_Android_Initialize(&EnvContainer);
ensureAlwaysMsgf(r1 == 0,
TEXT("Failed to initialize the SGConnect JNI bridge to SGConnect for Android! Status Code: %d"), r1);
ensureAlwaysMsgf(r2 == 0,
TEXT("Failed to initialize the SGCore JNI bridge to SGConnect for Android! Status Code: %d"), r1);
#endif /* PLATFORM_ANDROID */
}
void FSenseGloveAndroidModule::PreUnloadCallback()
@@ -59,4 +96,4 @@ void FSenseGloveAndroidModule::ShutdownModule()
SGLOG("Shutting down SenseGloveAndroid module...");
}
#undef LOCTEXT_NAMESPACE
#undef LOCTEXT_NAMESPACE
@@ -48,4 +48,4 @@ public:
virtual void ShutdownModule() override;
};
#undef LOCTEXT_NAMESPACE
#undef LOCTEXT_NAMESPACE
@@ -55,6 +55,9 @@ public class SenseGloveAndroid : ModuleRules
{
"CoreUObject",
"Engine",
"SenseGloveConnectImpl",
"SenseGloveCoreImpl",
"SenseGloveInterop",
"SenseGloveLog",
}
);
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "SGBuildHacks/SGInclude_Connect_Android.h"
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "SGBuildHacks/SGInclude_Core_Android.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Connect/Android.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -0,0 +1,44 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "HAL/Platform.h"
#include "SGBuildHacks/SGUndef_TEXT.h"
THIRD_PARTY_INCLUDES_START
#include "SenseGlove/Core/Android.hpp"
THIRD_PARTY_INCLUDES_END
#include "SGBuildHacks/SGRestore_TEXT.h"
@@ -35,38 +35,22 @@
#include "SGConnect/SGConnect.h"
#if PLATFORM_ANDROID
#include "SGAndroid/SGConnectJNI.h"
#endif /* PLATFORM_ANDROID */
#include "SGConnectImpl/SGExportedFunctions.h"
#include "SGInterop/SGIC_FString.h"
int32 FSGConnect::Init()
{
#if ! PLATFORM_ANDROID
return SGConnect_Init();
#else
return FSGConnectJNI::Init();
#endif /* ! PLATFORM_ANDROID */
}
int32 FSGConnect::Dispose()
{
#if ! PLATFORM_ANDROID
return SGConnect_Dispose();
#else
return FSGConnectJNI::Dispose();
#endif /* ! PLATFORM_ANDROID */
}
FString FSGConnect::GetLibraryVersion()
{
#if ! PLATFORM_ANDROID
FSGIC_FString Container;
SGConnect_GetLibraryVersion(&Container);
return Container.String;
#else
return FSGConnectJNI::GetLibraryVersion();
#endif /* ! PLATFORM_ANDROID */
}
@@ -34,9 +34,31 @@
#include "SGConnectImpl/SGExportedFunctions.h"
#include "Templates/UnrealTemplate.h"
#if PLATFORM_ANDROID
#include "SGBuildHacks/SGInclude_Connect_Android.h"
#endif /* PLATFORM_ANDROID */
#include "SGConnectImpl/SGConnectImpl.h"
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
/*******************************************************************************
* Exceptional function calls
******************************************************************************/
#if PLATFORM_ANDROID
int32 SGConnectImpl_Android_Initialize(void* Env)
{
return SGConnect::Android::Initialize(StaticCast<FSGIC_JNIEnv_Ptr*>(Env)->Ptr);
}
#endif /* PLATFORM_ANDROID */
/*******************************************************************************
* SGConnectImpl.h
******************************************************************************/
int32 SGConnect_Init()
{
@@ -46,7 +46,7 @@
check whether boolean type is supported by the compiler or not. */
#include <stdbool.h>
#include <CoreTypes.h>
#include "CoreTypes.h"
/* Check at compile time whether the C compiler has support for bool, true,
and false macros. */
@@ -64,11 +64,25 @@ static_assert(__bool_true_false_are_defined, "Error: bool, true, and false are n
extern "C" {
#endif /* __cplusplus */
/* SGConnect.h */
/*******************************************************************************
* Exceptional function calls
******************************************************************************/
#if PLATFORM_ANDROID
SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnectImpl_Android_Initialize(void* Env);
#endif /* PLATFORM_ANDROID */
/*******************************************************************************
* SGConnectImpl.h
******************************************************************************/
SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnect_Init();
SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnect_Dispose();
SENSEGLOVECONNECTIMPL_PUBLIC_API void SGConnect_GetLibraryVersion(void* OutVersion);
/*******************************************************************************
******************************************************************************/
#if __cplusplus
}
#endif /* __cplusplus */
@@ -51,17 +51,9 @@
#include "SGInterop/SGIC_TArray_TSharedRef_FSGDeviceImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGDeviceImpl.h"
#if PLATFORM_ANDROID
#include "SGAndroid/SGConnectJNI.h"
#endif /* PLATFORM_ANDROID */
int32 FSGDeviceList::ActiveDevices()
{
#if ! PLATFORM_ANDROID
return SGCoreImpl_FSGDeviceListImpl_ActiveDevices();
#else
return FSGConnectJNI::ActiveDevices();
#endif /* ! PLATFORM_ANDROID */
}
bool FSGDeviceList::SenseCommRunning()
@@ -165,50 +157,27 @@ TArray<USGDevice*> FSGDeviceList::GetDevices(UObject* Outer, const ESGDeviceType
bool FSGDeviceList::GetSensorDataString(const int32 IpcIndex, const FString& IpcAddress, FString& OutString)
{
#if ! PLATFORM_ANDROID
FSGIC_FString IpcAddressContainer{IpcAddress};
FSGIC_FString OutStringContainer;
const bool bReturn = SGCoreImpl_FSGDeviceListImpl_GetSensorDataString(
IpcIndex, &IpcAddressContainer, &OutStringContainer);
OutString = OutStringContainer.String;
return bReturn;
#else
FString Result = FSGConnectJNI::GetSensorString(IpcIndex);
if (Result.IsEmpty())
{
return false;
}
OutString = MoveTemp(Result);
return true;
#endif /* ! PLATFORM_ANDROID */
}
bool FSGDeviceList::SendHaptics(const int32 IpcIndex, const FString& IpcAddress, const FString& Commands)
{
#if ! PLATFORM_ANDROID
FSGIC_FString IpcAddressContainer{IpcAddress};
FSGIC_FString CommandsContainer{Commands};
return SGCoreImpl_FSGDeviceListImpl_SendHaptics(IpcIndex, &IpcAddressContainer, &CommandsContainer);
#else
int32 Result = FSGConnectJNI::WriteHaptics(IpcIndex, Commands);
if (Result <= 0)
{
return false;
}
return true;
#endif /* ! PLATFORM_ANDROID */
}
FString FSGDeviceList::GetDeviceStringAt(const int32 IpcIndex, const FString& IpcAddress, const int32 Index)
{
#if ! PLATFORM_ANDROID
FSGIC_FString IpcAddressContainer{IpcAddress};
FSGIC_FString OutStringContainer;
SGCoreImpl_FSGDeviceListImpl_GetDeviceStringAt(&OutStringContainer, IpcIndex, &IpcAddressContainer, Index);
return OutStringContainer.String;
#else
return FSGConnectJNI::GetDeviceString(IpcIndex);
#endif /* ! PLATFORM_ANDROID */
}
FString FSGDeviceList::GetAddress(const int32 IpcIndex, const FString& IpcAddress)
@@ -35,8 +35,17 @@
#include "SGCoreImpl/SGExportedFunctions.h"
#if PLATFORM_ANDROID
#include "Android/AndroidApplication.h"
#include "Android/AndroidJava.h"
#endif /* PLATFORM_ANDROID */
#include "Templates/UnrealTemplate.h"
#if PLATFORM_ANDROID
#include "SGBuildHacks/SGInclude_Core_Android.h"
#endif /* PLATFORM_ANDROID */
#include "SGCoreImpl/SGAnatomyImpl.h"
#include "SGCoreImpl/SGDeviceListImpl.h"
#include "SGCoreImpl/SGHapticGloveHandProfilesImpl.h"
@@ -98,6 +107,7 @@
#include "SGInterop/SGIC_FString.h"
#include "SGInterop/SGIC_FVector.h"
#include "SGInterop/SGIC_int32_Ref.h"
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
#include "SGInterop/SGIC_TArray_bool.h"
#include "SGInterop/SGIC_TArray_FSGCalibrationDataPointImpl.h"
#include "SGInterop/SGIC_TArray_float.h"
@@ -127,6 +137,17 @@
#include "SGInterop/SGIC_TSharedPtr_FSGSenseGloveImpl.h"
#include "SGInterop/SGIC_TSharedPtr_FSGTimedBuzzCommandImpl.h"
/*******************************************************************************
* Exceptional function calls
******************************************************************************/
#if PLATFORM_ANDROID
int32 SGCoreImpl_Android_Initialize(void* Env)
{
return SGCore::Android::Initialize(StaticCast<FSGIC_JNIEnv_Ptr*>(Env)->Ptr);
}
#endif /* PLATFORM_ANDROID */
/*******************************************************************************
* SGAnatomyImpl.h
******************************************************************************/
@@ -46,7 +46,7 @@
check whether boolean type is supported by the compiler or not. */
#include <stdbool.h>
#include <CoreTypes.h>
#include "CoreTypes.h"
/* Check at compile time whether the C compiler has support for bool, true,
and false macros. */
@@ -64,6 +64,14 @@ static_assert(__bool_true_false_are_defined, "Error: bool, true, and false are n
extern "C" {
#endif /* __cplusplus */
/*******************************************************************************
* Exceptional function calls
******************************************************************************/
#if PLATFORM_ANDROID
SENSEGLOVECOREIMPL_PUBLIC_API int32 SGCoreImpl_Android_Initialize(void* Env);
#endif /* PLATFORM_ANDROID */
/*******************************************************************************
* SGAnatomyImpl.h
******************************************************************************/
@@ -0,0 +1,36 @@
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
* Copyright (c) 2020 - 2023 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
*
*
*/
#include "SGInterop/SGIC_JNIEnv_Ptr.h"
@@ -35,27 +35,11 @@
#pragma once
#include "UObject/ObjectMacros.h"
#if PLATFORM_ANDROID
#include "Android/AndroidJavaEnv.h"
#include "SGConnectJNI.generated.h"
USTRUCT()
struct SENSEGLOVEANDROID_API FSGConnectJNI
struct FSGIC_JNIEnv_Ptr
{
GENERATED_BODY()
public:
static int32 Init();
static int32 Dispose();
static FString GetLibraryVersion();
static int32 ActiveDevices();
static FString GetDeviceString(int32 DeviceAddress);
static FString GetSensorString(int32 DeviceAddress);
static int32 WriteHaptics(int32 DeviceAddress, const FString& Haptics);
};
JNIEnv* Ptr;
};
#endif /* PLATFORM_ANDROID */
@@ -350,7 +350,7 @@ enum class ESGSenseGloveThumperCommand : uint8
/* Turn off the thumper effects. */
TurnOff UMETA(DisplayName = "Turn Off"),
/* A 5-second long, constant vibration. */
/* A 5-seconds long, constant vibration. */
CueGameOver UMETA(DisplayName = "Cue Game Over"),
/* A double-click at 100% intensity. */
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More