Ocean
platform/meta/quest/Device.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_PLATFORM_META_QUEST_DEVICE_H
9
#define META_OCEAN_PLATFORM_META_QUEST_DEVICE_H
10
11
#include "
ocean/platform/meta/quest/Quest.h
"
12
13
namespace
Ocean
14
{
15
16
namespace
Platform
17
{
18
19
namespace
Meta
20
{
21
22
namespace
Quest
23
{
24
25
/**
26
* This class implements functions for Meta's Quest devices.
27
* @ingroup platformmetaquest
28
*/
29
class
Device
30
{
31
public
:
32
33
/**
34
* Definition of individual device types.
35
*/
36
enum
DeviceType
: uint32_t
37
{
38
/// Unknown device.
39
DT_UNKNOWN
= 0u,
40
/// Quest device, version 1.
41
DT_QUEST
,
42
/// Quest device, version 2.
43
DT_QUEST_2
,
44
/// Quest device, version 3.
45
DT_QUEST_3
,
46
// Quest device, version 3S.
47
DT_QUEST_3S
,
48
/// Quest Pro device.
49
DT_QUEST_PRO
,
50
51
/// Exclusive end of device types.
52
DT_QUEST_END
53
};
54
55
protected
:
56
57
/// Definition of an invalid enum value for quest devices.
58
static
constexpr uint32_t
invalidQuestDeviceValue_
= 1024u;
59
60
public
:
61
62
/**
63
* Returns the type of the device.
64
* @return The device type, DT_UNKNOWN if unknown
65
*/
66
static
DeviceType
deviceType
();
67
68
/**
69
* Returns the name of the device.
70
* @return The device name, "Unknown" if unknown
71
*/
72
static
inline
std::string
deviceName
();
73
74
/**
75
* Returns the name of a device.
76
* @param deviceType The device type for which the name will be returned
77
* @return The device name, "Unknown" if unknown
78
*/
79
static
std::string
deviceName
(
const
DeviceType
deviceType
);
80
};
81
82
inline
std::string
Device::deviceName
()
83
{
84
return
deviceName
(
deviceType
());
85
}
86
87
#ifdef OCEAN_PLATFORM_META_QUEST_USE_EXTERNAL_DEVICE_NAME
88
89
/**
90
* Returns the type of the device.
91
* @param productModel The product model for which the enum type will be returned
92
* @param productName The product name for which the enum type will be returned
93
* @return The device type, DT_UNKNOWN if unknown
94
*/
95
uint32_t
PlatformMetaDevice_externalDeviceType
(
const
std::string& productModel,
const
std::string& productName);
96
97
/**
98
* Returns the name of a device which is based on external knowledge.
99
* @param deviceType The device type for which the name will be returned
100
* @return The device name, "Unknown" if unknown
101
*/
102
std::string
PlatformMetaDevice_externalDeviceName
(
const
uint32_t deviceType);
103
104
#endif
// OCEAN_PLATFORM_META_QUEST_USE_EXTERNAL_DEVICE_NAME
105
106
}
// Quest
107
108
}
// Meta
109
110
}
// Platform
111
112
}
// Ocean
113
114
#endif
// META_OCEAN_PLATFORM_META_QUEST_DEVICE_H
Ocean::Platform::Meta::Quest::Device
This class implements functions for Meta's Quest devices.
Definition:
platform/meta/quest/Device.h:30
Ocean::Platform::Meta::Quest::Device::DeviceType
DeviceType
Definition of individual device types.
Definition:
platform/meta/quest/Device.h:37
Ocean::Platform::Meta::Quest::Device::DT_QUEST_2
@ DT_QUEST_2
Quest device, version 2.
Definition:
platform/meta/quest/Device.h:43
Ocean::Platform::Meta::Quest::Device::DT_QUEST_3
@ DT_QUEST_3
Quest device, version 3.
Definition:
platform/meta/quest/Device.h:45
Ocean::Platform::Meta::Quest::Device::DT_UNKNOWN
@ DT_UNKNOWN
Unknown device.
Definition:
platform/meta/quest/Device.h:39
Ocean::Platform::Meta::Quest::Device::DT_QUEST_END
@ DT_QUEST_END
Exclusive end of device types.
Definition:
platform/meta/quest/Device.h:52
Ocean::Platform::Meta::Quest::Device::DT_QUEST_3S
@ DT_QUEST_3S
Definition:
platform/meta/quest/Device.h:47
Ocean::Platform::Meta::Quest::Device::DT_QUEST_PRO
@ DT_QUEST_PRO
Quest Pro device.
Definition:
platform/meta/quest/Device.h:49
Ocean::Platform::Meta::Quest::Device::DT_QUEST
@ DT_QUEST
Quest device, version 1.
Definition:
platform/meta/quest/Device.h:41
Ocean::Platform::Meta::Quest::Device::deviceName
static std::string deviceName(const DeviceType deviceType)
Returns the name of a device.
Ocean::Platform::Meta::Quest::Device::invalidQuestDeviceValue_
static constexpr uint32_t invalidQuestDeviceValue_
Definition of an invalid enum value for quest devices.
Definition:
platform/meta/quest/Device.h:58
Ocean::Platform::Meta::Quest::Device::deviceType
static DeviceType deviceType()
Returns the type of the device.
Ocean::Platform::Meta::Quest::Device::deviceName
static std::string deviceName()
Returns the name of the device.
Definition:
platform/meta/quest/Device.h:82
Ocean::Platform::Meta::Quest::PlatformMetaDevice_externalDeviceName
std::string PlatformMetaDevice_externalDeviceName(const uint32_t deviceType)
Returns the name of a device which is based on external knowledge.
Ocean::Platform::Meta::Quest::PlatformMetaDevice_externalDeviceType
uint32_t PlatformMetaDevice_externalDeviceType(const std::string &productModel, const std::string &productName)
Returns the type of the device.
Ocean
The namespace covering the entire Ocean framework.
Definition:
Accessor.h:15
Quest.h
impl
ocean
platform
meta
quest
Device.h
Generated on Wed Nov 13 2024 18:48:16 for Ocean by
1.9.1