@mentra/bluetooth-sdk 0.1.6 → 0.1.7

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 (79) hide show
  1. package/README.md +16 -14
  2. package/android/build.gradle +2 -9
  3. package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +40 -31
  4. package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +22 -9
  5. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +25 -36
  6. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +8 -4
  7. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +34 -10
  8. package/android/src/main/java/com/mentra/bluetoothsdk/audio/AudioModels.kt +6 -6
  9. package/android/src/main/java/com/mentra/bluetoothsdk/camera/CameraModels.kt +29 -7
  10. package/android/src/main/java/com/mentra/bluetoothsdk/controllers/ControllerManager.kt +4 -3
  11. package/android/src/main/java/com/mentra/bluetoothsdk/controllers/R1.kt +2 -1
  12. package/android/src/main/java/com/mentra/bluetoothsdk/events/BluetoothEvents.kt +12 -0
  13. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.java +1 -1
  14. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +2 -1
  15. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Mach1.java +1 -1
  16. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.java +168 -10
  17. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +1 -1
  18. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +7 -3
  19. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Simulated.kt +3 -1
  20. package/android/src/main/java/com/mentra/bluetoothsdk/status/DeviceStatus.kt +14 -12
  21. package/android/src/main/java/com/mentra/bluetoothsdk/status/RuntimeState.kt +4 -2
  22. package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamModels.kt +3 -3
  23. package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +1 -3
  24. package/build/BluetoothSdk.types.d.ts +42 -20
  25. package/build/BluetoothSdk.types.d.ts.map +1 -1
  26. package/build/BluetoothSdk.types.js +1 -0
  27. package/build/BluetoothSdk.types.js.map +1 -1
  28. package/build/_private/BluetoothSdkModule.d.ts +6 -5
  29. package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
  30. package/build/_private/BluetoothSdkModule.js +37 -5
  31. package/build/_private/BluetoothSdkModule.js.map +1 -1
  32. package/build/index.d.ts +1 -1
  33. package/build/index.d.ts.map +1 -1
  34. package/build/index.js +4 -2
  35. package/build/index.js.map +1 -1
  36. package/build/react/useMentraBluetooth.d.ts +5 -3
  37. package/build/react/useMentraBluetooth.d.ts.map +1 -1
  38. package/build/react/useMentraBluetooth.js +15 -4
  39. package/build/react/useMentraBluetooth.js.map +1 -1
  40. package/ios/BluetoothSdkModule.swift +41 -24
  41. package/ios/MentraBluetoothSDK.podspec +0 -3
  42. package/ios/Source/Audio/AudioModels.swift +10 -10
  43. package/ios/Source/Bridge.swift +22 -11
  44. package/ios/Source/Camera/CameraModels.swift +13 -11
  45. package/ios/Source/DeviceManager.swift +20 -97
  46. package/ios/Source/DeviceStore.swift +12 -4
  47. package/ios/Source/Events/BluetoothEvents.swift +34 -0
  48. package/ios/Source/MentraBluetoothSDK.swift +25 -10
  49. package/ios/Source/Status/DeviceStatus.swift +12 -4
  50. package/ios/Source/Status/RuntimeState.swift +22 -13
  51. package/ios/Source/Streaming/StreamModels.swift +5 -5
  52. package/ios/Source/controllers/ControllerManager.swift +3 -3
  53. package/ios/Source/controllers/R1.swift +1 -1
  54. package/ios/Source/sgcs/G1.swift +1 -1
  55. package/ios/Source/sgcs/G2.swift +2 -3
  56. package/ios/Source/sgcs/Mach1.swift +1 -1
  57. package/ios/Source/sgcs/MentraLive.swift +109 -12
  58. package/ios/Source/sgcs/MentraNex.swift +1 -1
  59. package/ios/Source/sgcs/SGCManager.swift +11 -3
  60. package/ios/Source/sgcs/Simulated.swift +2 -2
  61. package/ios/Source/stt/SherpaOnnxTranscriber.swift +1 -4
  62. package/package.json +1 -1
  63. package/src/BluetoothSdk.types.ts +44 -28
  64. package/src/_private/BluetoothSdkModule.ts +44 -21
  65. package/src/index.ts +6 -4
  66. package/src/react/useMentraBluetooth.ts +19 -7
  67. package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +0 -221
  68. package/ios/Packages/VAD/Common/VAD/VADQuality.swift +0 -41
  69. package/ios/Packages/VAD/Common/VAD/VADState.swift +0 -26
  70. package/ios/Packages/VAD/Common/VAD/VADStrategy.swift +0 -29
  71. package/ios/Packages/VAD/Common/VAD/VADType.swift +0 -14
  72. package/ios/Packages/VAD/Data/Configuration.swift +0 -68
  73. package/ios/Packages/VAD/Data/FrameSize.swift +0 -39
  74. package/ios/Packages/VAD/Data/Record.swift +0 -13
  75. package/ios/Packages/VAD/Data/Result.swift +0 -22
  76. package/ios/Packages/VAD/Data/SampleRate.swift +0 -48
  77. package/ios/Packages/VAD/Silero/Model/silero_vad.onnx +0 -0
  78. package/ios/Packages/VAD/Silero/SileroVAD.swift +0 -284
  79. package/ios/Packages/VAD/Silero/SileroVADStrategy.swift +0 -64
@@ -28,6 +28,7 @@ class DeviceStore {
28
28
  store.set("glasses", "deviceModel", "")
29
29
  store.set("glasses", "firmwareVersion", "")
30
30
  store.set("glasses", "micEnabled", false)
31
+ store.set("glasses", "voiceActivityDetectionEnabled", true)
31
32
  store.set("glasses", "bluetoothClassicConnected", false)
32
33
  store.set("glasses", "caseRemoved", true)
33
34
  store.set("glasses", "caseOpen", true)
@@ -71,21 +72,26 @@ class DeviceStore {
71
72
  store.set("bluetooth", "pending_wearable", "")
72
73
  store.set("bluetooth", "device_name", "")
73
74
  store.set("bluetooth", "device_address", "")
75
+ store.set("bluetooth", "default_controller", "")
76
+ store.set("bluetooth", "pending_controller", "")
77
+ store.set("bluetooth", "controller_device_name", "")
74
78
  store.set("bluetooth", "screen_disabled", false)
75
79
  store.set("bluetooth", "preferred_mic", "auto")
76
80
  store.set("bluetooth", "sensing_enabled", true)
81
+ store.set("bluetooth", "power_saving_mode", false)
77
82
  store.set("bluetooth", "brightness", 50)
78
83
  store.set("bluetooth", "auto_brightness", true)
79
84
  store.set("bluetooth", "dashboard_height", 4)
80
85
  store.set("bluetooth", "dashboard_depth", 2)
81
86
  store.set("bluetooth", "head_up_angle", 30)
82
87
  store.set("bluetooth", "contextual_dashboard", true)
83
- store.set("bluetooth", "galleryModeAuto", true)
88
+ store.set("bluetooth", "gallery_mode", true)
89
+ store.set("bluetooth", "voice_activity_detection_enabled", true)
84
90
  store.set("bluetooth", "screen_disabled", false)
85
91
  store.set("bluetooth", "button_photo_size", "medium")
86
92
  store.set("bluetooth", "button_camera_led", true)
87
93
  store.set("bluetooth", "button_max_recording_time", 10)
88
- store.set("bluetooth", "camera_fov", ["fov": 118, "roiPosition": 0])
94
+ store.set("bluetooth", "camera_fov", ["fov": 118, "roi_position": 0])
89
95
  store.set("bluetooth", "button_video_width", 1280)
90
96
  store.set("bluetooth", "button_video_height", 720)
91
97
  store.set("bluetooth", "button_video_fps", 30)
@@ -96,7 +102,6 @@ class DeviceStore {
96
102
  store.set("bluetooth", "should_send_pcm", false)
97
103
  store.set("bluetooth", "should_send_lc3", false)
98
104
  store.set("bluetooth", "should_send_transcript", false)
99
- store.set("bluetooth", "bypass_vad", true)
100
105
  store.set("bluetooth", "use_native_dashboard", false)
101
106
  }
102
107
 
@@ -215,9 +220,12 @@ class DeviceStore {
215
220
  DeviceManager.shared.sgc?.setDashboardMenu(items)
216
221
  }
217
222
 
218
- case ("bluetooth", "galleryModeAuto"):
223
+ case ("bluetooth", "gallery_mode"):
219
224
  DeviceManager.shared.sgc?.sendGalleryMode()
220
225
 
226
+ case ("bluetooth", "voice_activity_detection_enabled"):
227
+ DeviceManager.shared.sgc?.sendVoiceActivityDetectionSetting()
228
+
221
229
  case ("bluetooth", "screen_disabled"):
222
230
  if let disabled = value as? Bool {
223
231
  if disabled {
@@ -44,9 +44,39 @@ public struct TouchEvent: CustomStringConvertible {
44
44
  }
45
45
  }
46
46
 
47
+ public struct VoiceActivityDetectionStatusEvent: CustomStringConvertible {
48
+ public let voiceActivityDetectionEnabled: Bool
49
+ public let values: [String: Any]
50
+
51
+ public init(values: [String: Any]) {
52
+ voiceActivityDetectionEnabled = boolValue(values, "voiceActivityDetectionEnabled") ?? true
53
+ self.values = values
54
+ }
55
+
56
+ public var description: String {
57
+ "VoiceActivityDetectionStatusEvent(voiceActivityDetectionEnabled: \(voiceActivityDetectionEnabled))"
58
+ }
59
+ }
60
+
61
+ public struct SpeakingStatusEvent: CustomStringConvertible {
62
+ public let speaking: Bool
63
+ public let values: [String: Any]
64
+
65
+ public init(values: [String: Any]) {
66
+ speaking = boolValue(values, "speaking") ?? false
67
+ self.values = values
68
+ }
69
+
70
+ public var description: String {
71
+ "SpeakingStatusEvent(speaking: \(speaking))"
72
+ }
73
+ }
74
+
47
75
  public enum BluetoothEvent: CustomStringConvertible {
48
76
  case buttonPress(ButtonPressEvent)
49
77
  case touch(TouchEvent)
78
+ case voiceActivityDetectionStatus(VoiceActivityDetectionStatusEvent)
79
+ case speakingStatus(SpeakingStatusEvent)
50
80
  case wifiStatus(WifiStatusEvent)
51
81
  case hotspotStatus(HotspotStatusEvent)
52
82
  case hotspotError(HotspotErrorEvent)
@@ -62,6 +92,10 @@ public enum BluetoothEvent: CustomStringConvertible {
62
92
  event.description
63
93
  case let .touch(event):
64
94
  event.description
95
+ case let .voiceActivityDetectionStatus(event):
96
+ event.description
97
+ case let .speakingStatus(event):
98
+ event.description
65
99
  case let .wifiStatus(event):
66
100
  event.description
67
101
  case let .hotspotStatus(event):
@@ -268,8 +268,12 @@ public final class MentraBluetoothSDK {
268
268
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "screen_disabled", disabled)
269
269
  }
270
270
 
271
- public func setGalleryMode(_ mode: GalleryMode) async throws {
272
- DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "galleryModeAuto", mode == .auto)
271
+ public func setGalleryModeEnabled(_ enabled: Bool) async throws {
272
+ DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "gallery_mode", enabled)
273
+ }
274
+
275
+ public func setVoiceActivityDetectionEnabled(_ enabled: Bool) async throws {
276
+ DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "voice_activity_detection_enabled", enabled)
273
277
  }
274
278
 
275
279
  public func setButtonPhotoSettings(size: ButtonPhotoSize) async throws {
@@ -280,14 +284,14 @@ public final class MentraBluetoothSDK {
280
284
  try await setButtonPhotoSettings(size: settings.size)
281
285
  }
282
286
 
283
- public func setButtonVideoRecordingSettings(width: Int, height: Int, frameRate: Int) async throws {
287
+ public func setButtonVideoRecordingSettings(width: Int, height: Int, fps: Int) async throws {
284
288
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "button_video_width", width)
285
289
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "button_video_height", height)
286
- DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "button_video_fps", frameRate)
290
+ DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "button_video_fps", fps)
287
291
  }
288
292
 
289
293
  public func setButtonVideoRecordingSettings(_ settings: ButtonVideoRecordingSettings) async throws {
290
- try await setButtonVideoRecordingSettings(width: settings.width, height: settings.height, frameRate: settings.frameRate)
294
+ try await setButtonVideoRecordingSettings(width: settings.width, height: settings.height, fps: settings.fps)
291
295
  }
292
296
 
293
297
  public func setButtonCameraLed(enabled: Bool) async throws {
@@ -305,7 +309,6 @@ public final class MentraBluetoothSDK {
305
309
  public func setMicState(
306
310
  enabled: Bool,
307
311
  useGlassesMic: Bool = true,
308
- bypassVad: Bool = true,
309
312
  sendTranscript: Bool = false,
310
313
  sendLc3Data: Bool = false
311
314
  ) {
@@ -319,7 +322,6 @@ public final class MentraBluetoothSDK {
319
322
  applyMicState(
320
323
  sendPcmData: enabled,
321
324
  sendTranscript: enabled && sendTranscript,
322
- bypassVad: bypassVad,
323
325
  sendLc3Data: enabled && sendLc3Data
324
326
  )
325
327
  }
@@ -327,13 +329,11 @@ public final class MentraBluetoothSDK {
327
329
  private func applyMicState(
328
330
  sendPcmData: Bool,
329
331
  sendTranscript: Bool,
330
- bypassVad: Bool,
331
332
  sendLc3Data: Bool
332
333
  ) {
333
334
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "should_send_pcm", sendPcmData)
334
335
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "should_send_lc3", sendLc3Data)
335
336
  DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "should_send_transcript", sendTranscript)
336
- DeviceStore.shared.apply(ObservableStore.bluetoothCategory, "bypass_vad", bypassVad)
337
337
  DeviceManager.shared.setMicState()
338
338
  }
339
339
 
@@ -376,6 +376,9 @@ public final class MentraBluetoothSDK {
376
376
  }
377
377
 
378
378
  public func requestPhoto(_ request: PhotoRequest) {
379
+ Bridge.log(
380
+ "NATIVE: PHOTO PIPELINE [3b/6] MentraBluetoothSdk.requestPhoto requestId=\(request.requestId) appId=\(request.appId)"
381
+ )
379
382
  DeviceManager.shared.requestPhoto(
380
383
  request.requestId,
381
384
  request.appId,
@@ -383,7 +386,9 @@ public final class MentraBluetoothSDK {
383
386
  request.webhookUrl,
384
387
  request.authToken,
385
388
  request.compress?.rawValue,
386
- request.sound
389
+ request.flash,
390
+ request.sound,
391
+ exposureTimeNs: request.exposureTimeNs
387
392
  )
388
393
  }
389
394
 
@@ -573,6 +578,16 @@ public final class MentraBluetoothSDK {
573
578
  values: data
574
579
  )
575
580
  delegate?.mentraBluetoothSDK(self, didReceive: .localTranscription(event))
581
+ case "voice_activity_detection_status":
582
+ delegate?.mentraBluetoothSDK(
583
+ self,
584
+ didReceive: .voiceActivityDetectionStatus(VoiceActivityDetectionStatusEvent(values: data))
585
+ )
586
+ case "speaking_status":
587
+ delegate?.mentraBluetoothSDK(
588
+ self,
589
+ didReceive: .speakingStatus(SpeakingStatusEvent(values: data))
590
+ )
576
591
  case "hotspot_status_change":
577
592
  delegate?.mentraBluetoothSDK(self, didReceive: .hotspotStatus(HotspotStatusEvent(values: data)))
578
593
  case "wifi_status_change":
@@ -133,6 +133,7 @@ struct GlassesStatus: CustomStringConvertible {
133
133
  var fullyBooted: Bool { boolValue(values, "fullyBooted") ?? false }
134
134
  var connected: Bool { boolValue(values, "connected") ?? false }
135
135
  var micEnabled: Bool { boolValue(values, "micEnabled") ?? false }
136
+ var voiceActivityDetectionEnabled: Bool { boolValue(values, "voiceActivityDetectionEnabled") ?? true }
136
137
  var connectionState: GlassesConnectionState { GlassesConnectionState(stringValue(values, "connectionState")) }
137
138
  var bluetoothClassicConnected: Bool { boolValue(values, "bluetoothClassicConnected") ?? false }
138
139
  var signalStrength: Int { intValue(values["signalStrength"]) ?? -1 }
@@ -246,6 +247,10 @@ struct BluetoothStatus: CustomStringConvertible {
246
247
  if let searchResults = values["searchResults"] as? [[String: Any]] {
247
248
  normalizedValues["searchResults"] = searchResults.compactMap { Device(values: $0)?.dictionary }
248
249
  }
250
+ if let galleryMode = boolValue(values, "gallery_mode") {
251
+ normalizedValues["galleryModeEnabled"] = galleryMode
252
+ normalizedValues.removeValue(forKey: "gallery_mode")
253
+ }
249
254
  return normalizedValues
250
255
  }
251
256
 
@@ -294,7 +299,7 @@ struct BluetoothStatus: CustomStringConvertible {
294
299
  var dashboardDepth: Int { intValue(values["dashboard_depth"]) ?? 2 }
295
300
  var headUpAngle: Int { intValue(values["head_up_angle"]) ?? 30 }
296
301
  var contextualDashboard: Bool { boolValue(values, "contextual_dashboard") ?? true }
297
- var galleryModeAuto: Bool { boolValue(values, "galleryModeAuto") ?? true }
302
+ var galleryModeEnabled: Bool { boolValue(values, "gallery_mode") ?? boolValue(values, "galleryModeEnabled") ?? true }
298
303
  var buttonPhotoSize: ButtonPhotoSize {
299
304
  ButtonPhotoSize(rawValue: stringValue(values, "button_photo_size") ?? "") ?? .medium
300
305
  }
@@ -306,7 +311,6 @@ struct BluetoothStatus: CustomStringConvertible {
306
311
  var shouldSendPcm: Bool { boolValue(values, "should_send_pcm") ?? false }
307
312
  var shouldSendLc3: Bool { boolValue(values, "should_send_lc3") ?? false }
308
313
  var shouldSendTranscript: Bool { boolValue(values, "should_send_transcript") ?? false }
309
- var bypassVad: Bool { boolValue(values, "bypass_vad") ?? true }
310
314
  var offlineCaptionsRunning: Bool { boolValue(values, "offline_captions_running") ?? false }
311
315
  var localSttFallbackActive: Bool { boolValue(values, "local_stt_fallback_active") ?? false }
312
316
  var shouldSendBootingMessage: Bool { boolValue(values, "shouldSendBootingMessage") ?? true }
@@ -335,6 +339,7 @@ struct GlassesStatusUpdate: CustomStringConvertible {
335
339
  var fullyBooted: Bool? { optionalBoolValue(values, "fullyBooted") }
336
340
  var connected: Bool? { optionalBoolValue(values, "connected") }
337
341
  var micEnabled: Bool? { optionalBoolValue(values, "micEnabled") }
342
+ var voiceActivityDetectionEnabled: Bool? { optionalBoolValue(values, "voiceActivityDetectionEnabled") }
338
343
  var connectionState: GlassesConnectionState? {
339
344
  GlassesConnectionState.fromValue(optionalStringValue(values, "connectionState"))
340
345
  }
@@ -403,6 +408,10 @@ struct BluetoothStatusUpdate: CustomStringConvertible {
403
408
  if let searchResults = values["searchResults"] as? [[String: Any]] {
404
409
  normalizedValues["searchResults"] = searchResults.compactMap { Device(values: $0)?.dictionary }
405
410
  }
411
+ if let galleryMode = optionalBoolValue(values, "gallery_mode") {
412
+ normalizedValues["galleryModeEnabled"] = galleryMode
413
+ normalizedValues.removeValue(forKey: "gallery_mode")
414
+ }
406
415
  self.values = normalizedValues
407
416
  }
408
417
 
@@ -440,7 +449,7 @@ struct BluetoothStatusUpdate: CustomStringConvertible {
440
449
  var dashboardDepth: Int? { optionalIntValue(values, "dashboard_depth") }
441
450
  var headUpAngle: Int? { optionalIntValue(values, "head_up_angle") }
442
451
  var contextualDashboard: Bool? { optionalBoolValue(values, "contextual_dashboard") }
443
- var galleryModeAuto: Bool? { optionalBoolValue(values, "galleryModeAuto") }
452
+ var galleryModeEnabled: Bool? { optionalBoolValue(values, "gallery_mode") ?? optionalBoolValue(values, "galleryModeEnabled") }
444
453
  var buttonPhotoSize: ButtonPhotoSize? {
445
454
  optionalStringValue(values, "button_photo_size").flatMap(ButtonPhotoSize.init(rawValue:))
446
455
  }
@@ -452,7 +461,6 @@ struct BluetoothStatusUpdate: CustomStringConvertible {
452
461
  var shouldSendPcm: Bool? { optionalBoolValue(values, "should_send_pcm") }
453
462
  var shouldSendLc3: Bool? { optionalBoolValue(values, "should_send_lc3") }
454
463
  var shouldSendTranscript: Bool? { optionalBoolValue(values, "should_send_transcript") }
455
- var bypassVad: Bool? { optionalBoolValue(values, "bypass_vad") }
456
464
  var offlineCaptionsRunning: Bool? { optionalBoolValue(values, "offline_captions_running") }
457
465
  var localSttFallbackActive: Bool? { optionalBoolValue(values, "local_stt_fallback_active") }
458
466
  var shouldSendBootingMessage: Bool? { optionalBoolValue(values, "shouldSendBootingMessage") }
@@ -121,6 +121,7 @@ public enum GlassesRuntimeState: CustomStringConvertible {
121
121
  hotspot: HotspotStatus,
122
122
  ready: Bool,
123
123
  signal: SignalState,
124
+ voiceActivityDetectionEnabled: Bool,
124
125
  wifi: WifiStatus
125
126
  )
126
127
 
@@ -153,6 +154,7 @@ public enum GlassesRuntimeState: CustomStringConvertible {
153
154
  strengthDbm: status.signalStrength == -1 ? nil : status.signalStrength,
154
155
  updatedAt: status.signalStrengthUpdatedAt <= 0 ? nil : status.signalStrengthUpdatedAt
155
156
  ),
157
+ voiceActivityDetectionEnabled: status.voiceActivityDetectionEnabled,
156
158
  wifi: status.wifi
157
159
  )
158
160
  }
@@ -168,7 +170,7 @@ public enum GlassesRuntimeState: CustomStringConvertible {
168
170
  switch self {
169
171
  case let .disconnected(connection):
170
172
  connection
171
- case let .connected(_, connection, _, _, _, _, _, _):
173
+ case let .connected(_, connection, _, _, _, _, _, _, _):
172
174
  connection
173
175
  }
174
176
  }
@@ -177,48 +179,55 @@ public enum GlassesRuntimeState: CustomStringConvertible {
177
179
  switch self {
178
180
  case .disconnected:
179
181
  false
180
- case let .connected(_, _, _, _, _, ready, _, _):
182
+ case let .connected(_, _, _, _, _, ready, _, _, _):
181
183
  ready
182
184
  }
183
185
  }
184
186
 
185
187
  public var battery: GlassesBatteryState? {
186
- guard case let .connected(battery, _, _, _, _, _, _, _) = self else {
188
+ guard case let .connected(battery, _, _, _, _, _, _, _, _) = self else {
187
189
  return nil
188
190
  }
189
191
  return battery
190
192
  }
191
193
 
192
194
  public var device: ConnectedGlassesInfo? {
193
- guard case let .connected(_, _, device, _, _, _, _, _) = self else {
195
+ guard case let .connected(_, _, device, _, _, _, _, _, _) = self else {
194
196
  return nil
195
197
  }
196
198
  return device
197
199
  }
198
200
 
199
201
  public var firmware: FirmwareInfo? {
200
- guard case let .connected(_, _, _, firmware, _, _, _, _) = self else {
202
+ guard case let .connected(_, _, _, firmware, _, _, _, _, _) = self else {
201
203
  return nil
202
204
  }
203
205
  return firmware
204
206
  }
205
207
 
206
208
  public var hotspot: HotspotStatus? {
207
- guard case let .connected(_, _, _, _, hotspot, _, _, _) = self else {
209
+ guard case let .connected(_, _, _, _, hotspot, _, _, _, _) = self else {
208
210
  return nil
209
211
  }
210
212
  return hotspot
211
213
  }
212
214
 
213
215
  public var signal: SignalState? {
214
- guard case let .connected(_, _, _, _, _, _, signal, _) = self else {
216
+ guard case let .connected(_, _, _, _, _, _, signal, _, _) = self else {
215
217
  return nil
216
218
  }
217
219
  return signal
218
220
  }
219
221
 
222
+ public var voiceActivityDetectionEnabled: Bool {
223
+ guard case let .connected(_, _, _, _, _, _, _, voiceActivityDetectionEnabled, _) = self else {
224
+ return false
225
+ }
226
+ return voiceActivityDetectionEnabled
227
+ }
228
+
220
229
  public var wifi: WifiStatus? {
221
- guard case let .connected(_, _, _, _, _, _, _, wifi) = self else {
230
+ guard case let .connected(_, _, _, _, _, _, _, _, wifi) = self else {
222
231
  return nil
223
232
  }
224
233
  return wifi
@@ -228,17 +237,17 @@ public enum GlassesRuntimeState: CustomStringConvertible {
228
237
  switch self {
229
238
  case let .disconnected(connection):
230
239
  "GlassesRuntimeState(\(connection.rawValue))"
231
- case let .connected(_, _, device, _, _, ready, _, _):
240
+ case let .connected(_, _, device, _, _, ready, _, _, _):
232
241
  "GlassesRuntimeState(connected: \(device), ready: \(ready))"
233
242
  }
234
243
  }
235
244
  }
236
245
 
237
246
  public struct GalleryModeState: Equatable {
238
- public let desired: GalleryMode
247
+ public let enabled: Bool
239
248
 
240
- public init(desired: GalleryMode) {
241
- self.desired = desired
249
+ public init(enabled: Bool) {
250
+ self.enabled = enabled
242
251
  }
243
252
  }
244
253
 
@@ -288,7 +297,7 @@ public struct PhoneSdkRuntimeState: CustomStringConvertible {
288
297
  init(status: BluetoothStatus) {
289
298
  currentMic = MicMode(rawValue: status.currentMic)
290
299
  defaultDevice = status.defaultDevice
291
- galleryMode = GalleryModeState(desired: status.galleryModeAuto ? .auto : .manual)
300
+ galleryMode = GalleryModeState(enabled: status.galleryModeEnabled)
292
301
  lastLog = status.lastLog
293
302
  micRanking = status.micRanking.compactMap(MicMode.init(rawValue:))
294
303
  otherBluetoothConnected = status.otherBtConnected
@@ -4,18 +4,18 @@ public struct StreamVideoConfig {
4
4
  public let width: Int?
5
5
  public let height: Int?
6
6
  public let bitrate: Int?
7
- public let frameRate: Int?
7
+ public let fps: Int?
8
8
 
9
9
  public init(
10
10
  width: Int? = nil,
11
11
  height: Int? = nil,
12
12
  bitrate: Int? = nil,
13
- frameRate: Int? = nil
13
+ fps: Int? = nil
14
14
  ) {
15
15
  self.width = width
16
16
  self.height = height
17
17
  self.bitrate = bitrate
18
- self.frameRate = frameRate
18
+ self.fps = fps
19
19
  }
20
20
 
21
21
  var dictionary: [String: Any] {
@@ -23,7 +23,7 @@ public struct StreamVideoConfig {
23
23
  if let width { values["width"] = width }
24
24
  if let height { values["height"] = height }
25
25
  if let bitrate { values["bitrate"] = bitrate }
26
- if let frameRate { values["frameRate"] = frameRate }
26
+ if let fps { values["frameRate"] = fps }
27
27
  return values
28
28
  }
29
29
 
@@ -33,7 +33,7 @@ public struct StreamVideoConfig {
33
33
  width: intValue(values["width"]),
34
34
  height: intValue(values["height"]),
35
35
  bitrate: intValue(values["bitrate"]),
36
- frameRate: intValue(values["frameRate"])
36
+ fps: intValue(values["fps"])
37
37
  )
38
38
  }
39
39
  }
@@ -20,7 +20,7 @@ protocol ControllerManager {
20
20
 
21
21
  func requestPhoto(
22
22
  _ requestId: String, appId: String, size: String?, webhookUrl: String?, authToken: String?,
23
- compress: String?, flash: Bool, sound: Bool
23
+ compress: String?, flash: Bool, sound: Bool, exposureTimeNs: Double?
24
24
  )
25
25
  func startStream(_ message: [String: Any])
26
26
  func stopStream()
@@ -153,8 +153,8 @@ extension ControllerManager {
153
153
  DeviceStore.shared.get("glasses", "micEnabled") as? Bool ?? false
154
154
  }
155
155
 
156
- var vadEnabled: Bool {
157
- DeviceStore.shared.get("glasses", "vadEnabled") as? Bool ?? false
156
+ var voiceActivityDetectionEnabled: Bool {
157
+ DeviceStore.shared.get("glasses", "voiceActivityDetectionEnabled") as? Bool ?? true
158
158
  }
159
159
 
160
160
  var batteryLevel: Int {
@@ -503,7 +503,7 @@ class R1: NSObject, ControllerManager {
503
503
  func sendJson(_: [String: Any], wakeUp _: Bool, requireAck _: Bool) {}
504
504
  func requestPhoto(
505
505
  _: String, appId _: String, size _: String?, webhookUrl _: String?, authToken _: String?,
506
- compress _: String?, flash _: Bool, sound _: Bool
506
+ compress _: String?, flash _: Bool, sound _: Bool, exposureTimeNs _: Double?
507
507
  ) {}
508
508
  func startVideoRecording(requestId _: String, save _: Bool, flash _: Bool, sound _: Bool) {}
509
509
  func stopVideoRecording(requestId _: String) {}
@@ -278,7 +278,7 @@ class G1: NSObject, SGCManager {
278
278
 
279
279
  func requestPhoto(
280
280
  _: String, appId _: String, size _: String?, webhookUrl _: String?, authToken _: String?,
281
- compress _: String?, flash _: Bool, sound _: Bool
281
+ compress _: String?, flash _: Bool, sound _: Bool, exposureTimeNs _: Double?
282
282
  ) {}
283
283
 
284
284
  func startStream(_: [String: Any]) {}
@@ -1454,8 +1454,7 @@ class G2: NSObject, SGCManager {
1454
1454
  DeviceStore.shared.apply("glasses", "bluetoothName", btName)
1455
1455
  DeviceStore.shared.apply("glasses", "deviceModel", DeviceTypes.G2)
1456
1456
 
1457
- DeviceStore.shared.apply("glasses", "connected", true)
1458
- DeviceStore.shared.apply("glasses", "fullyBooted", true)
1457
+ self.setFullyConnected()
1459
1458
 
1460
1459
  // connnect a controller if we have one:
1461
1460
  self.connectController()
@@ -2648,7 +2647,7 @@ class G2: NSObject, SGCManager {
2648
2647
 
2649
2648
  func requestPhoto(
2650
2649
  _: String, appId _: String, size _: String?, webhookUrl _: String?, authToken _: String?,
2651
- compress _: String?, flash _: Bool, sound _: Bool
2650
+ compress _: String?, flash _: Bool, sound _: Bool, exposureTimeNs _: Double?
2652
2651
  ) {}
2653
2652
  func startVideoRecording(requestId _: String, save _: Bool, flash _: Bool, sound _: Bool) {}
2654
2653
  func startStream(_: [String: Any]) {}
@@ -17,7 +17,7 @@ class Mach1: UltraliteBaseViewController, SGCManager {
17
17
 
18
18
  func requestPhoto(
19
19
  _: String, appId _: String, size _: String?, webhookUrl _: String?, authToken _: String?,
20
- compress _: String?, flash _: Bool, sound _: Bool
20
+ compress _: String?, flash _: Bool, sound _: Bool, exposureTimeNs _: Double?
21
21
  ) {}
22
22
 
23
23
  func sendGalleryMode() {}