@mentra/bluetooth-sdk 3.3.0 → 3.4.0-beta.1241
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/MIGRATION.md +61 -0
- package/README.md +80 -11
- package/android/build.gradle +60 -51
- package/android/gradle.properties +3 -0
- package/android/settings.gradle +47 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/BesCrashReportWaiters.kt +68 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkDefaults.kt +5 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +85 -6
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +35 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +154 -110
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +21 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedChangelogCatalog.kt +1 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +6 -6
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +27 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/connection/ConnectionModels.kt +5 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/events/BluetoothEvents.kt +16 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/GlassesAudioSetupPolicy.kt +64 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +925 -155
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLiveOwnerLossPolicy.kt +227 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingAdvertisement.kt +19 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingReadinessPolicy.kt +94 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingStateMachine.kt +411 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingStateStore.kt +124 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Nimo.kt +54 -59
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinator.kt +5 -32
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasEncoder.kt +8 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSession.kt +3 -10
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +6 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/status/DeviceStatus.kt +50 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/BoundedAudioQueue.kt +92 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/OnDeviceRecognizerHost.kt +169 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/STTTools.kt +74 -115
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +348 -357
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SpeechActivityDetector.kt +211 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SpeechActivityEngine.kt +137 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/SttTextFormatter.kt +52 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/WakeWordDetector.kt +235 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/AvifExifStripper.java +2 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +3 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +11 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/AudioRouteWatcher.kt +120 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PcmStreamPlayer.kt +181 -16
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PcmUrlPlayback.kt +177 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/BesCrashReportWaitersTest.kt +112 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/DeviceManagerOwnerLossTest.kt +146 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/GlassesStatusAudioSetupTest.kt +51 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/GlassesStatusClassicAudioTest.kt +2 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/WifiAdbPeerIntentTest.kt +19 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/GlassesAudioSetupPolicyTest.kt +65 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveAudioSetupReadinessTest.kt +231 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveGlassesReadyBurstTest.kt +5 -1
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveIncidentDispatchTest.kt +183 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveOwnerLossPolicyTest.kt +368 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingAdvertisementParserTest.kt +20 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingReadinessPolicyTest.kt +136 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLivePairingStateMachineTest.kt +346 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasCoordinatorTest.kt +1 -56
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/NimoCanvasSessionTest.kt +0 -22
- package/android/src/test/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNamingTest.kt +23 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/BoundedAudioQueueTest.kt +81 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/OnDeviceRecognizerHostTest.kt +216 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/STTToolsExtractionTest.kt +108 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SpeechActivityDetectorTest.kt +126 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SpeechActivityEngineTest.kt +245 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/stt/SttTextFormatterTest.kt +67 -0
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/utils/audio/PcmUrlPlaybackTest.kt +76 -0
- package/build/BluetoothSdk.types.d.ts +201 -1
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +43 -5
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +2 -0
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/generated/changelogCatalog.d.ts +3 -0
- package/build/generated/changelogCatalog.d.ts.map +1 -1
- package/build/generated/changelogCatalog.js +4 -0
- package/build/generated/changelogCatalog.js.map +1 -1
- package/build/generated/releaseMetadata.js +6 -6
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9 -0
- package/build/index.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +76 -12
- package/ios/MentraBluetoothSDK.podspec +4 -0
- package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +23 -5
- package/ios/Resources/SileroVad/silero_vad.onnx +0 -0
- package/ios/Source/BesCrashReportWaiters.swift +64 -0
- package/ios/Source/BluetoothSdkDefaults.swift +2 -2
- package/ios/Source/Bridge.swift +11 -3
- package/ios/Source/DeviceManager.swift +131 -18
- package/ios/Source/DeviceStore.swift +27 -0
- package/ios/Source/GeneratedChangelogCatalog.swift +1 -0
- package/ios/Source/GeneratedReleaseMetadata.swift +6 -6
- package/ios/Source/MentraBluetoothSDK.swift +40 -5
- package/ios/Source/audio/PcmStreamPlayer.swift +290 -57
- package/ios/Source/audio/PcmUrlPlayback.swift +231 -0
- package/ios/Source/audio/SpeechActivity.swift +277 -0
- package/ios/Source/errors/BluetoothSdkError.swift +5 -1
- package/ios/Source/events/BluetoothEvents.swift +41 -0
- package/ios/Source/internal/BleTraceLogger.swift +9 -6
- package/ios/Source/internal/BluetoothAvailability.swift +15 -5
- package/ios/Source/sgcs/GlassesAudioSetupPolicy.swift +186 -0
- package/ios/Source/sgcs/MentraLive.swift +1270 -189
- package/ios/Source/sgcs/MentraLivePairingAdvertisement.swift +260 -1
- package/ios/Source/sgcs/MentraLivePairingStateMachine.swift +385 -0
- package/ios/Source/sgcs/MentraLivePairingStateStore.swift +121 -0
- package/ios/Source/sgcs/Nimo.swift +10 -3
- package/ios/Source/sgcs/NimoCanvasCoordinator.swift +39 -9
- package/ios/Source/sgcs/SGCManager.swift +13 -0
- package/ios/Source/sgcs/Simulated.swift +2 -0
- package/ios/Source/status/DeviceStatus.swift +35 -0
- package/ios/Source/stt/STTTools.swift +13 -31
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +204 -162
- package/ios/Source/stt/SileroSpeechActivity.swift +87 -0
- package/ios/Source/stt/WakeWordDetector.swift +145 -0
- package/ios/Source/types/DeviceModels.swift +8 -1
- package/ios/Source/utils/AudioSessionMonitor.swift +158 -5
- package/ios/Source/utils/BoundedWait.swift +44 -0
- package/ios/Source/utils/DemandDrivenAudioWorker.swift +79 -0
- package/ios/Source/utils/SttModelTraits.swift +62 -0
- package/ios/Tests/BesCrashReportTests.swift +142 -0
- package/ios/Tests/BluetoothAudioRouteTests.swift +82 -0
- package/ios/Tests/DemandDrivenAudioWorkerTests.swift +171 -0
- package/ios/Tests/DeviceManagerReconnectTests.swift +4 -2
- package/ios/Tests/GlassesAudioSetupPolicyTests.swift +197 -0
- package/ios/Tests/IncidentLogDispatchTests.swift +158 -0
- package/ios/Tests/MentraLiveAudioSetupTests.swift +209 -0
- package/ios/Tests/MentraLiveConnectionOptionsTests.swift +55 -0
- package/ios/Tests/MentraLivePairingAdvertisementTests.swift +327 -0
- package/ios/Tests/MentraLivePairingStateMachineTests.swift +402 -0
- package/ios/Tests/MentraLiveSessionReadinessTests.swift +368 -26
- package/ios/Tests/NimoCanvasTransportTests.swift +58 -0
- package/ios/Tests/PcmStreamTests.swift +299 -0
- package/ios/Tests/SpeechActivityTests.swift +238 -0
- package/ios/Tests/SttModelTraitsTests.swift +62 -0
- package/ios/Tests/WifiAdbDispatchTests.swift +118 -0
- package/package.json +3 -2
- package/plugin/build/withAndroid.js +9 -11
- package/plugin/build/withKotlinVersion.d.ts +2 -0
- package/plugin/build/withKotlinVersion.js +46 -0
- package/src/BluetoothSdk.types.ts +201 -1
- package/src/_private/BluetoothSdkModule.ts +47 -5
- package/src/generated/changelogCatalog.ts +4 -0
- package/src/generated/releaseMetadata.ts +6 -6
- package/src/index.ts +22 -0
- package/android/silero/LICENSE.md +0 -17
- package/android/silero/build.gradle +0 -50
- package/android/silero/proguard-rules.pro +0 -24
- package/android/silero/src/androidTest/assets/hello.wav +0 -0
- package/android/silero/src/androidTest/java/com/konovalov/vad/silero/VadSileroTest.kt +0 -79
- package/android/silero/src/main/java/com/konovalov/vad/silero/Vad.kt +0 -160
- package/android/silero/src/main/java/com/konovalov/vad/silero/VadSilero.kt +0 -449
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/FrameSize.kt +0 -15
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/Mode.kt +0 -14
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/SampleRate.kt +0 -12
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/AudioUtils.kt +0 -47
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/TensorMap.kt +0 -41
- package/android/silero/src/test/java/com/konovalov/vad/silero/utils/AudioUtilsTest.kt +0 -44
- package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +0 -368
- package/android/src/debug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocol.kt +0 -156
- package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +0 -229
- package/android/src/release/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnostics.kt +0 -20
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoDiagnosticsTest.kt +0 -287
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoFramebufferProtocolTest.kt +0 -127
- package/android/src/testDebug/java/com/mentra/bluetoothsdk/sgcs/NimoLifecycleTest.kt +0 -288
- /package/android/{silero/src/main/assets/LICENSE → src/main/assets/vad/LICENSE.silero_vad} +0 -0
- /package/android/{silero/src/main/assets → src/main/assets/vad}/silero_vad.onnx +0 -0
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAA;AAC9E,OAAO,yBAAyB,MAAM,+BAA+B,CAAA;AAUrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAwB;IACxD,4BAA4B;IAC5B,8BAA8B;IAC9B,KAAK;IACL,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,aAAa;IACb,SAAS;IACT,iCAAiC;IACjC,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,gCAAgC;IAChC,qBAAqB;IACrB,eAAe;IACf,0BAA0B;IAC1B,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,gBAAgB;IAChB,sBAAsB;IACtB,iBAAiB;IACjB,oBAAoB;IACpB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,eAAe;IACf,qBAAqB;IAC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AsB,CAAC;IAC9D,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAChD,oBAAoB,EAAE,gBAAgB,CAAC,sBAAsB,CAAC;IAC9D,qBAAqB,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;IAChE,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAChD,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;IAC5D,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CACvD,CAAC,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import {parsePhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nimport PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PhotoCaptureDefaults,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"native_notification_status\",\n \"native_notification_delivery\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"wifi_forget_result\",\n \"saved_wifi_networks\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"version_info\",\n \"extraction_progress\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @mentra/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n configureNativeNotifications: bindPublicMethod(\"configureNativeNotifications\"),\n getNativeNotificationStatus: bindPublicMethod(\"getNativeNotificationStatus\"),\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n setDashboardContent: bindPublicMethod(\"setDashboardContent\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n getSavedWifiNetworks: bindPublicMethod(\"getSavedWifiNetworks\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryServerEnabled: bindPublicMethod(\"setGalleryServerEnabled\"),\n setTouchGestureDefaultBehaviorEnabled: bindPublicMethod(\"setTouchGestureDefaultBehaviorEnabled\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n setAutoPowerOffEnabled: bindPublicMethod(\"setAutoPowerOffEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: (settings: PhotoCaptureDefaults) => {\n if (settings.compress !== undefined) parsePhotoCompression(settings.compress)\n return bindPublicMethod(\"setPhotoCaptureDefaults\")(settings)\n },\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n GlassesConnectionStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n MtkUpdateCompleteEvent,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanDiagnostic,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamDegradationPreference,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n TouchGesture,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n SavedWifiNetworksEvent,\n SavedWifiNetworksOutcome,\n SavedWifiNetworksResult,\n WifiForgetOutcome,\n WifiForgetResult,\n WifiForgetResultEvent,\n LegacyWifiForgetResultEvent,\n ModernWifiForgetResultEvent,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n\nexport type {NativeNotificationConfig, NativeNotificationStatus, NativeNotificationDelivery} from \"./BluetoothSdk.types\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAA;AAC9E,OAAO,yBAAyB,MAAM,+BAA+B,CAAA;AAUrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAwB;IACxD,4BAA4B;IAC5B,8BAA8B;IAC9B,KAAK;IACL,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,aAAa;IACb,SAAS;IACT,iCAAiC;IACjC,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,WAAW;IACX,iBAAiB;IACjB,oBAAoB;IACpB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,gCAAgC;IAChC,qBAAqB;IACrB,eAAe;IACf,0BAA0B;IAC1B,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,oBAAoB;IACpB,uBAAuB;IACvB,qBAAqB;IACrB,gBAAgB;IAChB,sBAAsB;IACtB,iBAAiB;IACjB,oBAAoB;IACpB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,eAAe;IACf,qBAAqB;IACrB,yBAA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C,sBAAsB,CAAC;IAC9D,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAChD,oBAAoB,EAAE,gBAAgB,CAAC,sBAAsB,CAAC;IAC9D,qBAAqB,EAAE,gBAAgB,CAAC,uBAAuB,CAAC;IAChE,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAChD,oBAAoB,EAAE,gBAAgB,CAAC,sBAAsB,CAAC;IAC9D,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;IAC5D,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,0BAA0B,EAAE,gBAAgB,CAAC,4BAA4B,CAAC;IAC1E,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;IAC5D,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CACvD,CAAC,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import {parsePhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nimport PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PhotoCaptureDefaults,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"native_notification_status\",\n \"native_notification_delivery\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wake_word\",\n \"speech_activity\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"wifi_forget_result\",\n \"saved_wifi_networks\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"pairing_mode_ended\",\n \"pairing_state_changed\",\n \"audio_setup_changed\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"bes_crash_detected\",\n \"version_info\",\n \"extraction_progress\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @mentra/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n configureNativeNotifications: bindPublicMethod(\"configureNativeNotifications\"),\n getNativeNotificationStatus: bindPublicMethod(\"getNativeNotificationStatus\"),\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n setDashboardContent: bindPublicMethod(\"setDashboardContent\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n getSavedWifiNetworks: bindPublicMethod(\"getSavedWifiNetworks\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryServerEnabled: bindPublicMethod(\"setGalleryServerEnabled\"),\n setTouchGestureDefaultBehaviorEnabled: bindPublicMethod(\"setTouchGestureDefaultBehaviorEnabled\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n setAutoPowerOffEnabled: bindPublicMethod(\"setAutoPowerOffEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: (settings: PhotoCaptureDefaults) => {\n if (settings.compress !== undefined) parsePhotoCompression(settings.compress)\n return bindPublicMethod(\"setPhotoCaptureDefaults\")(settings)\n },\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n setWakeWordDetection: bindPublicMethod(\"setWakeWordDetection\"),\n finishTranscription: bindPublicMethod(\"finishTranscription\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n setSpeechActivityDetection: bindPublicMethod(\"setSpeechActivityDetection\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BesCrashDetectedEvent,\n BesCrashEviction,\n BesCrashIncidentState,\n BesCrashSummary,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n GlassesConnectionStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n WakeWordEvent,\n SpeechActivityEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n MtkUpdateCompleteEvent,\n PairFailureCode,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n MentraLivePairingState,\n PairingModeEndedEvent,\n PairingModeEndedReason,\n PairingStateChangedEvent,\n GlassesAudioSetupState,\n AudioSetupChangedEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanDiagnostic,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamDegradationPreference,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n TouchGesture,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n SavedWifiNetworksEvent,\n SavedWifiNetworksOutcome,\n SavedWifiNetworksResult,\n WifiForgetOutcome,\n WifiForgetResult,\n WifiForgetResultEvent,\n LegacyWifiForgetResultEvent,\n ModernWifiForgetResultEvent,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n\nexport type {NativeNotificationConfig, NativeNotificationStatus, NativeNotificationDelivery} from \"./BluetoothSdk.types\"\n"]}
|
|
@@ -69,12 +69,17 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
69
69
|
"pair_failure",
|
|
70
70
|
"pairing_info",
|
|
71
71
|
"entering_pairing_mode",
|
|
72
|
+
"pairing_mode_ended",
|
|
73
|
+
"pairing_state_changed",
|
|
74
|
+
"audio_setup_changed",
|
|
72
75
|
"owner_replaced",
|
|
73
76
|
"audio_pairing_needed",
|
|
74
77
|
"audio_connected",
|
|
75
78
|
"audio_disconnected",
|
|
76
79
|
"save_setting",
|
|
77
80
|
"local_transcription",
|
|
81
|
+
"wake_word",
|
|
82
|
+
"speech_activity",
|
|
78
83
|
"phone_notification",
|
|
79
84
|
"native_notification_status",
|
|
80
85
|
"native_notification_delivery",
|
|
@@ -92,6 +97,7 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
92
97
|
"ota_start_ack",
|
|
93
98
|
"ota_status",
|
|
94
99
|
"ar99_ota_status",
|
|
100
|
+
"bes_crash_detected",
|
|
95
101
|
"send_command_to_ble",
|
|
96
102
|
"receive_command_from_ble",
|
|
97
103
|
"miniapp_selected",
|
|
@@ -374,6 +380,11 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
374
380
|
}
|
|
375
381
|
}
|
|
376
382
|
|
|
383
|
+
AsyncFunction("sendBesCrashReported") { (incidentKey: String, reportId: String) in
|
|
384
|
+
let sdk = await MainActor.run { self.bluetoothSdk() }
|
|
385
|
+
try await sdk.sendBesCrashReported(incidentKey: incidentKey, reportId: reportId)
|
|
386
|
+
}
|
|
387
|
+
|
|
377
388
|
AsyncFunction("configureNativeNotifications") { (values: [String: Any]) in
|
|
378
389
|
try await MainActor.run {
|
|
379
390
|
try self.bluetoothSdk().configureNativeNotifications(NativeNotificationConfig(
|
|
@@ -429,9 +440,9 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
429
440
|
}
|
|
430
441
|
}
|
|
431
442
|
|
|
432
|
-
AsyncFunction("setWifiAdbState") { (enabled: Bool) in
|
|
443
|
+
AsyncFunction("setWifiAdbState") { (enabled: Bool, expectedBluetoothMac: String?) in
|
|
433
444
|
let sdk = await MainActor.run { self.bluetoothSdk() }
|
|
434
|
-
try await sdk.setWifiAdbState(enabled: enabled)
|
|
445
|
+
try await sdk.setWifiAdbState(enabled: enabled, expectedBluetoothMac: expectedBluetoothMac)
|
|
435
446
|
}
|
|
436
447
|
|
|
437
448
|
AsyncFunction("setSystemTime") { (timestampMs: Double) in
|
|
@@ -738,16 +749,16 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
738
749
|
|
|
739
750
|
// MARK: - Live PCM output stream (miniapp speaker.createStream)
|
|
740
751
|
|
|
741
|
-
// jitterMs
|
|
742
|
-
//
|
|
743
|
-
// knob here that would mean the same thing.
|
|
752
|
+
// jitterMs (default 500, 80-500 as on Android): playback starts once that much audio is
|
|
753
|
+
// queued, or on close, so a sound shorter than the cushion still plays.
|
|
744
754
|
AsyncFunction("pcmStreamOpen") {
|
|
745
|
-
(streamId: String, sampleRate: Int, channels: Int, volume: Double,
|
|
755
|
+
(streamId: String, sampleRate: Int, channels: Int, volume: Double, jitterMs: Int?) async throws in
|
|
746
756
|
try PcmStreamManager.open(
|
|
747
757
|
streamId: streamId,
|
|
748
758
|
sampleRate: sampleRate,
|
|
749
759
|
channels: channels,
|
|
750
|
-
volume: Float(volume)
|
|
760
|
+
volume: Float(volume),
|
|
761
|
+
jitterMs: jitterMs
|
|
751
762
|
)
|
|
752
763
|
}
|
|
753
764
|
|
|
@@ -765,6 +776,19 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
765
776
|
await PcmStreamManager.abort(streamId: streamId)
|
|
766
777
|
}
|
|
767
778
|
|
|
779
|
+
// Native HTTP GET of raw s16le mono PCM, played as it downloads. Async, so the download
|
|
780
|
+
// and playback never hold Expo's shared module queue.
|
|
781
|
+
AsyncFunction("pcmStreamPlayUrl") {
|
|
782
|
+
(streamId: String, url: String, sampleRate: Int, volume: Double, jitterMs: Int?) async throws -> [String: Int64] in
|
|
783
|
+
try ["durationMs": await PcmStreamManager.playUrl(
|
|
784
|
+
streamId: streamId,
|
|
785
|
+
url: url,
|
|
786
|
+
sampleRate: sampleRate,
|
|
787
|
+
volume: Float(volume),
|
|
788
|
+
jitterMs: jitterMs
|
|
789
|
+
)]
|
|
790
|
+
}
|
|
791
|
+
|
|
768
792
|
AsyncFunction("getGlassesMediaVolume") { () async throws -> [String: Any] in
|
|
769
793
|
try await DeviceManager.shared.getGlassesMediaVolume()
|
|
770
794
|
}
|
|
@@ -823,12 +847,47 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
823
847
|
}
|
|
824
848
|
}
|
|
825
849
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
850
|
+
// Loads the keyword spotter from the Speech-page model directory; disabling releases it.
|
|
851
|
+
AsyncFunction("setWakeWordDetection") { (enabled: Bool, modelDir: String?) async throws in
|
|
852
|
+
#if !os(macOS)
|
|
853
|
+
try await WakeWordDetector.shared.configure(enabled: enabled, modelDir: modelDir)
|
|
854
|
+
#else
|
|
855
|
+
if enabled {
|
|
856
|
+
throw NSError(domain: "WakeWordDetector", code: 1,
|
|
857
|
+
userInfo: [NSLocalizedDescriptionKey: "Native wake-word detection is not available on macOS"])
|
|
858
|
+
}
|
|
859
|
+
#endif
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
AsyncFunction("isSttModelLoaded") { (path: String) async -> Bool in
|
|
863
|
+
await DeviceManager.shared.isSttModelLoaded(path)
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// Final text after its local_transcription event was sent, or null. Never throws.
|
|
867
|
+
AsyncFunction("finishTranscription") { () async -> String? in
|
|
868
|
+
await DeviceManager.shared.finishTranscription()
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
AsyncFunction("restartTranscriber") { () async throws in
|
|
872
|
+
guard await DeviceManager.shared.restartTranscriber() else {
|
|
873
|
+
throw NSError(domain: "SherpaOnnxTranscriber", code: 2,
|
|
874
|
+
userInfo: [NSLocalizedDescriptionKey: "Could not load the speech model"])
|
|
829
875
|
}
|
|
830
876
|
}
|
|
831
877
|
|
|
878
|
+
// Phone-side Silero speech activity on microphone PCM; disabling releases the model.
|
|
879
|
+
AsyncFunction("setSpeechActivityDetection") { (enabled: Bool, options: [String: Any]?) async throws in
|
|
880
|
+
#if !os(macOS)
|
|
881
|
+
let minSilenceMs = (options?["minSilenceMs"] as? NSNumber)?.intValue
|
|
882
|
+
try await SpeechActivityMonitor.shared.setEnabled(enabled, minSilenceMs: minSilenceMs)
|
|
883
|
+
#else
|
|
884
|
+
if enabled {
|
|
885
|
+
throw NSError(domain: "SpeechActivity", code: 1,
|
|
886
|
+
userInfo: [NSLocalizedDescriptionKey: "Native speech activity detection is not available on macOS"])
|
|
887
|
+
}
|
|
888
|
+
#endif
|
|
889
|
+
}
|
|
890
|
+
|
|
832
891
|
// MARK: - Display Commands
|
|
833
892
|
|
|
834
893
|
AsyncFunction("clearDisplay") {
|
|
@@ -999,6 +1058,8 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
999
1058
|
sendEvent("ota_start_ack", event.values)
|
|
1000
1059
|
case let .otaStatus(event):
|
|
1001
1060
|
sendEvent("ota_status", event.values)
|
|
1061
|
+
case let .besCrashDetected(event):
|
|
1062
|
+
sendEvent("bes_crash_detected", event.values)
|
|
1002
1063
|
case let .settingsAck(event):
|
|
1003
1064
|
sendEvent("settings_ack", event.values)
|
|
1004
1065
|
case let .versionInfo(event):
|
|
@@ -1038,7 +1099,9 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
|
|
|
1038
1099
|
|
|
1039
1100
|
@MainActor
|
|
1040
1101
|
public func mentraBluetoothSDK(_: MentraBluetoothSDK, didFail error: BluetoothSdkError) {
|
|
1041
|
-
|
|
1102
|
+
var body: [String: Any] = ["error": error.message]
|
|
1103
|
+
if let failureCode = error.failureCode { body["code"] = failureCode }
|
|
1104
|
+
sendEvent("pair_failure", body)
|
|
1042
1105
|
}
|
|
1043
1106
|
}
|
|
1044
1107
|
|
|
@@ -1075,7 +1138,8 @@ private extension ConnectOptions {
|
|
|
1075
1138
|
self.init(
|
|
1076
1139
|
saveAsDefault: values?["saveAsDefault"] as? Bool ?? true,
|
|
1077
1140
|
cancelExistingConnectionAttempt: values?["cancelExistingConnectionAttempt"] as? Bool ?? true,
|
|
1078
|
-
requiresAncs: values?["requiresAncs"] as? Bool ?? true
|
|
1141
|
+
requiresAncs: values?["requiresAncs"] as? Bool ?? true,
|
|
1142
|
+
enableTransportBridging: values?["enableTransportBridging"] as? Bool ?? true
|
|
1079
1143
|
)
|
|
1080
1144
|
}
|
|
1081
1145
|
}
|
|
@@ -53,6 +53,10 @@ Pod::Spec.new do |s|
|
|
|
53
53
|
s.resource_bundles = {
|
|
54
54
|
'BluetoothSDKPrivacy' => ['Source/PrivacyInfo.xcprivacy']
|
|
55
55
|
}
|
|
56
|
+
# Phone-side Silero speech activity runs through the iOS-only sherpa-onnx framework.
|
|
57
|
+
s.ios.resource_bundles = {
|
|
58
|
+
'MentraSileroVad' => ['Resources/SileroVad/silero_vad.onnx']
|
|
59
|
+
}
|
|
56
60
|
|
|
57
61
|
native_source_files = [
|
|
58
62
|
"Source/**/*.{h,m,mm,swift,hpp,cpp,c}",
|
|
@@ -329,6 +329,17 @@ class SherpaOnnxRecognizer {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
/// Replace an ended stream while retaining the loaded recognizer/model.
|
|
333
|
+
@discardableResult
|
|
334
|
+
func recreateStream() -> Bool {
|
|
335
|
+
guard let replacement = SherpaOnnxCreateOnlineStream(recognizer) else { return false }
|
|
336
|
+
lock.lock()
|
|
337
|
+
SherpaOnnxDestroyOnlineStream(stream)
|
|
338
|
+
stream = replacement
|
|
339
|
+
lock.unlock()
|
|
340
|
+
return true
|
|
341
|
+
}
|
|
342
|
+
|
|
332
343
|
/// Signal that no more audio samples would be available.
|
|
333
344
|
/// After this call, you cannot call acceptWaveform() any more.
|
|
334
345
|
func inputFinished() {
|
|
@@ -1000,9 +1011,10 @@ class SherpaOnnxVoiceActivityDetectorWrapper {
|
|
|
1000
1011
|
/// A pointer to the underlying counterpart in C
|
|
1001
1012
|
private let vad: OpaquePointer
|
|
1002
1013
|
|
|
1003
|
-
|
|
1014
|
+
/// Returns nil when sherpa-onnx rejects the model instead of terminating the app.
|
|
1015
|
+
init?(config: UnsafePointer<SherpaOnnxVadModelConfig>, buffer_size_in_seconds: Float) {
|
|
1004
1016
|
guard let vad = SherpaOnnxCreateVoiceActivityDetector(config, buffer_size_in_seconds) else {
|
|
1005
|
-
|
|
1017
|
+
return nil
|
|
1006
1018
|
}
|
|
1007
1019
|
self.vad = vad
|
|
1008
1020
|
}
|
|
@@ -1626,11 +1638,17 @@ class SherpaOnnxKeywordSpotterWrapper {
|
|
|
1626
1638
|
let spotter: OpaquePointer!
|
|
1627
1639
|
var stream: OpaquePointer!
|
|
1628
1640
|
|
|
1629
|
-
|
|
1641
|
+
/// Returns nil when sherpa-onnx rejects the model or keywords instead of crashing later.
|
|
1642
|
+
init?(
|
|
1630
1643
|
config: UnsafePointer<SherpaOnnxKeywordSpotterConfig>!
|
|
1631
1644
|
) {
|
|
1632
|
-
spotter = SherpaOnnxCreateKeywordSpotter(config)
|
|
1633
|
-
stream = SherpaOnnxCreateKeywordStream(spotter)
|
|
1645
|
+
guard let spotter = SherpaOnnxCreateKeywordSpotter(config) else { return nil }
|
|
1646
|
+
guard let stream = SherpaOnnxCreateKeywordStream(spotter) else {
|
|
1647
|
+
SherpaOnnxDestroyKeywordSpotter(spotter)
|
|
1648
|
+
return nil
|
|
1649
|
+
}
|
|
1650
|
+
self.spotter = spotter
|
|
1651
|
+
self.stream = stream
|
|
1634
1652
|
}
|
|
1635
1653
|
|
|
1636
1654
|
deinit {
|
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/// Correlates `bes_crash_reported` commands with the glasses' `bes_crash_reported_ack`.
|
|
4
|
+
///
|
|
5
|
+
/// Each call owns one waiter keyed by (incidentKey, reportId), so concurrent reports for
|
|
6
|
+
/// different incidents, or a stale ack for an earlier reportId, never settle each other.
|
|
7
|
+
@MainActor
|
|
8
|
+
final class BesCrashReportWaiters {
|
|
9
|
+
@MainActor
|
|
10
|
+
private final class Waiter {
|
|
11
|
+
let incidentKey: String
|
|
12
|
+
let reportId: String
|
|
13
|
+
let pending: PendingResponse<Void>
|
|
14
|
+
|
|
15
|
+
init(incidentKey: String, reportId: String) {
|
|
16
|
+
self.incidentKey = incidentKey
|
|
17
|
+
self.reportId = reportId
|
|
18
|
+
pending = PendingResponse<Void>(operation: "bes_crash_reported for \(incidentKey)")
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private var waiters: [Waiter] = []
|
|
23
|
+
|
|
24
|
+
/// Registers before `send` so an immediate ack cannot be missed.
|
|
25
|
+
func report(incidentKey: String, reportId: String, timeoutMs: Int, send: () throws -> Void) async throws {
|
|
26
|
+
let waiter = Waiter(incidentKey: incidentKey, reportId: reportId)
|
|
27
|
+
waiters.append(waiter)
|
|
28
|
+
defer { waiters.removeAll { $0 === waiter } }
|
|
29
|
+
try send()
|
|
30
|
+
try await waiter.pending.wait(timeoutMs: timeoutMs)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// Settles the waiters this ack answers. `ok:true` must echo the reportId; an `ok:false`
|
|
34
|
+
/// without a reportId rejects every waiter for that incidentKey. Returns the number settled.
|
|
35
|
+
@discardableResult
|
|
36
|
+
func onAck(_ values: [String: Any]) -> Int {
|
|
37
|
+
guard let incidentKey = values["incidentKey"] as? String else { return 0 }
|
|
38
|
+
let reportId = (values["reportId"] as? String).flatMap { $0.isEmpty ? nil : $0 }
|
|
39
|
+
let ok = values["ok"] as? Bool == true
|
|
40
|
+
let matched = waiters.filter {
|
|
41
|
+
$0.incidentKey == incidentKey && ($0.reportId == reportId || (!ok && reportId == nil))
|
|
42
|
+
}
|
|
43
|
+
if ok {
|
|
44
|
+
for waiter in matched {
|
|
45
|
+
waiter.pending.resolve(())
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
let error = (values["error"] as? String).flatMap { $0.isEmpty ? nil : $0 } ?? "unknown_error"
|
|
49
|
+
for waiter in matched {
|
|
50
|
+
waiter.pending.reject(BluetoothSdkError(
|
|
51
|
+
code: "bes_crash_report_rejected",
|
|
52
|
+
message: "Glasses rejected bes_crash_reported for \(incidentKey): \(error)"
|
|
53
|
+
))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return matched.count
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
func rejectAll(_ error: Error) {
|
|
60
|
+
for waiter in waiters {
|
|
61
|
+
waiter.pending.reject(error)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -14,9 +14,9 @@ enum BluetoothSdkDefaults {
|
|
|
14
14
|
/// Must stay true. The firmware defaults auto power-off on, and we re-push
|
|
15
15
|
/// every Bluetooth setting on connect, so a false default here would
|
|
16
16
|
/// silently disable it on every pair the app touches.
|
|
17
|
-
static let autoPowerOffEnabled =
|
|
17
|
+
static let autoPowerOffEnabled = true
|
|
18
18
|
private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
|
|
19
|
-
private static let swiftPackageSdkVersion = "3.
|
|
19
|
+
private static let swiftPackageSdkVersion = "3.4.0-beta.1241"
|
|
20
20
|
private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
|
|
21
21
|
|
|
22
22
|
private static func normalizedSdkVersion(_ value: String?) -> String? {
|
package/ios/Source/Bridge.swift
CHANGED
|
@@ -85,8 +85,10 @@ class Bridge {
|
|
|
85
85
|
Bridge.sendTypedMessage("head_up", body: data)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
/// `code` is the machine-readable reason (`pair_failure.code`), e.g. `ios_forget_pairing`.
|
|
89
|
+
static func sendPairFailureEvent(_ error: String, code: String? = nil) {
|
|
90
|
+
var data: [String: Any] = ["error": error]
|
|
91
|
+
if let code { data["code"] = code }
|
|
90
92
|
Bridge.sendTypedMessage("pair_failure", body: data)
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -95,15 +97,21 @@ class Bridge {
|
|
|
95
97
|
pairingCode: String? = nil,
|
|
96
98
|
classicBondReady: Bool = false,
|
|
97
99
|
securePairingCapable: Bool = true,
|
|
98
|
-
protocolVersion: Int = 1
|
|
100
|
+
protocolVersion: Int = 1,
|
|
101
|
+
ownershipTransfer: Bool = false,
|
|
102
|
+
ownerCommitted: Bool = false,
|
|
103
|
+
autoAudio: Bool? = nil
|
|
99
104
|
) {
|
|
100
105
|
var body: [String: Any] = [
|
|
101
106
|
"had_previous_bond": hadPreviousBond,
|
|
102
107
|
"classic_bond_ready": classicBondReady,
|
|
103
108
|
"secure_pairing_capable": securePairingCapable,
|
|
104
109
|
"protocol_version": protocolVersion,
|
|
110
|
+
"ownership_transfer": ownershipTransfer,
|
|
111
|
+
"owner_committed": ownerCommitted,
|
|
105
112
|
]
|
|
106
113
|
if let pairingCode { body["pairing_code"] = pairingCode }
|
|
114
|
+
if let autoAudio { body["auto_audio"] = autoAudio }
|
|
107
115
|
Bridge.sendTypedMessage("pairing_info", body: body)
|
|
108
116
|
}
|
|
109
117
|
|