@mentra/bluetooth-sdk 3.3.0-dev.317 → 3.3.0-dev.320

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.
Files changed (46) hide show
  1. package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +368 -0
  2. package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocol.kt +156 -0
  3. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +37 -12
  4. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +30 -13
  5. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
  6. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +3 -2
  7. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Nimo.kt +257 -395
  8. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCodec.kt +245 -0
  9. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinator.kt +225 -0
  10. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasEncoder.kt +58 -0
  11. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSession.kt +168 -0
  12. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +8 -0
  13. package/android/src/main/java/com/mentra/bluetoothsdk/utils/G2Text.kt +7 -0
  14. package/android/src/release/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +20 -0
  15. package/android/src/test/java/com/mentra/bluetoothsdk/DeviceManagerSceneHandoffTest.kt +557 -0
  16. package/android/src/test/java/com/mentra/bluetoothsdk/G2TextTest.kt +13 -0
  17. package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoBitmapAcceptanceTest.kt +105 -0
  18. package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCodecTest.kt +220 -0
  19. package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinatorTest.kt +308 -0
  20. package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSessionTest.kt +270 -0
  21. package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnosticsTest.kt +287 -0
  22. package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocolTest.kt +127 -0
  23. package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoLifecycleTest.kt +194 -0
  24. package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoReadinessDriverTest.kt +199 -0
  25. package/build/generated/releaseMetadata.js +5 -5
  26. package/build/generated/releaseMetadata.js.map +1 -1
  27. package/ios/MentraBluetoothSDK.podspec +3 -2
  28. package/ios/Source/BluetoothSdkDefaults.swift +1 -1
  29. package/ios/Source/DeviceManager.swift +23 -10
  30. package/ios/Source/DeviceStore.swift +19 -7
  31. package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
  32. package/ios/Source/sgcs/G2.swift +2 -2
  33. package/ios/Source/sgcs/Nimo.swift +182 -371
  34. package/ios/Source/sgcs/NimoCanvasCodec.swift +269 -0
  35. package/ios/Source/sgcs/NimoCanvasCoordinator.swift +219 -0
  36. package/ios/Source/sgcs/NimoCanvasImage.swift +53 -0
  37. package/ios/Source/sgcs/NimoCanvasSession.swift +150 -0
  38. package/ios/Source/sgcs/SGCManager.swift +16 -0
  39. package/ios/Source/utils/G2Text.swift +11 -0
  40. package/ios/Tests/DashboardRenderingTests.swift +31 -0
  41. package/ios/Tests/G2TextTests.swift +10 -0
  42. package/ios/Tests/NimoCanvasCodecTests.swift +204 -0
  43. package/ios/Tests/NimoCanvasSessionTests.swift +112 -0
  44. package/ios/Tests/NimoCanvasTransportTests.swift +161 -0
  45. package/package.json +2 -2
  46. package/src/generated/releaseMetadata.ts +5 -5
@@ -219,14 +219,30 @@ object DeviceStore {
219
219
  }
220
220
 
221
221
  // BLUETOOTH:
222
+ "bluetooth" to "contextual_dashboard" -> {
223
+ if (value is Boolean) {
224
+ CoroutineScope(Dispatchers.Main.immediate).launch {
225
+ // The setting changes the selected view even without a new head event.
226
+ // Re-read state on Main and retain the manager's readiness/display guards.
227
+ if (store.get("glasses", "headUp") == true) {
228
+ DeviceManager.getInstance().sendCurrentState()
229
+ }
230
+ }
231
+ }
232
+ }
222
233
  "bluetooth" to "brightness" -> {
223
234
  val b = (value as? Number)?.toInt() ?: 50
224
235
  val auto = (store.get("bluetooth", "auto_brightness") as? Boolean) ?: true
225
236
  CoroutineScope(Dispatchers.Main).launch {
226
- DeviceManager.getInstance().sgc?.setBrightness(b, auto)
227
- DeviceManager.getInstance().sgc?.sendTextWall("Set brightness to $b%")
228
- delay(800) // 0.8 seconds
229
- DeviceManager.getInstance().sgc?.clearDisplay()
237
+ val device = DeviceManager.getInstance().sgc ?: return@launch
238
+ device.setBrightness(b, auto)
239
+ if (device.showBrightnessConfirmation) {
240
+ device.sendTextWall("Set brightness to $b%")
241
+ delay(800) // 0.8 seconds
242
+ if (DeviceManager.getInstance().sgc === device) {
243
+ device.clearDisplay()
244
+ }
245
+ }
230
246
  }
231
247
  }
232
248
  "bluetooth" to "auto_brightness" -> {
@@ -234,16 +250,17 @@ object DeviceStore {
234
250
  val auto = (value as? Boolean) ?: true
235
251
  val autoBrightnessChanged = (oldValue as? Boolean) != auto
236
252
  CoroutineScope(Dispatchers.Main).launch {
237
- DeviceManager.getInstance().sgc?.setBrightness(b, auto)
238
- if (autoBrightnessChanged) {
239
- DeviceManager.getInstance()
240
- .sgc
241
- ?.sendTextWall(
242
- if (auto) "Enabled auto brightness"
243
- else "Disabled auto brightness"
244
- )
253
+ val device = DeviceManager.getInstance().sgc ?: return@launch
254
+ device.setBrightness(b, auto)
255
+ if (autoBrightnessChanged && device.showBrightnessConfirmation) {
256
+ device.sendTextWall(
257
+ if (auto) "Enabled auto brightness"
258
+ else "Disabled auto brightness"
259
+ )
245
260
  delay(800) // 0.8 seconds
246
- DeviceManager.getInstance().sgc?.clearDisplay()
261
+ if (DeviceManager.getInstance().sgc === device) {
262
+ device.clearDisplay()
263
+ }
247
264
  }
248
265
  }
249
266
  }
@@ -3,9 +3,9 @@ package com.mentra.bluetoothsdk
3
3
  /** Generated by release CI. Do not edit in a release checkout. */
4
4
  internal object GeneratedReleaseMetadata {
5
5
  const val FAMILY_BASE_VERSION: String = "3.3.0"
6
- const val RELEASE_IDENTITY: String = "3.3.0-dev.317"
7
- const val RELEASE_SET_ID: String = "mentra-3.3.0-dev.317"
8
- const val SOURCE_COMMIT: String = "f5be01b015898d019a200369c824eddba5f0f802"
9
- const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.317.json"
10
- const val OTA_MANIFEST_SHA256: String = "573b09239a97f0bbeb03a53b460e89a71ad62c7aad4f32dc93fd042cfb6d03d2"
6
+ const val RELEASE_IDENTITY: String = "3.3.0-dev.320"
7
+ const val RELEASE_SET_ID: String = "mentra-3.3.0-dev.320"
8
+ const val SOURCE_COMMIT: String = "09b74eac29a0f25515856bc31ca48fee514537e5"
9
+ const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.320.json"
10
+ const val OTA_MANIFEST_SHA256: String = "217126614245f133053a9c340003bb4d75dc7812271f723d56ed90a855cc3464"
11
11
  }
@@ -1,5 +1,6 @@
1
1
  package com.mentra.bluetoothsdk.sgcs
2
2
 
3
+ import com.mentra.bluetoothsdk.utils.G2Text
3
4
  import com.mentra.bluetoothsdk.PhotoRequest
4
5
  import android.bluetooth.BluetoothAdapter
5
6
  import android.bluetooth.BluetoothGatt
@@ -2190,7 +2191,7 @@ class G2 : SGCManager() {
2190
2191
  val rBorderColor = borderColor ?: defaultTextBorderColor
2191
2192
  val rBorderRadius = borderRadius ?: defaultTextBorderRadius
2192
2193
  val rPaddingLength = paddingLength ?: defaultTextPaddingLength
2193
- val content = if (text.isEmpty()) " " else text
2194
+ val content = G2Text.containerContent(text)
2194
2195
 
2195
2196
  // Pure state mutation: update the container's content and schedule its sends; the reconcile
2196
2197
  // loop does the actual updateText writes. Reuse an existing container if the rect matches
@@ -2538,7 +2539,7 @@ class G2 : SGCManager() {
2538
2539
  @Suppress("NAME_SHADOWING")
2539
2540
  val height = minOf(maxOf(height, minTextContainerHeight), 288 - y)
2540
2541
  run {
2541
- val content = if (text.isEmpty()) " " else text
2542
+ val content = G2Text.containerContent(text)
2542
2543
  val existingId = sceneTextByElement[elementId]
2543
2544
  if (existingId != null) {
2544
2545
  val idx = textContainers.indexOfFirst { it.id == existingId }