71 lines
1.3 KiBLFS
C++
71 lines
1.3 KiBLFS
C++
/**
|
|
* @file
|
|
*
|
|
* @author Mamadou Babaei <mamadou@senseglove.com>
|
|
*
|
|
* @section LICENSE
|
|
*
|
|
* Copyright (c) 2020 - 2023 SenseGlove
|
|
*
|
|
* @section DESCRIPTION
|
|
*
|
|
* Provides Android-specific functionality.
|
|
*/
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "Platform.hpp"
|
|
|
|
#if SG_PLATFORM_ANDROID
|
|
|
|
#include <cstring>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include <jni.h>
|
|
|
|
#include "Platform.hpp"
|
|
|
|
namespace SGCore
|
|
{
|
|
class Android;
|
|
}// namespace SGCore
|
|
|
|
class SGCore::Android
|
|
{
|
|
public:
|
|
static int32_t Initialize(JNIEnv* env);
|
|
|
|
static Android& GetInstance();
|
|
|
|
private:
|
|
struct Impl;
|
|
std::unique_ptr<Impl> Pimpl;
|
|
|
|
private:
|
|
Android();
|
|
|
|
public:
|
|
virtual ~Android();
|
|
|
|
public:
|
|
#if ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
|
|
[[nodiscard]]
|
|
#endif /* ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
|
|
int32_t ActiveDevices() const;
|
|
|
|
#if ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
|
|
[[nodiscard]]
|
|
#endif /* ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
|
|
std::string GetDeviceString(int32_t deviceAddress) const;
|
|
|
|
#if ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN )
|
|
[[nodiscard]]
|
|
#endif /* ! defined ( SENSEGLOVE_UNREAL_ENGINE_PLUGIN ) */
|
|
std::string GetSensorString(int32_t deviceAddress) const;
|
|
|
|
int32_t WriteHaptics(int32_t deviceAddress, const std::string& haptics) const;
|
|
};
|
|
|
|
#endif /* SG_PLATFORM_ANDROID */ |