@mentra/bluetooth-sdk 0.1.12 → 0.1.13
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 +16 -9
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +51 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +73 -21
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +1 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +190 -26
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdkDebug.kt +14 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/ObservableStore.kt +20 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/OtaManifest.kt +153 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/camera/CameraModels.kt +78 -10
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/ControllerManager.kt +3 -14
- package/android/src/main/java/com/mentra/bluetoothsdk/controllers/R1.kt +3 -6
- package/android/src/main/java/com/mentra/bluetoothsdk/services/PhoneMic.kt +90 -4
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.kt +3835 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +20 -23
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/{Mach1.java → Mach1.kt} +517 -560
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +8712 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +11 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +3 -13
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Simulated.kt +7 -14
- package/build/BluetoothSdk.types.d.ts +39 -9
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +8 -6
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +0 -2
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/_private/photoRequestPayload.d.ts +3 -1
- package/build/_private/photoRequestPayload.d.ts.map +1 -1
- package/build/_private/photoRequestPayload.js +43 -1
- package/build/_private/photoRequestPayload.js.map +1 -1
- package/build/debug.d.ts +3 -0
- package/build/debug.d.ts.map +1 -0
- package/build/debug.js +8 -0
- package/build/debug.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +14 -5
- package/build/index.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +38 -57
- package/ios/Source/BluetoothSdkDefaults.swift +23 -3
- package/ios/Source/DeviceManager.swift +37 -26
- package/ios/Source/DeviceStore.swift +5 -1
- package/ios/Source/MentraBluetoothSDK.swift +197 -26
- package/ios/Source/MentraBluetoothSDKDebug.swift +12 -0
- package/ios/Source/ObservableStore.swift +11 -0
- package/ios/Source/OtaManifest.swift +170 -0
- package/ios/Source/camera/CameraModels.swift +218 -8
- package/ios/Source/controllers/ControllerManager.swift +2 -5
- package/ios/Source/controllers/R1.swift +2 -5
- package/ios/Source/sgcs/G1.swift +6 -5
- package/ios/Source/sgcs/G2.swift +20 -18
- package/ios/Source/sgcs/Mach1.swift +6 -5
- package/ios/Source/sgcs/MentraLive.swift +129 -33
- package/ios/Source/sgcs/MentraNex.swift +6 -5
- package/ios/Source/sgcs/SGCManager.swift +3 -5
- package/ios/Source/sgcs/Simulated.swift +7 -3
- package/ios/Source/status/DeviceStatus.swift +1 -1
- package/package.json +6 -1
- package/src/BluetoothSdk.types.ts +40 -9
- package/src/_private/BluetoothSdkModule.ts +8 -9
- package/src/_private/photoRequestPayload.ts +45 -2
- package/src/debug.ts +9 -0
- package/src/index.ts +23 -6
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.java +0 -3974
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.java +0 -7434
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.mentra.bluetoothsdk.sgcs
|
|
2
2
|
|
|
3
|
+
import com.mentra.bluetoothsdk.PhotoRequest
|
|
3
4
|
import android.bluetooth.BluetoothAdapter
|
|
4
5
|
import android.bluetooth.BluetoothGatt
|
|
5
6
|
import android.bluetooth.BluetoothGattCallback
|
|
@@ -1838,10 +1839,18 @@ class G2 : SGCManager() {
|
|
|
1838
1839
|
|
|
1839
1840
|
// ---------- SGCManager: Display Control ----------
|
|
1840
1841
|
|
|
1842
|
+
override fun sendText(text: String) {
|
|
1843
|
+
displayScope.launch {
|
|
1844
|
+
displayMutex.withLock {
|
|
1845
|
+
sendText2(text)
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1841
1850
|
override fun sendTextWall(text: String) {
|
|
1842
1851
|
displayScope.launch {
|
|
1843
1852
|
displayMutex.withLock {
|
|
1844
|
-
|
|
1853
|
+
sendText2(
|
|
1845
1854
|
text,
|
|
1846
1855
|
x = defaultTextX,
|
|
1847
1856
|
y = defaultTextY,
|
|
@@ -1856,7 +1865,7 @@ class G2 : SGCManager() {
|
|
|
1856
1865
|
}
|
|
1857
1866
|
}
|
|
1858
1867
|
|
|
1859
|
-
private suspend fun
|
|
1868
|
+
private suspend fun sendText2(
|
|
1860
1869
|
text: String,
|
|
1861
1870
|
x: Int? = null,
|
|
1862
1871
|
y: Int? = null,
|
|
@@ -1917,7 +1926,7 @@ class G2 : SGCManager() {
|
|
|
1917
1926
|
contentLength = container.content.toByteArray(Charsets.UTF_8).size,
|
|
1918
1927
|
content = container.content
|
|
1919
1928
|
)
|
|
1920
|
-
|
|
1929
|
+
queueEvenHubCommand(msg)
|
|
1921
1930
|
return
|
|
1922
1931
|
}
|
|
1923
1932
|
container =
|
|
@@ -1955,13 +1964,7 @@ class G2 : SGCManager() {
|
|
|
1955
1964
|
imageContainers[i].bmpData = ByteArray(0)
|
|
1956
1965
|
}
|
|
1957
1966
|
// shutdown the page and then recreate the containers without the content.
|
|
1958
|
-
|
|
1959
|
-
// than a rebuildPageMessage that no longer matches the torn-down page.
|
|
1960
|
-
val msg = EvenHubProto.shutdownMessage()
|
|
1961
|
-
sendEvenHubCommand(msg)
|
|
1962
|
-
pageCreated = false
|
|
1963
|
-
createPageWithContainers()
|
|
1964
|
-
restartMicIfAlreadyEnabled()
|
|
1967
|
+
rebuildPage()
|
|
1965
1968
|
}
|
|
1966
1969
|
}
|
|
1967
1970
|
}
|
|
@@ -2145,6 +2148,9 @@ class G2 : SGCManager() {
|
|
|
2145
2148
|
// sendEvenHubCommand(textMsg)
|
|
2146
2149
|
// delay(100)
|
|
2147
2150
|
// }
|
|
2151
|
+
|
|
2152
|
+
delay(300) // 300ms to settle
|
|
2153
|
+
restartMicIfAlreadyEnabled()
|
|
2148
2154
|
}
|
|
2149
2155
|
|
|
2150
2156
|
/**
|
|
@@ -2635,19 +2641,7 @@ class G2 : SGCManager() {
|
|
|
2635
2641
|
}
|
|
2636
2642
|
|
|
2637
2643
|
// Camera & Media - G2 has no camera
|
|
2638
|
-
override fun requestPhoto(
|
|
2639
|
-
requestId: String,
|
|
2640
|
-
appId: String,
|
|
2641
|
-
size: String,
|
|
2642
|
-
webhookUrl: String?,
|
|
2643
|
-
authToken: String?,
|
|
2644
|
-
compress: String?,
|
|
2645
|
-
flash: Boolean,
|
|
2646
|
-
save: Boolean,
|
|
2647
|
-
sound: Boolean,
|
|
2648
|
-
exposureTimeNs: Long?,
|
|
2649
|
-
iso: Int?,
|
|
2650
|
-
) {
|
|
2644
|
+
override fun requestPhoto(request: PhotoRequest) {
|
|
2651
2645
|
Bridge.log("G2: requestPhoto - not supported (no camera)")
|
|
2652
2646
|
}
|
|
2653
2647
|
|
|
@@ -3552,6 +3546,9 @@ class G2 : SGCManager() {
|
|
|
3552
3546
|
val reader = ProtobufReader(payload)
|
|
3553
3547
|
val fields = reader.parseFields()
|
|
3554
3548
|
|
|
3549
|
+
// print raw payload:
|
|
3550
|
+
Bridge.log("G2: EvenHub response payload: ${payload.joinToString("") { String.format("%02X", it) }}")
|
|
3551
|
+
|
|
3555
3552
|
val cmdValue =
|
|
3556
3553
|
fields[1] as? Int
|
|
3557
3554
|
?: run {
|