@therealitycrafters/react-native-evskit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -2
- package/android/build.gradle +46 -0
- package/android/src/main/java/expo/modules/evskit/EvsKitModule.kt +380 -0
- package/build/EvsKit.types.d.ts +76 -0
- package/build/EvsKit.types.d.ts.map +1 -0
- package/build/EvsKit.types.js +10 -0
- package/build/EvsKit.types.js.map +1 -0
- package/build/EvsKitModule.d.ts +43 -0
- package/build/EvsKitModule.d.ts.map +1 -0
- package/build/EvsKitModule.js +3 -0
- package/build/EvsKitModule.js.map +1 -0
- package/build/index.d.ts +118 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +146 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/EvsKit.xcframework/Info.plist +44 -0
- package/ios/EvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/EvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/EvsKit.xcframework/_CodeSignature/CodeResources +945 -0
- package/ios/EvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Assets.car +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/BitTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsKit +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit-Swift.h +390 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Headers/EvsKit.h +19 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Info.plist +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.abi.json +13039 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.private.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/Modules/module.modulemap +11 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemInfoViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/evs_logo_green.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/ota_info.json +17 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
- package/ios/EvsKit.xcframework/ios-arm64/EvsKit.framework/ota_background_big.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Assets.car +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/BitTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsGlassesNameTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsKit +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSliderTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/EvsSwitchTableViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit-Swift.h +776 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Headers/EvsKit.h +19 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Info.plist +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.abi.json +13039 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +13039 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/EvsKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +239 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/Modules/module.modulemap +11 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemInfoViewCell.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/09f-ri-9sL-view-zGn-Zv-q7U.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/8yY-DT-9Da-view-iUR-D7-FGu.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/BbY-tb-eSR-view-4D3-sx-xbY.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesOtaModalViewControllerIId.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/GlassesSettingsModalViewControllerIId.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/Info.plist +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/UIViewController-8yY-DT-9Da.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/debugViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/glassesConfigureViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/jne-LB-b9D-view-ci7-nK-5Un.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/kuB-So-Ae6-view-aJi-AM-lyl.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/l9h-6a-xMo-view-vJS-2W-16K.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/SystemUI.storyboardc/settingsViewController.nib +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/_CodeSignature/CodeResources +542 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/battery_notification.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/goodbye.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/common_glasses_resources/personal_adjust_default_final_result.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/evs_logo_green.png +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/max32650.121.enc.bin +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/ota_info.json +17 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota/stm32wb.color.121.enc.bin +0 -0
- package/ios/EvsKit.xcframework/ios-arm64_x86_64-simulator/EvsKit.framework/ota_background_big.png +0 -0
- package/ios/EvsKitModule.swift +321 -0
- package/ios/NativeEvsKit.xcframework/Info.plist +44 -0
- package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeResources +186 -0
- package/ios/NativeEvsKit.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Info.plist +35 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/Modules/module.modulemap +8 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64/NativeEvsKit.framework/NativeEvsKit +0 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Headers/NativeEvsKit.h +3634 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Info.plist +31 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/Modules/module.modulemap +8 -0
- package/ios/NativeEvsKit.xcframework/ios-arm64_x86_64-simulator/NativeEvsKit.framework/NativeEvsKit +0 -0
- package/ios/RNEvsKit.podspec +27 -0
- package/package.json +50 -4
- package/src/EvsKit.types.ts +122 -0
- package/src/EvsKitModule.ts +65 -0
- package/src/index.ts +172 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// The SDK's EvsKit module provides the entry point. Service interfaces live
|
|
5
|
+
// in NativeEvsKit.
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
import EvsKit
|
|
8
|
+
import NativeEvsKit
|
|
9
|
+
|
|
10
|
+
struct DeviceInfoRecord: Record {
|
|
11
|
+
@Field var deviceId: String = ""
|
|
12
|
+
@Field var name: String = ""
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
struct AutoBrightnessOptionsRecord: Record {
|
|
16
|
+
@Field var enabled: Bool = false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public class EvsKitModule: Module {
|
|
20
|
+
|
|
21
|
+
private var glassesEventsHandle: GlassesEventsHandler?
|
|
22
|
+
private var sensorsEventsHandle: SensorsEventsHandler?
|
|
23
|
+
private var yprEventsHandle: YprEventsHandler?
|
|
24
|
+
private var quaternionEventsHandle: QuaternionEventsHandler?
|
|
25
|
+
|
|
26
|
+
public func definition() -> ModuleDefinition {
|
|
27
|
+
Name("RNEvsKit")
|
|
28
|
+
|
|
29
|
+
Events(
|
|
30
|
+
"onConnectionStateChanged",
|
|
31
|
+
"onBeginAuth",
|
|
32
|
+
"onGlassesInfoChanged",
|
|
33
|
+
"onTouch",
|
|
34
|
+
"onProximity",
|
|
35
|
+
"onAmbient",
|
|
36
|
+
"onYpr",
|
|
37
|
+
"onQuaternion",
|
|
38
|
+
"onError"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
OnCreate {
|
|
42
|
+
registerNativeListeners()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
OnDestroy {
|
|
46
|
+
unregisterNativeListeners()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- Lifecycle -----------------------------------------------------------
|
|
50
|
+
|
|
51
|
+
AsyncFunction("start") { () -> Void in
|
|
52
|
+
// Evs.instance().start() can present the SDK's stock UI, which must happen on the main thread.
|
|
53
|
+
await MainActor.run { () -> Void in
|
|
54
|
+
Evs.instance().start()
|
|
55
|
+
if Evs.instance().comm().hasConfiguredDevice() {
|
|
56
|
+
Evs.instance().comm().connect()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
AsyncFunction("isStarted") { () -> Bool in
|
|
62
|
+
return Evs.instance().isReady()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// --- Stock UI --------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
AsyncFunction("showUI") { (screen: String) -> Void in
|
|
68
|
+
// Presents a view controller, which must happen on the main thread.
|
|
69
|
+
await MainActor.run { () -> Void in
|
|
70
|
+
Evs.instance().showUI(name: screen)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// --- Communication (IEvsCommunicationService) -----------------------------
|
|
75
|
+
|
|
76
|
+
AsyncFunction("setDeviceInfo") { (info: DeviceInfoRecord) -> Void in
|
|
77
|
+
Evs.instance().comm().setDeviceInfo(deviceId: info.deviceId, name: info.name)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
AsyncFunction("connect") { () -> Void in
|
|
81
|
+
// May trigger the SDK's auth/pairing UI, which must happen on the main thread.
|
|
82
|
+
await MainActor.run { () -> Void in
|
|
83
|
+
Evs.instance().comm().connect()
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
AsyncFunction("connectSecured") { () -> Void in
|
|
88
|
+
await MainActor.run { () -> Void in
|
|
89
|
+
Evs.instance().comm().connectSecured()
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
AsyncFunction("disconnect") { () -> Void in
|
|
94
|
+
Evs.instance().comm().disconnect()
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
AsyncFunction("hasConfiguredDevice") { () -> Bool in
|
|
98
|
+
return Evs.instance().comm().hasConfiguredDevice()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// --- Glasses (IEvsGlassesStateService) -------------------------------------
|
|
102
|
+
|
|
103
|
+
AsyncFunction("getGlassesInfo") { () -> [String: Any] in
|
|
104
|
+
let glasses = Evs.instance().glasses()
|
|
105
|
+
return [
|
|
106
|
+
"batteryLevel": glasses.batteryPercentage(),
|
|
107
|
+
"batteryStatus": String(describing: glasses.batteryLevel()),
|
|
108
|
+
"estimatedRemainingTime": glasses.estimatedRemainingTime(),
|
|
109
|
+
"firmwareVersion": glasses.fwVersion()
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
AsyncFunction("turnGlassesOff") { () -> Void in
|
|
114
|
+
Evs.instance().glasses().turnOff()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// --- Display (IEvsDisplayService) ------------------------------------------
|
|
118
|
+
|
|
119
|
+
AsyncFunction("turnDisplayOn") { () -> Void in
|
|
120
|
+
Evs.instance().display().turnDisplayOn()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
AsyncFunction("setBrightness") { (value: Int) -> Void in
|
|
124
|
+
Evs.instance().display().setBrightness(value: Int16(value))
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
AsyncFunction("setBrightnessLevel") { (level: Int) -> Void in
|
|
128
|
+
Evs.instance().display().desecrateBrightness().setBrightnessLevel(levelIndex: Int32(level))
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
AsyncFunction("setAutoBrightness") { (options: AutoBrightnessOptionsRecord) -> Void in
|
|
132
|
+
Evs.instance().display().autoBrightness().setProvider(provider: AutoBrightnessGainProvider())
|
|
133
|
+
Evs.instance().display().autoBrightness().enable(isEnabled: options.enabled)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// --- Screens -----------------------------------------------------------------
|
|
137
|
+
|
|
138
|
+
AsyncFunction("setRenderingCenterX") { (dx: Float) -> Void in
|
|
139
|
+
Evs.instance().screens().setRenderingCenterX(centerX: dx)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
AsyncFunction("setRenderingCenterY") { (dy: Float) -> Void in
|
|
143
|
+
Evs.instance().screens().setRenderingCenterY(centerY: dy)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// --- Sensors (IEvsSensorsService) -------------------------------------------
|
|
147
|
+
|
|
148
|
+
AsyncFunction("enableTouch") { (enabled: Bool) -> Void in
|
|
149
|
+
Evs.instance().sensors().enableTouch(enable: enabled)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
AsyncFunction("enableAmbient") { (enabled: Bool) -> Void in
|
|
153
|
+
Evs.instance().sensors().enableAmbient(enable: enabled)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
AsyncFunction("enableGyro") { (enabled: Bool) -> Void in
|
|
157
|
+
if enabled {
|
|
158
|
+
Evs.instance().sensors().enableGyro()
|
|
159
|
+
} else {
|
|
160
|
+
Evs.instance().sensors().disableInertialSensors()
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
AsyncFunction("enableMagnetometer") { (enabled: Bool) -> Void in
|
|
165
|
+
if enabled {
|
|
166
|
+
Evs.instance().sensors().enableMagnetometer()
|
|
167
|
+
} else {
|
|
168
|
+
Evs.instance().sensors().disableInertialSensors()
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
AsyncFunction("enableAccelerometer") { (enabled: Bool) -> Void in
|
|
173
|
+
if enabled {
|
|
174
|
+
Evs.instance().sensors().enableAccelerometer()
|
|
175
|
+
} else {
|
|
176
|
+
Evs.instance().sensors().disableInertialSensors()
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
AsyncFunction("enableSensorsFusion") { (enabled: Bool) -> Void in
|
|
181
|
+
if enabled {
|
|
182
|
+
Evs.instance().sensors().enableInertialSensors()
|
|
183
|
+
} else {
|
|
184
|
+
Evs.instance().sensors().disableInertialSensors()
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// --- Auth (IEvsAuthService) --------------------------------------------------
|
|
189
|
+
|
|
190
|
+
AsyncFunction("setApiKeyName") { (fileNameWithoutExt: String) -> Void in
|
|
191
|
+
Evs.instance().auth().setApiKeyName(fileNameWithoutExt: fileNameWithoutExt)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
AsyncFunction("setApiKey") { (base64Key: String) -> Void in
|
|
195
|
+
guard let data = Data(base64Encoded: base64Key) else { return }
|
|
196
|
+
let byteArray = KotlinByteArray(size: Int32(data.count))
|
|
197
|
+
for i in 0..<data.count {
|
|
198
|
+
byteArray.set(index: Int32(i), value: Int8(data[i]))
|
|
199
|
+
}
|
|
200
|
+
Evs.instance().auth().setApiKey(apiKey: byteArray)
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ---------------------------------------------------------------------------
|
|
205
|
+
// Wires the SDK's delegate/callback-style listeners to this module's
|
|
206
|
+
// `sendEvent(...)`, mirroring the Android implementation.
|
|
207
|
+
//
|
|
208
|
+
// The handler classes are declared at class scope (not inside the method)
|
|
209
|
+
// so the stored properties above can reference them, and each implements
|
|
210
|
+
// the full protocol surface required by the SDK.
|
|
211
|
+
//
|
|
212
|
+
// Note: Expo's `sendEvent` requires a `[String: Any?]` dictionary as the
|
|
213
|
+
// payload — plain values are not accepted.
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
private class GlassesEventsHandler: IEvsGlassesEvents {
|
|
217
|
+
weak var module: EvsKitModule?
|
|
218
|
+
func onTouch(touch: TouchDirection) {
|
|
219
|
+
module?.sendEvent("onTouch", ["direction": String(describing: touch)])
|
|
220
|
+
}
|
|
221
|
+
func onBatteryChanged(percentage: Int32) {
|
|
222
|
+
module?.sendEvent("onGlassesInfoChanged", ["batteryLevel": percentage])
|
|
223
|
+
}
|
|
224
|
+
func onChargerStateChanged(isChargerConnected: Bool) {
|
|
225
|
+
module?.sendEvent("onGlassesInfoChanged", ["isCharging": isChargerConnected])
|
|
226
|
+
}
|
|
227
|
+
func onDisplayState(isDisplayOn: Bool) {
|
|
228
|
+
// Not mapped to JS — display state is internal
|
|
229
|
+
}
|
|
230
|
+
func onPowerButton(action: PowerButtonAction) {
|
|
231
|
+
// Not mapped to JS — power button is a hardware event
|
|
232
|
+
}
|
|
233
|
+
func onBrightnessChangeRequested(value: Int16) {
|
|
234
|
+
// Not mapped to JS — brightness changes are handled by setBrightness
|
|
235
|
+
}
|
|
236
|
+
func onProximity(state: ProximityActionType) {
|
|
237
|
+
module?.sendEvent("onProximity", ["state": state == .onface ? "onFace" : "offFace"])
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private class SensorsEventsHandler: IEvsSensorsEvents {
|
|
242
|
+
weak var module: EvsKitModule?
|
|
243
|
+
func onAmbient(lux: Float) {
|
|
244
|
+
module?.sendEvent("onAmbient", ["lux": lux])
|
|
245
|
+
}
|
|
246
|
+
func onProximity(proximity: ProximityActionType) -> Bool {
|
|
247
|
+
module?.sendEvent("onProximity", ["state": proximity == .onface ? "onFace" : "offFace"])
|
|
248
|
+
return true
|
|
249
|
+
}
|
|
250
|
+
func onSensorEnableChange(sType: SensorType, isEnabled: Bool) {
|
|
251
|
+
// Not mapped to JS — sensor enable state is internal
|
|
252
|
+
}
|
|
253
|
+
func onSensorEnableRequested(sType: SensorType, isEnabledRequested: Bool) {
|
|
254
|
+
// Not mapped to JS — sensor enable requests are handled internally
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
private class YprEventsHandler: IEvsYprSensorsEvents {
|
|
259
|
+
weak var module: EvsKitModule?
|
|
260
|
+
func onYpr(timestampMs: Int64, yprData: YprData, calibrationStatus: CalibrationStatus) {
|
|
261
|
+
module?.sendEvent("onYpr", [
|
|
262
|
+
"timestampMs": timestampMs,
|
|
263
|
+
"data": ["yaw": yprData.yaw, "pitch": yprData.pitch, "roll": yprData.roll],
|
|
264
|
+
"calibrationStatus": String(describing: calibrationStatus)
|
|
265
|
+
])
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private class QuaternionEventsHandler: IEvsQuaternionSensorsEvents {
|
|
270
|
+
weak var module: EvsKitModule?
|
|
271
|
+
func onQuaternion(timestampMs: Int64, quaternionsData: QuaternionData, calibrationStatus: CalibrationStatus) {
|
|
272
|
+
module?.sendEvent("onQuaternion", [
|
|
273
|
+
"timestampMs": timestampMs,
|
|
274
|
+
"data": [
|
|
275
|
+
"w": quaternionsData.w,
|
|
276
|
+
"x": quaternionsData.x,
|
|
277
|
+
"y": quaternionsData.y,
|
|
278
|
+
"z": quaternionsData.z
|
|
279
|
+
],
|
|
280
|
+
"calibrationStatus": String(describing: calibrationStatus)
|
|
281
|
+
])
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
private func registerNativeListeners() {
|
|
286
|
+
let glassesHandler = GlassesEventsHandler()
|
|
287
|
+
glassesHandler.module = self
|
|
288
|
+
glassesEventsHandle = glassesHandler
|
|
289
|
+
Evs.instance().glasses().registerGlassesEvents(listener: glassesHandler)
|
|
290
|
+
|
|
291
|
+
let sensorsHandler = SensorsEventsHandler()
|
|
292
|
+
sensorsHandler.module = self
|
|
293
|
+
sensorsEventsHandle = sensorsHandler
|
|
294
|
+
Evs.instance().sensors().registerSensorsEvents(listener: sensorsHandler)
|
|
295
|
+
|
|
296
|
+
let yprHandler = YprEventsHandler()
|
|
297
|
+
yprHandler.module = self
|
|
298
|
+
yprEventsHandle = yprHandler
|
|
299
|
+
Evs.instance().sensors().registerYprSensorsEvents(listener: yprHandler)
|
|
300
|
+
|
|
301
|
+
let quaternionHandler = QuaternionEventsHandler()
|
|
302
|
+
quaternionHandler.module = self
|
|
303
|
+
quaternionEventsHandle = quaternionHandler
|
|
304
|
+
Evs.instance().sensors().registerQuaternionSensorsEvents(listener: quaternionHandler)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
private func unregisterNativeListeners() {
|
|
308
|
+
if let handle = glassesEventsHandle {
|
|
309
|
+
Evs.instance().glasses().unregisterGlassesEvents(listener: handle)
|
|
310
|
+
}
|
|
311
|
+
if let handle = sensorsEventsHandle {
|
|
312
|
+
Evs.instance().sensors().unregisterSensorsEvents(listener: handle)
|
|
313
|
+
}
|
|
314
|
+
if let handle = yprEventsHandle {
|
|
315
|
+
Evs.instance().sensors().unregisterYprSensorsEvents(listener: handle)
|
|
316
|
+
}
|
|
317
|
+
if let handle = quaternionEventsHandle {
|
|
318
|
+
Evs.instance().sensors().unregisterQuaternionSensorsEvents(listener: handle)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>NativeEvsKit.framework/NativeEvsKit</string>
|
|
10
|
+
<key>LibraryIdentifier</key>
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
|
+
<key>LibraryPath</key>
|
|
13
|
+
<string>NativeEvsKit.framework</string>
|
|
14
|
+
<key>SupportedArchitectures</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>arm64</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>SupportedPlatform</key>
|
|
19
|
+
<string>ios</string>
|
|
20
|
+
</dict>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>BinaryPath</key>
|
|
23
|
+
<string>NativeEvsKit.framework/NativeEvsKit</string>
|
|
24
|
+
<key>LibraryIdentifier</key>
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
26
|
+
<key>LibraryPath</key>
|
|
27
|
+
<string>NativeEvsKit.framework</string>
|
|
28
|
+
<key>SupportedArchitectures</key>
|
|
29
|
+
<array>
|
|
30
|
+
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
32
|
+
</array>
|
|
33
|
+
<key>SupportedPlatform</key>
|
|
34
|
+
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
|
+
</dict>
|
|
38
|
+
</array>
|
|
39
|
+
<key>CFBundlePackageType</key>
|
|
40
|
+
<string>XFWK</string>
|
|
41
|
+
<key>XCFrameworkFormatVersion</key>
|
|
42
|
+
<string>1.0</string>
|
|
43
|
+
</dict>
|
|
44
|
+
</plist>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>ios-arm64/NativeEvsKit.framework/Headers/NativeEvsKit.h</key>
|
|
8
|
+
<data>
|
|
9
|
+
4EVh1OD0QvHTzow6mVu1kSNBgrs=
|
|
10
|
+
</data>
|
|
11
|
+
<key>ios-arm64/NativeEvsKit.framework/Info.plist</key>
|
|
12
|
+
<data>
|
|
13
|
+
XQMq3RDWGeGtKNljyDDz8ebN304=
|
|
14
|
+
</data>
|
|
15
|
+
<key>ios-arm64/NativeEvsKit.framework/Modules/module.modulemap</key>
|
|
16
|
+
<data>
|
|
17
|
+
qkvyg/Kt2eIMM5jlpaQyt2HU4vk=
|
|
18
|
+
</data>
|
|
19
|
+
<key>ios-arm64/NativeEvsKit.framework/NativeEvsKit</key>
|
|
20
|
+
<data>
|
|
21
|
+
cVxdeguXkVBuiuNHJCm3XchMoIA=
|
|
22
|
+
</data>
|
|
23
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Headers/NativeEvsKit.h</key>
|
|
24
|
+
<data>
|
|
25
|
+
4EVh1OD0QvHTzow6mVu1kSNBgrs=
|
|
26
|
+
</data>
|
|
27
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Info.plist</key>
|
|
28
|
+
<data>
|
|
29
|
+
6nQ/+JHqvwYic/Myr4fu3COlhQg=
|
|
30
|
+
</data>
|
|
31
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Modules/module.modulemap</key>
|
|
32
|
+
<data>
|
|
33
|
+
qkvyg/Kt2eIMM5jlpaQyt2HU4vk=
|
|
34
|
+
</data>
|
|
35
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/NativeEvsKit</key>
|
|
36
|
+
<data>
|
|
37
|
+
UfpVnxI1Q1y16Kc6N/kWuqIuhko=
|
|
38
|
+
</data>
|
|
39
|
+
</dict>
|
|
40
|
+
<key>files2</key>
|
|
41
|
+
<dict>
|
|
42
|
+
<key>ios-arm64/NativeEvsKit.framework/Headers/NativeEvsKit.h</key>
|
|
43
|
+
<dict>
|
|
44
|
+
<key>hash2</key>
|
|
45
|
+
<data>
|
|
46
|
+
qCYVS20927URcmhT9KHcorfaiZGeBCflAOEpk/Omn/U=
|
|
47
|
+
</data>
|
|
48
|
+
</dict>
|
|
49
|
+
<key>ios-arm64/NativeEvsKit.framework/Info.plist</key>
|
|
50
|
+
<dict>
|
|
51
|
+
<key>hash2</key>
|
|
52
|
+
<data>
|
|
53
|
+
OMD1bXAs+73eR8HGJ/pVTlRw22j//0moynnhfUI3oew=
|
|
54
|
+
</data>
|
|
55
|
+
</dict>
|
|
56
|
+
<key>ios-arm64/NativeEvsKit.framework/Modules/module.modulemap</key>
|
|
57
|
+
<dict>
|
|
58
|
+
<key>hash2</key>
|
|
59
|
+
<data>
|
|
60
|
+
3Il8ChH1MWhS7dBxmZS5jsUodLyzD/ildP1FIPKWoU8=
|
|
61
|
+
</data>
|
|
62
|
+
</dict>
|
|
63
|
+
<key>ios-arm64/NativeEvsKit.framework/NativeEvsKit</key>
|
|
64
|
+
<dict>
|
|
65
|
+
<key>hash2</key>
|
|
66
|
+
<data>
|
|
67
|
+
d5Zz+oxd7DvARw1jMU72XR8N5kH6IHKXRlQGaP06pdw=
|
|
68
|
+
</data>
|
|
69
|
+
</dict>
|
|
70
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Headers/NativeEvsKit.h</key>
|
|
71
|
+
<dict>
|
|
72
|
+
<key>hash2</key>
|
|
73
|
+
<data>
|
|
74
|
+
qCYVS20927URcmhT9KHcorfaiZGeBCflAOEpk/Omn/U=
|
|
75
|
+
</data>
|
|
76
|
+
</dict>
|
|
77
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Info.plist</key>
|
|
78
|
+
<dict>
|
|
79
|
+
<key>hash2</key>
|
|
80
|
+
<data>
|
|
81
|
+
r7rMGKrKTzOJxPmbcEzAeDT92xF0zam4ZsMRvBe38dc=
|
|
82
|
+
</data>
|
|
83
|
+
</dict>
|
|
84
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/Modules/module.modulemap</key>
|
|
85
|
+
<dict>
|
|
86
|
+
<key>hash2</key>
|
|
87
|
+
<data>
|
|
88
|
+
3Il8ChH1MWhS7dBxmZS5jsUodLyzD/ildP1FIPKWoU8=
|
|
89
|
+
</data>
|
|
90
|
+
</dict>
|
|
91
|
+
<key>ios-arm64_x86_64-simulator/NativeEvsKit.framework/NativeEvsKit</key>
|
|
92
|
+
<dict>
|
|
93
|
+
<key>hash2</key>
|
|
94
|
+
<data>
|
|
95
|
+
6s3D11QKYRJW8ronZmZLKmNbB7omYrm9XQoezoFahns=
|
|
96
|
+
</data>
|
|
97
|
+
</dict>
|
|
98
|
+
</dict>
|
|
99
|
+
<key>rules</key>
|
|
100
|
+
<dict>
|
|
101
|
+
<key>^.*</key>
|
|
102
|
+
<true/>
|
|
103
|
+
<key>^.*\.lproj/</key>
|
|
104
|
+
<dict>
|
|
105
|
+
<key>optional</key>
|
|
106
|
+
<true/>
|
|
107
|
+
<key>weight</key>
|
|
108
|
+
<real>1000</real>
|
|
109
|
+
</dict>
|
|
110
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
111
|
+
<dict>
|
|
112
|
+
<key>omit</key>
|
|
113
|
+
<true/>
|
|
114
|
+
<key>weight</key>
|
|
115
|
+
<real>1100</real>
|
|
116
|
+
</dict>
|
|
117
|
+
<key>^Base\.lproj/</key>
|
|
118
|
+
<dict>
|
|
119
|
+
<key>weight</key>
|
|
120
|
+
<real>1010</real>
|
|
121
|
+
</dict>
|
|
122
|
+
<key>^version.plist$</key>
|
|
123
|
+
<true/>
|
|
124
|
+
</dict>
|
|
125
|
+
<key>rules2</key>
|
|
126
|
+
<dict>
|
|
127
|
+
<key>.*\.dSYM($|/)</key>
|
|
128
|
+
<dict>
|
|
129
|
+
<key>weight</key>
|
|
130
|
+
<real>11</real>
|
|
131
|
+
</dict>
|
|
132
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
133
|
+
<dict>
|
|
134
|
+
<key>omit</key>
|
|
135
|
+
<true/>
|
|
136
|
+
<key>weight</key>
|
|
137
|
+
<real>2000</real>
|
|
138
|
+
</dict>
|
|
139
|
+
<key>^.*</key>
|
|
140
|
+
<true/>
|
|
141
|
+
<key>^.*\.lproj/</key>
|
|
142
|
+
<dict>
|
|
143
|
+
<key>optional</key>
|
|
144
|
+
<true/>
|
|
145
|
+
<key>weight</key>
|
|
146
|
+
<real>1000</real>
|
|
147
|
+
</dict>
|
|
148
|
+
<key>^.*\.lproj/locversion.plist$</key>
|
|
149
|
+
<dict>
|
|
150
|
+
<key>omit</key>
|
|
151
|
+
<true/>
|
|
152
|
+
<key>weight</key>
|
|
153
|
+
<real>1100</real>
|
|
154
|
+
</dict>
|
|
155
|
+
<key>^Base\.lproj/</key>
|
|
156
|
+
<dict>
|
|
157
|
+
<key>weight</key>
|
|
158
|
+
<real>1010</real>
|
|
159
|
+
</dict>
|
|
160
|
+
<key>^Info\.plist$</key>
|
|
161
|
+
<dict>
|
|
162
|
+
<key>omit</key>
|
|
163
|
+
<true/>
|
|
164
|
+
<key>weight</key>
|
|
165
|
+
<real>20</real>
|
|
166
|
+
</dict>
|
|
167
|
+
<key>^PkgInfo$</key>
|
|
168
|
+
<dict>
|
|
169
|
+
<key>omit</key>
|
|
170
|
+
<true/>
|
|
171
|
+
<key>weight</key>
|
|
172
|
+
<real>20</real>
|
|
173
|
+
</dict>
|
|
174
|
+
<key>^embedded\.provisionprofile$</key>
|
|
175
|
+
<dict>
|
|
176
|
+
<key>weight</key>
|
|
177
|
+
<real>20</real>
|
|
178
|
+
</dict>
|
|
179
|
+
<key>^version\.plist$</key>
|
|
180
|
+
<dict>
|
|
181
|
+
<key>weight</key>
|
|
182
|
+
<real>20</real>
|
|
183
|
+
</dict>
|
|
184
|
+
</dict>
|
|
185
|
+
</dict>
|
|
186
|
+
</plist>
|
|
Binary file
|