@mentra/bluetooth-sdk 3.5.0-dev.1462 → 3.5.0-dev.1466

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.
@@ -1 +1 @@
1
- {"version":3,"file":"BluetoothSdkModule.js","sourceRoot":"","sources":["../../src/_private/BluetoothSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAe,mBAAmB,EAAC,MAAM,MAAM,CAAA;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AAErC,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,oBAAoB,CAAA;AAElF,OAAO,EAML,kBAAkB,EAClB,cAAc,EACd,cAAc,GAgDf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,2BAA2B,EAAC,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAC,2BAA2B,EAAC,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAC,4BAA4B,EAAC,MAAM,wBAAwB,CAAA;AAiUnE,yDAAyD;AACzD,gGAAgG;AAChG,MAAM,wBAAwB,GAAG,mBAAmB,CAA2B,cAAc,CAAC,CAAA;AAC9F,uBAAuB,CAAC,wBAAwB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;AAC9D,sBAAsB,CAAC,wBAAwB,CAAC,CAAA;AAEhD,MAAM,uBAAuB,GAA6B;IACxD,aAAa,EAAE,IAAI;IACnB,+BAA+B,EAAE,IAAI;IACrC,YAAY,EAAE,IAAI;IAClB,uBAAuB,EAAE,IAAI;CAC9B,CAAA;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAA;AAEtC,SAAS,gBAAgB,CAA0C,MAA+B,EAAE,IAAY;IAC9G,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,OAA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wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AAC/F,wBAAwB,CAAC,YAAY,GAAG,UAAU,MAA0B;IAC1E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,wBAA8D,EAC9D,aAAa,CACd,CAAA;AACD,wBAAwB,CAAC,WAAW,GAAG,UAAU,MAA0B;IACzE,OAAO,iBAAiB,CAAC,4BAA4B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,wBAA8D,CAAA;AACvF,wBAAwB,CAAC,cAAc,GAAG,gBAAgB,CAAsB,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AACnH,wBAAwB,CAAC,gBAAgB,GAAG,gBAAgB,CAC1D,gBAAgB,EAChB,kBAAkB,CACnB,CAAA;AACD,wBAAwB,CAAC,aAAa,GAAG,gBAAgB,CAEvD,gBAAgB,EAAE,eAAe,CAAC,CAAA;AACpC,wBAAwB,CAAC,iBAAiB,GAAG,gBAAgB,CAC3D,gBAAgB,EAChB,mBAAmB,CACpB,CAAA;AACD,wBAAwB,CAAC,eAAe,GAAG,gBAAgB,CAAsB,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;AAErH,wBAAwB,CAAC,oBAAoB,GAAG,gBAAgB,CAE9D,wBAA8D,EAAE,sBAAsB,CAAC,CAAA;AAEzF,eAAe,wBAAwB,CAAA;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAsD,CAAA","sourcesContent":["import {createScanSession} from \"./scanSession\"\nimport {NativeModule, requireNativeModule} from \"expo\"\nimport {Platform} from \"react-native\"\n\nimport {installNativeLogConsole, installSdkUpdateNotice} from \"./nativeLogConsole\"\n\nimport {\n BluetoothSettingsUpdate,\n BluetoothSdkModuleEvents,\n BluetoothStatus,\n PhotoCaptureDefaults,\n CalendarEvent,\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovOverrideRequest,\n CameraFovResult,\n CameraFovSetting,\n CameraRoiPosition,\n CameraStatusEvent,\n ConnectOptions,\n DashboardMenuItem,\n Device,\n DeviceModel,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesStatus,\n GalleryStatusEvent,\n HotspotStatusChangeEvent,\n MicPreference,\n NativePhoneNotification,\n NativeNotificationConfig,\n NativeNotificationStatus,\n MicTuning,\n ObservableStoreCategory,\n OtaQueryResult,\n OtaStartAckEvent,\n PhotoRequestParams,\n PhotoSuccessResponseEvent,\n PublicBluetoothStatus,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlSuccessResponseEvent,\n ScanDiagnostic,\n ScanModelOptions,\n ScanOptions,\n SettingsAckSuccessEvent,\n StreamStartRequest,\n StreamStatusEvent,\n TouchGesture,\n VideoRecordingStartedStatusEvent,\n VideoRecordingSettings,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingStatusEvent,\n VersionInfoResult,\n WarmUpCameraParams,\n SavedWifiNetworksResult,\n WifiForgetResult,\n WifiSearchResult,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\nimport {warmUpCameraParamsForNative} from \"./cameraRequestPayload\"\nimport {photoRequestParamsForNative} from \"./photoRequestPayload\"\nimport {streamRequestParamsForNative} from \"./streamRequestPayload\"\n\n/**\n * Private React Native native-module facade.\n *\n * This file intentionally lives under `_private` so the package root can expose\n * a small SDK surface while MentraOS uses its monorepo-only internal alias\n * during migration. Raw status getters/listeners stay here so React hooks can\n * shape native store snapshots before app code sees them.\n */\n\ntype GlassesListener = (changed: Partial<GlassesStatus>) => void\ntype BluetoothStatusListener = (changed: Partial<PublicBluetoothStatus>) => void\ntype MaybePromise<T> = T | Promise<T>\n\ndeclare class BluetoothSdkNativeModule extends NativeModule<BluetoothSdkModuleEvents> {\n // Observable Store Functions (native)\n getGlassesStatus(): Promise<GlassesStatus>\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n getDefaultDevice(): Promise<Device | null>\n update(category: ObservableStoreCategory, values: object): Promise<void>\n\n // Display Commands\n displayEvent(params: Record<string, unknown>): Promise<void>\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n setDashboardContent(content: string): Promise<void>\n\n // Connection Commands\n requestStatus(): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n connectDefaultWithOptions(options: Required<ConnectOptions>): Promise<void>\n setDefaultDevice(device: Device | null): Promise<void>\n /** Android only: iOS cannot read its Bluetooth bonds. */\n getBondedGlasses?: () => Promise<{name: string; address: string} | null>\n getScanDiagnostic?: (model: DeviceModel) => Promise<ScanDiagnostic | null>\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectWithOptions(device: Device, options: Required<ConnectOptions>): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n connectDefaultController(): Promise<void>\n disconnectController(): Promise<void>\n connectSimulated(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n /** Explicit Unpair also resets connected NIMO glasses before forgetting. */\n unpair(): Promise<void>\n forgetController(): Promise<void>\n showDashboard(): Promise<void>\n setBrightness(level: number, autoMode?: boolean | null): Promise<void>\n setAutoBrightness(enabled: boolean): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setDashboardMenu(items: DashboardMenuItem[]): Promise<void>\n setCalendarEvents(events: CalendarEvent[]): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n ping(): Promise<void>\n dbg1(): Promise<void>\n dbg2(): Promise<void>\n\n // Incident Reporting\n sendIncidentId(incidentId: string, apiBaseUrl?: string | null): Promise<void>\n /**\n * Tell Mentra Live that Cloud recorded `reportId` for the BES crash incident\n * `incidentKey`. Resolves only on the glasses' matching `ok:true` ack; rejects\n * on `ok:false`, disconnect, or after 10 s. Call `sendIncidentId` only after it resolves.\n */\n sendBesCrashReported(incidentKey: string, reportId: string): Promise<void>\n\n // WiFi Commands\n requestWifiScan(): Promise<WifiSearchResult[]>\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean, expectedBluetoothMac?: string): Promise<void>\n /** Set the glasses system clock when phone detects clock skew (Mentra Live and G2). */\n setSystemTime(timestampMs: number): Promise<void>\n /** Logs current WiFi frequency (MHz) and 5 GHz band to Android logcat. */\n logCurrentWifiFrequency(): Promise<void>\n\n // Gallery Commands\n setGalleryServerEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setTouchGestureDefaultBehaviorEnabled(gesture: TouchGesture, enabled: boolean): Promise<SettingsAckSuccessEvent>\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n /** Mentra Live center-mic loudness / Barrier gate (cs_swit type 10). */\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /** Mentra Live power-off after ~20 min unworn (cs_swit type 11). */\n setAutoPowerOffEnabled(enabled: boolean): Promise<void>\n /**\n * Mentra Live mic tuning. `null` clears every override and returns the\n * glasses to firmware defaults.\n *\n * Deliberately absent from the public SDK surface: it is a super-mode\n * calibration aid whose values only make sense next to a live RMS readout.\n */\n setMicTuning(tuning: MicTuning | null): Promise<void>\n /**\n * Ask the glasses to report the tuning they are actually running. The answer\n * arrives as a `mic_tuning_state` event, which is also emitted unprompted\n * after every set, so a screen that subscribes on mount and calls this on\n * focus never has to guess.\n */\n requestMicTuningState(): Promise<void>\n /** Enable or disable the `mic_rms` readout. Auto-disabled on disconnect. */\n setMicRmsTelemetry(enabled: boolean): Promise<void>\n /**\n * Mentra Live wear detection. Internal / Super Mode only.\n *\n * Reporting is RAM-only on the glasses and must not go through `cs_swit`\n * type 1 (that bit is NV-backed). `resetWearTuning` both restores the\n * firmware vote defaults and turns reporting off.\n */\n queryWearState(): Promise<void>\n setWearReporting(enabled: boolean): Promise<void>\n /** Negative values leave that field unchanged. */\n setWearTuning(intervalMs: number, count: number, majority: number): Promise<void>\n requestWearTuning(): Promise<void>\n resetWearTuning(): Promise<void>\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).\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(width: number, height: number, fps: number): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n restoreLegacyCameraFov(): Promise<void>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n * Sends a {@code camera_tuning_config} BLE message; the ASG client relays it as a\n * {@code camconfig} broadcast so the HAL picks up new parameters without a reboot.\n *\n * Scan-mode convention: pass `{anr: false, gain: false}` when activating scan mode\n * (disables ANR and pixsmart gain) and `{anr: true, gain: true}` to restore defaults.\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n stopCameraWarmUp(requestId: string): Promise<void>\n\n // OTA Commands\n setOtaVersionUrl(otaVersionUrl: string): void\n getOtaVersionUrl(): string\n checkForOtaUpdate(): Promise<boolean>\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n sendOtaQueryStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // Version Info Commands\n requestVersionInfo(): Promise<VersionInfoResult>\n\n // Video Recording Commands\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n // Stream Commands\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n // Microphone Commands\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n /**\n * Lock microphone selection to one source (`\"glasses\"`) until released with `null`.\n *\n * Stronger than [setPreferredMic]: a preference is a ranking the SDK falls through when a source\n * is unavailable, while a pin has no fallback and reports `mic_health` with\n * `reason: \"pinned-source-unavailable\"` instead. Android only; the iOS implementation is a no-op,\n * so a caller that depends on the guarantee must gate on platform.\n */\n setMicSourcePin(source: string | null): Promise<void>\n /** See the public `setWakeWordDetection`. `modelDir` is required when enabling. */\n setWakeWordDetection(enabled: boolean, modelDir?: string | null): Promise<void>\n /** Whether the active recognizer has `path` loaded. Never blocks on a model load. */\n isSttModelLoaded(path: string): Promise<boolean>\n /** See the public `finishTranscription`. */\n finishTranscription(): Promise<string | null>\n /** See the public `restartTranscriber`. */\n restartTranscriber(): Promise<void>\n /** See the public `setSpeechActivityDetection`. */\n setSpeechActivityDetection(enabled: boolean, options?: {minSilenceMs?: number}): Promise<void>\n\n // Audio Playback Monitoring\n // Notify native side when our app starts/stops playing audio\n // Used to suspend LC3 mic during audio playback to avoid MCU overload\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n\n // Live PCM output stream (miniapp speaker.createStream). MentraOS-internal\n // ? 16-bit LE PCM chunks into a streaming AudioTrack (USAGE_MEDIA, so it\n // follows the phone's media route, e.g. A2DP to glasses). Implemented with\n // AudioTrack on Android and AVAudioEngine on iOS.\n /**\n * Open a PCM stream session. One AudioTrack per id; caller manages ids.\n *\n * `jitterMs` (default 500) is how much audio is queued before playback starts, and the playout\n * cushion after that. Omit it for one-way media, where the default cushion is inaudible; pass a\n * small value for conversational audio, where the same cushion is delay before the far end is\n * heard. Both platforms honor it: playback starts once `jitterMs` is queued or the stream is\n * closed, so a sound shorter than `jitterMs` still plays.\n *\n * A stream that has not received audio yet is aborted when the audio route changes (Bluetooth\n * or glasses connect/disconnect, a call starting or ending, an audio-session interruption), so\n * its next write rejects with \"stream not open\" instead of playing on a stale route.\n */\n pcmStreamOpen(\n streamId: string,\n sampleRate: number,\n channels: number,\n volume: number,\n jitterMs?: number,\n ): Promise<void>\n /**\n * Append base64 PCM. Resolves with the queued-but-unplayed backlog in ms;\n * blocks (on a background dispatcher) while the backlog is above the\n * backpressure ceiling, so awaited writes self-throttle to realtime.\n */\n pcmStreamWrite(streamId: string, base64: string): Promise<{bufferedMs: number}>\n /** Drain the backlog, then stop. Resolves with the total played duration. */\n pcmStreamClose(streamId: string): Promise<{durationMs: number}>\n /** Stop immediately, dropping any backlog. Idempotent. */\n pcmStreamAbort(streamId: string): Promise<void>\n /**\n * Fetch `url` (HTTP GET) and play its body as raw 16-bit little-endian mono PCM at `sampleRate`\n * while it downloads, through the same stream player as `pcmStreamOpen`. Native code reads the\n * body; audio never crosses into JavaScript. Resolves with the played duration after the whole\n * body has played. Rejects on a non-2xx response or a network error (whatever already played\n * stays played), and with \"aborted\" after `pcmStreamAbort(streamId)`. Must not block the shared\n * module queue while it runs.\n */\n pcmStreamPlayUrl(\n streamId: string,\n url: string,\n sampleRate: number,\n volume: number,\n jitterMs?: number,\n ): Promise<{durationMs: number}>\n\n /** Mentra Live only: K900 `cs_getvol` / `sr_getvol`. */\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n /** Mentra Live only: K900 `cs_vol` / `sr_vol`; level clamped 0??5 on native. */\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n // RGB LED Control\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n // STT Commands\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // TTS Commands\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n\n /** Android G2 content upload. iOS receives ANCS directly and rejects uploads. */\n sendPhoneNotification(notification: NativePhoneNotification): Promise<void>\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n\n // Helper methods for type-safe observable store access\n updateGlasses(values: Partial<GlassesStatus>): Promise<void>\n updateBluetoothSettings(values: BluetoothSettingsUpdate): Promise<void>\n onGlassesStatus(callback: GlassesListener): () => void\n onBluetoothStatus(callback: BluetoothStatusListener): () => void\n\n // Process resident-set-size in MB. iOS-only; Android stub returns 0.\n getMemoryMB(): number\n}\n\nexport type BluetoothSdkInternalModule = BluetoothSdkNativeModule\n\n// This call loads the native module object from the JSI.\n// NativeModule<BluetoothSdkModuleEvents> already extends EventEmitter<BluetoothSdkModuleEvents>\nconst NativeBluetoothSdkModule = requireNativeModule<BluetoothSdkNativeModule>(\"BluetoothSdk\")\ninstallNativeLogConsole(NativeBluetoothSdkModule, Platform.OS)\ninstallSdkUpdateNotice(NativeBluetoothSdkModule)\n\nconst DEFAULT_CONNECT_OPTIONS: Required<ConnectOptions> = {\n saveAsDefault: true,\n cancelExistingConnectionAttempt: true,\n requiresAncs: true,\n enableTransportBridging: true,\n}\n\nconst DEFAULT_SCAN_TIMEOUT_MS = 15_000\n\nfunction bindNativeMethod<T extends (...args: never[]) => unknown>(module: Record<string, unknown>, name: string): T {\n const method = module[name]\n if (typeof method !== \"function\") {\n console.warn(`[BluetoothSdk] Native method \"${name}\" is unavailable ??rebuild the app (bun android / bun ios)`)\n return (async () => {\n throw new Error(`BluetoothSdk.${name} is not available in this native build. Rebuild the app.`)\n }) as T\n }\n return method.bind(module) as T\n}\n\nconst CAMERA_ROI_MIN = 0\nconst CAMERA_ROI_MAX = 2\nconst CAMERA_ROI_POSITION_VALUES: Record<CameraRoiPosition, CameraFovSetting[\"roiPosition\"]> = {\n center: 0,\n bottom: 1,\n top: 2,\n}\n\n// Named presets are a convenience layer over the numeric {fov, roiPosition} API.\n// The default is the full sensor; \"standard\" preserves the historical 102° crop.\nconst CAMERA_FOV_PRESETS: Record<CameraFovPreset, CameraFovSetting> = {\n narrow: {fov: 82, roiPosition: 0},\n standard: {fov: 102, roiPosition: 0},\n wide: {fov: CAMERA_FOV_MAX, roiPosition: 0},\n}\n\nfunction clampInteger(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Math.round(value)))\n}\n\nfunction normalizeCameraFov(request: CameraFovRequest): CameraFovSetting {\n if (\"preset\" in request) {\n return CAMERA_FOV_PRESETS[request.preset] ?? CAMERA_FOV_PRESETS.standard\n }\n\n const roiPosition = request.roiPosition ?? \"center\"\n\n return {\n fov: clampInteger(Number.isFinite(request.fov) ? request.fov : CAMERA_FOV_DEFAULT, CAMERA_FOV_MIN, CAMERA_FOV_MAX),\n roiPosition: clampInteger(CAMERA_ROI_POSITION_VALUES[roiPosition] ?? 0, CAMERA_ROI_MIN, CAMERA_ROI_MAX) as\n | 0\n | 1\n | 2,\n }\n}\n\nfunction searchResultsForModel(status: Partial<PublicBluetoothStatus>, model: DeviceModel): Device[] {\n return status.searchResults?.filter((device) => device.model === model) ?? []\n}\n\nfunction normalizeScanArgs(modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions): ScanOptions {\n if (typeof modelOrOptions === \"string\") {\n return {model: modelOrOptions, ...options}\n }\n return modelOrOptions\n}\n\nfunction normalizeTimeoutMs(timeoutMs: number | undefined, defaultTimeoutMs: number): number {\n return typeof timeoutMs === \"number\" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : defaultTimeoutMs\n}\n\nfunction dashboardMenuItemToNative(item: DashboardMenuItem): Record<string, unknown> {\n return {\n ...(item.values ?? {}),\n title: item.title,\n packageName: item.packageName,\n }\n}\n\nfunction adaptConnectionStatusToNative(connection: GlassesStatus[\"connection\"]): Record<string, unknown> {\n switch (connection.state) {\n case \"connected\":\n return {connectionState: \"CONNECTED\", connected: true, fullyBooted: connection.fullyBooted}\n case \"scanning\":\n return {connectionState: \"SCANNING\", connected: false, fullyBooted: false}\n case \"connecting\":\n return {connectionState: \"CONNECTING\", connected: false, fullyBooted: false}\n case \"bonding\":\n return {connectionState: \"BONDING\", connected: false, fullyBooted: false}\n case \"disconnected\":\n return {connectionState: \"DISCONNECTED\", connected: false, fullyBooted: false}\n }\n}\n\nfunction adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<string, unknown> {\n const {wifi, hotspot, connection, ...rest} = values\n let update: Record<string, unknown> = {...rest}\n if (connection) {\n update = {\n ...update,\n ...adaptConnectionStatusToNative(connection),\n }\n }\n if (wifi?.state === \"connected\") {\n update = {\n ...update,\n wifiConnected: true,\n wifiSsid: wifi.ssid,\n wifiLocalIp: wifi.localIp ?? \"\",\n }\n } else if (wifi?.state === \"disconnected\") {\n update = {\n ...update,\n wifiConnected: false,\n wifiSsid: \"\",\n wifiLocalIp: \"\",\n }\n }\n if (hotspot?.state === \"enabled\") {\n update = {\n ...update,\n hotspotEnabled: true,\n hotspotSsid: hotspot.ssid,\n hotspotPassword: hotspot.password,\n hotspotGatewayIp: hotspot.localIp,\n }\n } else if (hotspot?.state === \"disabled\") {\n update = {\n ...update,\n hotspotEnabled: false,\n hotspotSsid: \"\",\n hotspotPassword: \"\",\n hotspotGatewayIp: \"\",\n }\n }\n return update\n}\n\n// Add helper methods to the module\nconst nativeGetGlassesStatus = NativeBluetoothSdkModule.getGlassesStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<GlassesStatus>\nNativeBluetoothSdkModule.getGlassesStatus = function () {\n return Promise.resolve(nativeGetGlassesStatus())\n}\n\nconst nativeGetBluetoothStatus = NativeBluetoothSdkModule.getBluetoothStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<BluetoothStatus>\nNativeBluetoothSdkModule.getBluetoothStatus = function () {\n return Promise.resolve(nativeGetBluetoothStatus())\n}\n\nconst nativeGetDefaultDevice = NativeBluetoothSdkModule.getDefaultDevice.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<Device | null>\nNativeBluetoothSdkModule.getDefaultDevice = function () {\n return Promise.resolve(nativeGetDefaultDevice())\n}\n\nconst nativeSetMicState = NativeBluetoothSdkModule.setMicState.bind(NativeBluetoothSdkModule) as (\n enabled: boolean,\n useGlassesMic: boolean,\n sendTranscript: boolean,\n sendLc3Data: boolean,\n) => MaybePromise<void>\n\nconst nativeDisplayText = NativeBluetoothSdkModule.displayText.bind(NativeBluetoothSdkModule) as (\n text: string,\n x: number,\n y: number,\n size: number,\n) => MaybePromise<void>\n\nNativeBluetoothSdkModule.updateGlasses = function (values: Partial<GlassesStatus>) {\n return this.update(\"glasses\", adaptGlassesUpdateToNative(values))\n}\n\nNativeBluetoothSdkModule.updateBluetoothSettings = function (values: BluetoothSettingsUpdate) {\n return this.update(\"bluetooth\", values)\n}\n\nNativeBluetoothSdkModule.displayText = function (text: string, x?: number, y?: number, size?: number) {\n return Promise.resolve(nativeDisplayText(text, x ?? 0, y ?? 0, size ?? 24))\n}\n\nNativeBluetoothSdkModule.setBrightness = function (level: number, autoMode?: boolean | null) {\n return this.updateBluetoothSettings({\n ...(autoMode == null ? {} : {auto_brightness: autoMode}),\n brightness: level,\n })\n}\n\nNativeBluetoothSdkModule.setAutoBrightness = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_brightness: enabled})\n}\n\nNativeBluetoothSdkModule.setDashboardPosition = function (height: number, depth: number) {\n return this.updateBluetoothSettings({\n dashboard_height: height,\n dashboard_depth: depth,\n })\n}\n\nNativeBluetoothSdkModule.setDashboardMenu = function (items: DashboardMenuItem[]) {\n return this.updateBluetoothSettings({menu_apps: items.map(dashboardMenuItemToNative)})\n}\n\nNativeBluetoothSdkModule.setCalendarEvents = function (events: CalendarEvent[]) {\n return this.updateBluetoothSettings({calendar_events: events})\n}\n\nNativeBluetoothSdkModule.setHeadUpAngle = function (angleDegrees: number) {\n return this.updateBluetoothSettings({head_up_angle: angleDegrees})\n}\n\nNativeBluetoothSdkModule.setImuEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({imu_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setScreenDisabled = function (disabled: boolean) {\n return this.updateBluetoothSettings({screen_disabled: disabled})\n}\n\nNativeBluetoothSdkModule.setVoiceActivityDetectionEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({voice_activity_detection_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setLoudnessGateEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({loudness_gate_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setAutoPowerOffEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_power_off_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setMicTuning = function (tuning: MicTuning | null) {\n // `{}` rather than null: the store drops null writes, and the native side\n // reads an empty object as \"no overrides\" and sends an explicit reset.\n return this.updateBluetoothSettings({mic_tuning: tuning ?? {}})\n}\n\nconst nativeMicModule = NativeBluetoothSdkModule as unknown as Record<string, unknown>\nNativeBluetoothSdkModule.requestMicTuningState = bindNativeMethod<() => Promise<void>>(\n nativeMicModule,\n \"requestMicTuningState\",\n)\nNativeBluetoothSdkModule.setMicRmsTelemetry = bindNativeMethod<(enabled: boolean) => Promise<void>>(\n nativeMicModule,\n \"setMicRmsTelemetry\",\n)\n\nconst nativeSetCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setCameraFov\",\n)\nNativeBluetoothSdkModule.setCameraFov = function (request: CameraFovRequest) {\n const setting = normalizeCameraFov(request)\n return Promise.resolve(nativeSetCameraFov(setting))\n}\n\nconst nativeSetLegacyCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.setLegacyCameraFov = function (request: CameraFovRequest) {\n return Promise.resolve(nativeSetLegacyCameraFov(normalizeCameraFov(request)))\n}\n\nconst nativeRestoreLegacyCameraFov = bindNativeMethod<() => MaybePromise<void>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"restoreLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.restoreLegacyCameraFov = function () {\n return Promise.resolve(nativeRestoreLegacyCameraFov())\n}\n\nconst nativeSetCameraFovOverride = bindNativeMethod<\n (request: CameraFovSetting & {leaseId: string; ttlMs: number}) => MaybePromise<CameraFovResult>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"setCameraFovOverride\")\nNativeBluetoothSdkModule.setCameraFovOverride = function (request: CameraFovOverrideRequest) {\n const setting = normalizeCameraFov(request)\n const requestedTtl =\n typeof request.ttlMs === \"number\" && Number.isFinite(request.ttlMs) && request.ttlMs > 0\n ? Math.round(request.ttlMs)\n : 300_000\n return Promise.resolve(\n nativeSetCameraFovOverride({\n ...setting,\n leaseId: request.leaseId,\n ttlMs: Math.min(requestedTtl, 600_000),\n }),\n )\n}\n\nNativeBluetoothSdkModule.setMicState = function (\n enabled: boolean,\n useGlassesMic?: boolean,\n sendTranscript?: boolean,\n sendLc3Data?: boolean,\n) {\n return Promise.resolve(\n nativeSetMicState(enabled, useGlassesMic ?? true, sendTranscript ?? false, sendLc3Data ?? false),\n )\n}\n\nNativeBluetoothSdkModule.setPreferredMic = function (preferredMic: MicPreference) {\n return this.updateBluetoothSettings({preferred_mic: preferredMic})\n}\n\nNativeBluetoothSdkModule.onGlassesStatus = function (callback: GlassesListener) {\n const subscription = this.addListener(\"glasses_status\", callback)\n return () => subscription.remove()\n}\n\nNativeBluetoothSdkModule.onBluetoothStatus = function (callback: BluetoothStatusListener) {\n const subscription = this.addListener(\"bluetooth_status\", callback)\n return () => subscription.remove()\n}\n\nconst nativeConnectDefault = NativeBluetoothSdkModule.connectDefault.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.connectDefault = function (options?: ConnectOptions) {\n if (!options) {\n return nativeConnectDefault()\n }\n return this.connectDefaultWithOptions({...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nNativeBluetoothSdkModule.connect = function (device: Device, options?: ConnectOptions) {\n return this.connectWithOptions(device, {...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nconst nativeStopScan = NativeBluetoothSdkModule.stopScan.bind(NativeBluetoothSdkModule)\nconst activeScanCancellations = new Set<() => Promise<void>>()\nNativeBluetoothSdkModule.stopScan = async function () {\n if (activeScanCancellations.size === 0) return nativeStopScan()\n await Promise.all([...activeScanCancellations].map((cancel) => cancel()))\n}\n\nNativeBluetoothSdkModule.scan = async function (modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions) {\n if (activeScanCancellations.size > 0) await this.stopScan()\n const scanOptions = normalizeScanArgs(modelOrOptions, options)\n const timeoutMs = normalizeTimeoutMs(scanOptions.timeoutMs ?? scanOptions.timeout, DEFAULT_SCAN_TIMEOUT_MS)\n const session = createScanSession(\n {\n start: (model) => this.startScan(model),\n stop: nativeStopScan,\n subscribe: (onResults) =>\n this.onBluetoothStatus((status) => {\n if (Array.isArray(status.searchResults)) onResults(searchResultsForModel(status, scanOptions.model))\n }),\n getResults: async () => searchResultsForModel(await this.getBluetoothStatus(), scanOptions.model),\n // Older native binaries simply omit diagnostics until the host is rebuilt.\n getDiagnostic:\n typeof this.getScanDiagnostic === \"function\" ? () => this.getScanDiagnostic!(scanOptions.model) : undefined,\n },\n {...scanOptions, timeoutMs},\n )\n activeScanCancellations.add(session.cancel)\n try {\n return await session.result\n } finally {\n activeScanCancellations.delete(session.cancel)\n }\n}\n\nconst nativeRequestPhoto = NativeBluetoothSdkModule.requestPhoto.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.requestPhoto = function (params: PhotoRequestParams) {\n return nativeRequestPhoto(photoRequestParamsForNative(params) as unknown as PhotoRequestParams)\n}\n\nconst nativeWarmUpCamera = NativeBluetoothSdkModule.warmUpCamera.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.warmUpCamera = function (params: WarmUpCameraParams) {\n return nativeWarmUpCamera(warmUpCameraParamsForNative(params) as unknown as WarmUpCameraParams)\n}\n\nconst nativeStartStream = bindNativeMethod<(params: StreamStartRequest) => Promise<StreamStatusEvent>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"startStream\",\n)\nNativeBluetoothSdkModule.startStream = function (params: StreamStartRequest) {\n return nativeStartStream(streamRequestParamsForNative(params) as unknown as StreamStartRequest)\n}\n\nconst nativeWearModule = NativeBluetoothSdkModule as unknown as Record<string, unknown>\nNativeBluetoothSdkModule.queryWearState = bindNativeMethod<() => Promise<void>>(nativeWearModule, \"queryWearState\")\nNativeBluetoothSdkModule.setWearReporting = bindNativeMethod<(enabled: boolean) => Promise<void>>(\n nativeWearModule,\n \"setWearReporting\",\n)\nNativeBluetoothSdkModule.setWearTuning = bindNativeMethod<\n (intervalMs: number, count: number, majority: number) => Promise<void>\n>(nativeWearModule, \"setWearTuning\")\nNativeBluetoothSdkModule.requestWearTuning = bindNativeMethod<() => Promise<void>>(\n nativeWearModule,\n \"requestWearTuning\",\n)\nNativeBluetoothSdkModule.resetWearTuning = bindNativeMethod<() => Promise<void>>(nativeWearModule, \"resetWearTuning\")\n\nNativeBluetoothSdkModule.sendBesCrashReported = bindNativeMethod<\n (incidentKey: string, reportId: string) => Promise<void>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"sendBesCrashReported\")\n\nexport default NativeBluetoothSdkModule\nexport const BluetoothSdk = NativeBluetoothSdkModule as BluetoothSdkInternalModule\n"]}
1
+ {"version":3,"file":"BluetoothSdkModule.js","sourceRoot":"","sources":["../../src/_private/BluetoothSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAe,mBAAmB,EAAC,MAAM,MAAM,CAAA;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AAErC,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,oBAAoB,CAAA;AAElF,OAAO,EAML,kBAAkB,EAClB,cAAc,EACd,cAAc,GAgDf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,2BAA2B,EAAC,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAC,2BAA2B,E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C,gBAAgB,GAAG,gBAAgB,CAC1D,gBAAgB,EAChB,kBAAkB,CACnB,CAAA;AACD,wBAAwB,CAAC,aAAa,GAAG,gBAAgB,CAEvD,gBAAgB,EAAE,eAAe,CAAC,CAAA;AACpC,wBAAwB,CAAC,iBAAiB,GAAG,gBAAgB,CAC3D,gBAAgB,EAChB,mBAAmB,CACpB,CAAA;AACD,wBAAwB,CAAC,eAAe,GAAG,gBAAgB,CAAsB,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;AAErH,wBAAwB,CAAC,oBAAoB,GAAG,gBAAgB,CAE9D,wBAA8D,EAAE,sBAAsB,CAAC,CAAA;AAEzF,eAAe,wBAAwB,CAAA;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAsD,CAAA","sourcesContent":["import {createScanSession} from \"./scanSession\"\nimport {NativeModule, requireNativeModule} from \"expo\"\nimport {Platform} from \"react-native\"\n\nimport {installNativeLogConsole, installSdkUpdateNotice} from \"./nativeLogConsole\"\n\nimport {\n BluetoothSettingsUpdate,\n BluetoothSdkModuleEvents,\n BluetoothStatus,\n PhotoCaptureDefaults,\n CalendarEvent,\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovOverrideRequest,\n CameraFovResult,\n CameraFovSetting,\n CameraRoiPosition,\n CameraStatusEvent,\n ConnectOptions,\n DashboardMenuItem,\n Device,\n DeviceModel,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesStatus,\n GalleryStatusEvent,\n HotspotStatusChangeEvent,\n MicPreference,\n NativePhoneNotification,\n NativeNotificationConfig,\n NativeNotificationStatus,\n MicTuning,\n ObservableStoreCategory,\n OtaQueryResult,\n OtaStartAckEvent,\n PhotoRequestParams,\n PhotoSuccessResponseEvent,\n PublicBluetoothStatus,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlSuccessResponseEvent,\n ScanDiagnostic,\n ScanModelOptions,\n ScanOptions,\n SettingsAckSuccessEvent,\n StreamStartRequest,\n StreamStatusEvent,\n TouchGesture,\n VideoRecordingStartedStatusEvent,\n VideoRecordingSettings,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingStatusEvent,\n VersionInfoResult,\n WarmUpCameraParams,\n SavedWifiNetworksResult,\n WifiForgetResult,\n WifiSearchResult,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\nimport {warmUpCameraParamsForNative} from \"./cameraRequestPayload\"\nimport {photoRequestParamsForNative} from \"./photoRequestPayload\"\nimport {streamRequestParamsForNative} from \"./streamRequestPayload\"\n\n/**\n * Private React Native native-module facade.\n *\n * This file intentionally lives under `_private` so the package root can expose\n * a small SDK surface while MentraOS uses its monorepo-only internal alias\n * during migration. Raw status getters/listeners stay here so React hooks can\n * shape native store snapshots before app code sees them.\n */\n\ntype GlassesListener = (changed: Partial<GlassesStatus>) => void\ntype BluetoothStatusListener = (changed: Partial<PublicBluetoothStatus>) => void\ntype MaybePromise<T> = T | Promise<T>\n\ndeclare class BluetoothSdkNativeModule extends NativeModule<BluetoothSdkModuleEvents> {\n // Observable Store Functions (native)\n getGlassesStatus(): Promise<GlassesStatus>\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n getDefaultDevice(): Promise<Device | null>\n update(category: ObservableStoreCategory, values: object): Promise<void>\n\n // Display Commands\n displayEvent(params: Record<string, unknown>): Promise<void>\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n setDashboardContent(content: string): Promise<void>\n\n // Connection Commands\n requestStatus(): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n connectDefaultWithOptions(options: Required<ConnectOptions>): Promise<void>\n setDefaultDevice(device: Device | null): Promise<void>\n /** Android only: iOS cannot read its Bluetooth bonds. */\n getBondedGlasses?: () => Promise<{name: string; address: string} | null>\n getScanDiagnostic?: (model: DeviceModel) => Promise<ScanDiagnostic | null>\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectWithOptions(device: Device, options: Required<ConnectOptions>): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n connectDefaultController(): Promise<void>\n disconnectController(): Promise<void>\n connectSimulated(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n /** Explicit Unpair also resets connected NIMO glasses before forgetting. */\n unpair(): Promise<void>\n forgetController(): Promise<void>\n showDashboard(): Promise<void>\n setBrightness(level: number, autoMode?: boolean | null): Promise<void>\n setAutoBrightness(enabled: boolean): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setDashboardMenu(items: DashboardMenuItem[]): Promise<void>\n setCalendarEvents(events: CalendarEvent[]): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n ping(): Promise<void>\n dbg1(): Promise<void>\n dbg2(): Promise<void>\n\n // Incident Reporting\n sendIncidentId(incidentId: string, apiBaseUrl?: string | null): Promise<void>\n /**\n * Tell Mentra Live that Cloud recorded `reportId` for the BES crash incident\n * `incidentKey`. Resolves only on the glasses' matching `ok:true` ack; rejects\n * on `ok:false`, disconnect, or after 10 s. Call `sendIncidentId` only after it resolves.\n */\n sendBesCrashReported(incidentKey: string, reportId: string): Promise<void>\n\n // WiFi Commands\n requestWifiScan(): Promise<WifiSearchResult[]>\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean, expectedBluetoothMac?: string): Promise<void>\n /** Set the glasses system clock when phone detects clock skew (Mentra Live and G2). */\n setSystemTime(timestampMs: number): Promise<void>\n /** Logs current WiFi frequency (MHz) and 5 GHz band to Android logcat. */\n logCurrentWifiFrequency(): Promise<void>\n\n // Gallery Commands\n setGalleryServerEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setTouchGestureDefaultBehaviorEnabled(gesture: TouchGesture, enabled: boolean): Promise<SettingsAckSuccessEvent>\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n /** Mentra Live center-mic loudness / Barrier gate (cs_swit type 10). */\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /** Mentra Live power-off after ~20 min unworn (cs_swit type 11). */\n setAutoPowerOffEnabled(enabled: boolean): Promise<void>\n /**\n * Mentra Live mic tuning. `null` clears every override and returns the\n * glasses to firmware defaults.\n *\n * Deliberately absent from the public SDK surface: it is a super-mode\n * calibration aid whose values only make sense next to a live RMS readout.\n */\n setMicTuning(tuning: MicTuning | null): Promise<void>\n /**\n * Ask the glasses to report the tuning they are actually running. The answer\n * arrives as a `mic_tuning_state` event, which is also emitted unprompted\n * after every set, so a screen that subscribes on mount and calls this on\n * focus never has to guess.\n */\n requestMicTuningState(): Promise<void>\n /** Enable or disable the `mic_rms` readout. Auto-disabled on disconnect. */\n setMicRmsTelemetry(enabled: boolean): Promise<void>\n /**\n * Mentra Live wear detection. Internal / Super Mode only.\n *\n * Reporting is RAM-only on the glasses and must not go through `cs_swit`\n * type 1 (that bit is NV-backed). `resetWearTuning` both restores the\n * firmware vote defaults and turns reporting off.\n */\n queryWearState(): Promise<void>\n setWearReporting(enabled: boolean): Promise<void>\n /** Negative values leave that field unchanged. */\n setWearTuning(intervalMs: number, count: number, majority: number): Promise<void>\n requestWearTuning(): Promise<void>\n resetWearTuning(): Promise<void>\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).\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(width: number, height: number, fps: number): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n restoreLegacyCameraFov(): Promise<void>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n * Sends a {@code camera_tuning_config} BLE message; the ASG client relays it as a\n * {@code camconfig} broadcast so the HAL picks up new parameters without a reboot.\n *\n * Scan-mode convention: pass `{anr: false, gain: false}` when activating scan mode\n * (disables ANR and pixsmart gain) and `{anr: true, gain: true}` to restore defaults.\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n stopCameraWarmUp(requestId: string): Promise<void>\n\n // OTA Commands\n setOtaVersionUrl(otaVersionUrl: string): void\n getOtaVersionUrl(): string\n checkForOtaUpdate(): Promise<boolean>\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n sendOtaQueryStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // Version Info Commands\n requestVersionInfo(): Promise<VersionInfoResult>\n\n // Video Recording Commands\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n // Stream Commands\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n // Microphone Commands\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n /**\n * Lock microphone selection to one source (`\"glasses\"`) until released with `null`.\n *\n * Stronger than [setPreferredMic]: a preference is a ranking the SDK falls through when a source\n * is unavailable, while a pin has no fallback and reports `mic_health` with\n * `reason: \"pinned-source-unavailable\"` instead. Android only; the iOS implementation is a no-op,\n * so a caller that depends on the guarantee must gate on platform.\n */\n setMicSourcePin(source: string | null): Promise<void>\n /** See the public `setWakeWordDetection`. `modelDir` is required when enabling. */\n setWakeWordDetection(enabled: boolean, modelDir?: string | null): Promise<void>\n /** Whether the active recognizer has `path` loaded. Never blocks on a model load. */\n isSttModelLoaded(path: string): Promise<boolean>\n /** See the public `finishTranscription`. */\n finishTranscription(): Promise<string | null>\n /** See the public `restartTranscriber`. */\n restartTranscriber(): Promise<void>\n /** See the public `setSpeechActivityDetection`. */\n setSpeechActivityDetection(enabled: boolean, options?: {minSilenceMs?: number}): Promise<void>\n\n // Audio Playback Monitoring\n // Notify native side when our app starts/stops playing audio\n // Used to suspend LC3 mic during audio playback to avoid MCU overload\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n\n // Live PCM output stream (miniapp speaker.createStream). MentraOS-internal\n // ? 16-bit LE PCM chunks into a streaming AudioTrack (USAGE_MEDIA, so it\n // follows the phone's media route, e.g. A2DP to glasses). Implemented with\n // AudioTrack on Android and AVAudioEngine on iOS.\n /**\n * Open a PCM stream session. One AudioTrack per id; caller manages ids.\n *\n * `jitterMs` (default 500) is how much audio is queued before playback starts, and the playout\n * cushion after that. Omit it for one-way media, where the default cushion is inaudible; pass a\n * small value for conversational audio, where the same cushion is delay before the far end is\n * heard. Both platforms honor it: playback starts once `jitterMs` is queued or the stream is\n * closed, so a sound shorter than `jitterMs` still plays.\n *\n * A stream that has not received audio yet is aborted when the audio route changes (Bluetooth\n * or glasses connect/disconnect, a call starting or ending, an audio-session interruption), so\n * its next write rejects with \"stream not open\" instead of playing on a stale route.\n */\n pcmStreamOpen(\n streamId: string,\n sampleRate: number,\n channels: number,\n volume: number,\n jitterMs?: number,\n ): Promise<void>\n /**\n * Append base64 PCM. Resolves with the queued-but-unplayed backlog in ms;\n * blocks (on a background dispatcher) while the backlog is above the\n * backpressure ceiling, so awaited writes self-throttle to realtime.\n */\n pcmStreamWrite(streamId: string, base64: string): Promise<{bufferedMs: number}>\n /** Drain the backlog, then stop. Resolves with the total played duration. */\n pcmStreamClose(streamId: string): Promise<{durationMs: number}>\n /** Stop immediately, dropping any backlog. Idempotent. */\n pcmStreamAbort(streamId: string): Promise<void>\n /**\n * Fetch `url` (HTTP GET) and play its body as raw 16-bit little-endian mono PCM at `sampleRate`\n * while it downloads, through the same stream player as `pcmStreamOpen`. Native code reads the\n * body; audio never crosses into JavaScript. Resolves with the played duration after the whole\n * body has played. Rejects on a non-2xx response or a network error (whatever already played\n * stays played), and with \"aborted\" after `pcmStreamAbort(streamId)`. Must not block the shared\n * module queue while it runs.\n */\n pcmStreamPlayUrl(\n streamId: string,\n url: string,\n sampleRate: number,\n volume: number,\n jitterMs?: number,\n ): Promise<{durationMs: number}>\n\n /** Mentra Live only: K900 `cs_getvol` / `sr_getvol`. */\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n /** Mentra Live only: K900 `cs_vol` / `sr_vol`; level clamped 0??5 on native. */\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n // RGB LED Control\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n // STT Commands\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // TTS Commands\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n\n /** Android G2 content upload. iOS receives ANCS directly and rejects uploads. */\n sendPhoneNotification(notification: NativePhoneNotification): Promise<void>\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n\n // Helper methods for type-safe observable store access\n updateGlasses(values: Partial<GlassesStatus>): Promise<void>\n updateBluetoothSettings(values: BluetoothSettingsUpdate): Promise<void>\n onGlassesStatus(callback: GlassesListener): () => void\n onBluetoothStatus(callback: BluetoothStatusListener): () => void\n\n // Process resident-set-size in MB. iOS-only; Android stub returns 0.\n getMemoryMB(): number\n}\n\nexport type BluetoothSdkInternalModule = BluetoothSdkNativeModule\n\n// This call loads the native module object from the JSI.\n// NativeModule<BluetoothSdkModuleEvents> already extends EventEmitter<BluetoothSdkModuleEvents>\nconst NativeBluetoothSdkModule = requireNativeModule<BluetoothSdkNativeModule>(\"BluetoothSdk\")\ninstallNativeLogConsole(NativeBluetoothSdkModule, Platform.OS)\ninstallSdkUpdateNotice(NativeBluetoothSdkModule)\n\nconst DEFAULT_CONNECT_OPTIONS: Required<ConnectOptions> = {\n saveAsDefault: true,\n cancelExistingConnectionAttempt: true,\n requiresAncs: true,\n enableTransportBridging: true,\n}\n\nconst DEFAULT_SCAN_TIMEOUT_MS = 15_000\n\nfunction bindNativeMethod<T extends (...args: never[]) => unknown>(module: Record<string, unknown>, name: string): T {\n const method = module[name]\n if (typeof method !== \"function\") {\n console.warn(`[BluetoothSdk] Native method \"${name}\" is unavailable ??rebuild the app (bun android / bun ios)`)\n return (async () => {\n throw new Error(`BluetoothSdk.${name} is not available in this native build. Rebuild the app.`)\n }) as T\n }\n return method.bind(module) as T\n}\n\nconst CAMERA_ROI_MIN = 0\nconst CAMERA_ROI_MAX = 2\nconst CAMERA_ROI_POSITION_VALUES: Record<CameraRoiPosition, CameraFovSetting[\"roiPosition\"]> = {\n center: 0,\n bottom: 1,\n top: 2,\n}\n\n// Named presets are a convenience layer over the numeric {fov, roiPosition} API.\n// The default is the full sensor; \"standard\" preserves the historical 102° crop.\nconst CAMERA_FOV_PRESETS: Record<CameraFovPreset, CameraFovSetting> = {\n narrow: {fov: 82, roiPosition: 0},\n standard: {fov: 102, roiPosition: 0},\n wide: {fov: CAMERA_FOV_MAX, roiPosition: 0},\n}\n\nfunction clampInteger(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Math.round(value)))\n}\n\nfunction normalizeCameraFov(request: CameraFovRequest): CameraFovSetting {\n if (\"preset\" in request) {\n return CAMERA_FOV_PRESETS[request.preset] ?? CAMERA_FOV_PRESETS.standard\n }\n\n const roiPosition = request.roiPosition ?? \"center\"\n\n return {\n fov: clampInteger(Number.isFinite(request.fov) ? request.fov : CAMERA_FOV_DEFAULT, CAMERA_FOV_MIN, CAMERA_FOV_MAX),\n roiPosition: clampInteger(CAMERA_ROI_POSITION_VALUES[roiPosition] ?? 0, CAMERA_ROI_MIN, CAMERA_ROI_MAX) as\n | 0\n | 1\n | 2,\n }\n}\n\nfunction searchResultsForModel(status: Partial<PublicBluetoothStatus>, model: DeviceModel): Device[] {\n return status.searchResults?.filter((device) => device.model === model) ?? []\n}\n\nfunction normalizeScanArgs(modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions): ScanOptions {\n if (typeof modelOrOptions === \"string\") {\n return {model: modelOrOptions, ...options}\n }\n return modelOrOptions\n}\n\nfunction normalizeTimeoutMs(timeoutMs: number | undefined, defaultTimeoutMs: number): number {\n return typeof timeoutMs === \"number\" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : defaultTimeoutMs\n}\n\nfunction dashboardMenuItemToNative(item: DashboardMenuItem): Record<string, unknown> {\n return {\n ...(item.values ?? {}),\n title: item.title,\n packageName: item.packageName,\n }\n}\n\nfunction adaptConnectionStatusToNative(connection: GlassesStatus[\"connection\"]): Record<string, unknown> {\n switch (connection.state) {\n case \"connected\":\n return {connectionState: \"CONNECTED\", connected: true, fullyBooted: connection.fullyBooted}\n case \"scanning\":\n return {connectionState: \"SCANNING\", connected: false, fullyBooted: false}\n case \"connecting\":\n return {connectionState: \"CONNECTING\", connected: false, fullyBooted: false}\n case \"bonding\":\n return {connectionState: \"BONDING\", connected: false, fullyBooted: false}\n case \"disconnected\":\n return {connectionState: \"DISCONNECTED\", connected: false, fullyBooted: false}\n }\n}\n\nfunction adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<string, unknown> {\n const {wifi, hotspot, connection, ...rest} = values\n let update: Record<string, unknown> = {...rest}\n if (connection) {\n update = {\n ...update,\n ...adaptConnectionStatusToNative(connection),\n }\n }\n if (wifi?.state === \"connected\") {\n update = {\n ...update,\n wifiConnected: true,\n wifiSsid: wifi.ssid,\n wifiLocalIp: wifi.localIp ?? \"\",\n }\n } else if (wifi?.state === \"disconnected\") {\n update = {\n ...update,\n wifiConnected: false,\n wifiSsid: \"\",\n wifiLocalIp: \"\",\n }\n }\n if (hotspot?.state === \"enabled\") {\n update = {\n ...update,\n hotspotEnabled: true,\n hotspotSsid: hotspot.ssid,\n hotspotPassword: hotspot.password,\n hotspotGatewayIp: hotspot.localIp,\n hotspotFrequency: hotspot.frequency ?? 0,\n }\n } else if (hotspot?.state === \"disabled\") {\n update = {\n ...update,\n hotspotEnabled: false,\n hotspotSsid: \"\",\n hotspotPassword: \"\",\n hotspotGatewayIp: \"\",\n hotspotFrequency: 0,\n }\n }\n return update\n}\n\n// Add helper methods to the module\nconst nativeGetGlassesStatus = NativeBluetoothSdkModule.getGlassesStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<GlassesStatus>\nNativeBluetoothSdkModule.getGlassesStatus = function () {\n return Promise.resolve(nativeGetGlassesStatus())\n}\n\nconst nativeGetBluetoothStatus = NativeBluetoothSdkModule.getBluetoothStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<BluetoothStatus>\nNativeBluetoothSdkModule.getBluetoothStatus = function () {\n return Promise.resolve(nativeGetBluetoothStatus())\n}\n\nconst nativeGetDefaultDevice = NativeBluetoothSdkModule.getDefaultDevice.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<Device | null>\nNativeBluetoothSdkModule.getDefaultDevice = function () {\n return Promise.resolve(nativeGetDefaultDevice())\n}\n\nconst nativeSetMicState = NativeBluetoothSdkModule.setMicState.bind(NativeBluetoothSdkModule) as (\n enabled: boolean,\n useGlassesMic: boolean,\n sendTranscript: boolean,\n sendLc3Data: boolean,\n) => MaybePromise<void>\n\nconst nativeDisplayText = NativeBluetoothSdkModule.displayText.bind(NativeBluetoothSdkModule) as (\n text: string,\n x: number,\n y: number,\n size: number,\n) => MaybePromise<void>\n\nNativeBluetoothSdkModule.updateGlasses = function (values: Partial<GlassesStatus>) {\n return this.update(\"glasses\", adaptGlassesUpdateToNative(values))\n}\n\nNativeBluetoothSdkModule.updateBluetoothSettings = function (values: BluetoothSettingsUpdate) {\n return this.update(\"bluetooth\", values)\n}\n\nNativeBluetoothSdkModule.displayText = function (text: string, x?: number, y?: number, size?: number) {\n return Promise.resolve(nativeDisplayText(text, x ?? 0, y ?? 0, size ?? 24))\n}\n\nNativeBluetoothSdkModule.setBrightness = function (level: number, autoMode?: boolean | null) {\n return this.updateBluetoothSettings({\n ...(autoMode == null ? {} : {auto_brightness: autoMode}),\n brightness: level,\n })\n}\n\nNativeBluetoothSdkModule.setAutoBrightness = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_brightness: enabled})\n}\n\nNativeBluetoothSdkModule.setDashboardPosition = function (height: number, depth: number) {\n return this.updateBluetoothSettings({\n dashboard_height: height,\n dashboard_depth: depth,\n })\n}\n\nNativeBluetoothSdkModule.setDashboardMenu = function (items: DashboardMenuItem[]) {\n return this.updateBluetoothSettings({menu_apps: items.map(dashboardMenuItemToNative)})\n}\n\nNativeBluetoothSdkModule.setCalendarEvents = function (events: CalendarEvent[]) {\n return this.updateBluetoothSettings({calendar_events: events})\n}\n\nNativeBluetoothSdkModule.setHeadUpAngle = function (angleDegrees: number) {\n return this.updateBluetoothSettings({head_up_angle: angleDegrees})\n}\n\nNativeBluetoothSdkModule.setImuEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({imu_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setScreenDisabled = function (disabled: boolean) {\n return this.updateBluetoothSettings({screen_disabled: disabled})\n}\n\nNativeBluetoothSdkModule.setVoiceActivityDetectionEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({voice_activity_detection_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setLoudnessGateEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({loudness_gate_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setAutoPowerOffEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_power_off_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setMicTuning = function (tuning: MicTuning | null) {\n // `{}` rather than null: the store drops null writes, and the native side\n // reads an empty object as \"no overrides\" and sends an explicit reset.\n return this.updateBluetoothSettings({mic_tuning: tuning ?? {}})\n}\n\nconst nativeMicModule = NativeBluetoothSdkModule as unknown as Record<string, unknown>\nNativeBluetoothSdkModule.requestMicTuningState = bindNativeMethod<() => Promise<void>>(\n nativeMicModule,\n \"requestMicTuningState\",\n)\nNativeBluetoothSdkModule.setMicRmsTelemetry = bindNativeMethod<(enabled: boolean) => Promise<void>>(\n nativeMicModule,\n \"setMicRmsTelemetry\",\n)\n\nconst nativeSetCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setCameraFov\",\n)\nNativeBluetoothSdkModule.setCameraFov = function (request: CameraFovRequest) {\n const setting = normalizeCameraFov(request)\n return Promise.resolve(nativeSetCameraFov(setting))\n}\n\nconst nativeSetLegacyCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.setLegacyCameraFov = function (request: CameraFovRequest) {\n return Promise.resolve(nativeSetLegacyCameraFov(normalizeCameraFov(request)))\n}\n\nconst nativeRestoreLegacyCameraFov = bindNativeMethod<() => MaybePromise<void>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"restoreLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.restoreLegacyCameraFov = function () {\n return Promise.resolve(nativeRestoreLegacyCameraFov())\n}\n\nconst nativeSetCameraFovOverride = bindNativeMethod<\n (request: CameraFovSetting & {leaseId: string; ttlMs: number}) => MaybePromise<CameraFovResult>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"setCameraFovOverride\")\nNativeBluetoothSdkModule.setCameraFovOverride = function (request: CameraFovOverrideRequest) {\n const setting = normalizeCameraFov(request)\n const requestedTtl =\n typeof request.ttlMs === \"number\" && Number.isFinite(request.ttlMs) && request.ttlMs > 0\n ? Math.round(request.ttlMs)\n : 300_000\n return Promise.resolve(\n nativeSetCameraFovOverride({\n ...setting,\n leaseId: request.leaseId,\n ttlMs: Math.min(requestedTtl, 600_000),\n }),\n )\n}\n\nNativeBluetoothSdkModule.setMicState = function (\n enabled: boolean,\n useGlassesMic?: boolean,\n sendTranscript?: boolean,\n sendLc3Data?: boolean,\n) {\n return Promise.resolve(\n nativeSetMicState(enabled, useGlassesMic ?? true, sendTranscript ?? false, sendLc3Data ?? false),\n )\n}\n\nNativeBluetoothSdkModule.setPreferredMic = function (preferredMic: MicPreference) {\n return this.updateBluetoothSettings({preferred_mic: preferredMic})\n}\n\nNativeBluetoothSdkModule.onGlassesStatus = function (callback: GlassesListener) {\n const subscription = this.addListener(\"glasses_status\", callback)\n return () => subscription.remove()\n}\n\nNativeBluetoothSdkModule.onBluetoothStatus = function (callback: BluetoothStatusListener) {\n const subscription = this.addListener(\"bluetooth_status\", callback)\n return () => subscription.remove()\n}\n\nconst nativeConnectDefault = NativeBluetoothSdkModule.connectDefault.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.connectDefault = function (options?: ConnectOptions) {\n if (!options) {\n return nativeConnectDefault()\n }\n return this.connectDefaultWithOptions({...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nNativeBluetoothSdkModule.connect = function (device: Device, options?: ConnectOptions) {\n return this.connectWithOptions(device, {...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nconst nativeStopScan = NativeBluetoothSdkModule.stopScan.bind(NativeBluetoothSdkModule)\nconst activeScanCancellations = new Set<() => Promise<void>>()\nNativeBluetoothSdkModule.stopScan = async function () {\n if (activeScanCancellations.size === 0) return nativeStopScan()\n await Promise.all([...activeScanCancellations].map((cancel) => cancel()))\n}\n\nNativeBluetoothSdkModule.scan = async function (modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions) {\n if (activeScanCancellations.size > 0) await this.stopScan()\n const scanOptions = normalizeScanArgs(modelOrOptions, options)\n const timeoutMs = normalizeTimeoutMs(scanOptions.timeoutMs ?? scanOptions.timeout, DEFAULT_SCAN_TIMEOUT_MS)\n const session = createScanSession(\n {\n start: (model) => this.startScan(model),\n stop: nativeStopScan,\n subscribe: (onResults) =>\n this.onBluetoothStatus((status) => {\n if (Array.isArray(status.searchResults)) onResults(searchResultsForModel(status, scanOptions.model))\n }),\n getResults: async () => searchResultsForModel(await this.getBluetoothStatus(), scanOptions.model),\n // Older native binaries simply omit diagnostics until the host is rebuilt.\n getDiagnostic:\n typeof this.getScanDiagnostic === \"function\" ? () => this.getScanDiagnostic!(scanOptions.model) : undefined,\n },\n {...scanOptions, timeoutMs},\n )\n activeScanCancellations.add(session.cancel)\n try {\n return await session.result\n } finally {\n activeScanCancellations.delete(session.cancel)\n }\n}\n\nconst nativeRequestPhoto = NativeBluetoothSdkModule.requestPhoto.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.requestPhoto = function (params: PhotoRequestParams) {\n return nativeRequestPhoto(photoRequestParamsForNative(params) as unknown as PhotoRequestParams)\n}\n\nconst nativeWarmUpCamera = NativeBluetoothSdkModule.warmUpCamera.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.warmUpCamera = function (params: WarmUpCameraParams) {\n return nativeWarmUpCamera(warmUpCameraParamsForNative(params) as unknown as WarmUpCameraParams)\n}\n\nconst nativeStartStream = bindNativeMethod<(params: StreamStartRequest) => Promise<StreamStatusEvent>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"startStream\",\n)\nNativeBluetoothSdkModule.startStream = function (params: StreamStartRequest) {\n return nativeStartStream(streamRequestParamsForNative(params) as unknown as StreamStartRequest)\n}\n\nconst nativeWearModule = NativeBluetoothSdkModule as unknown as Record<string, unknown>\nNativeBluetoothSdkModule.queryWearState = bindNativeMethod<() => Promise<void>>(nativeWearModule, \"queryWearState\")\nNativeBluetoothSdkModule.setWearReporting = bindNativeMethod<(enabled: boolean) => Promise<void>>(\n nativeWearModule,\n \"setWearReporting\",\n)\nNativeBluetoothSdkModule.setWearTuning = bindNativeMethod<\n (intervalMs: number, count: number, majority: number) => Promise<void>\n>(nativeWearModule, \"setWearTuning\")\nNativeBluetoothSdkModule.requestWearTuning = bindNativeMethod<() => Promise<void>>(\n nativeWearModule,\n \"requestWearTuning\",\n)\nNativeBluetoothSdkModule.resetWearTuning = bindNativeMethod<() => Promise<void>>(nativeWearModule, \"resetWearTuning\")\n\nNativeBluetoothSdkModule.sendBesCrashReported = bindNativeMethod<\n (incidentKey: string, reportId: string) => Promise<void>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"sendBesCrashReported\")\n\nexport default NativeBluetoothSdkModule\nexport const BluetoothSdk = NativeBluetoothSdkModule as BluetoothSdkInternalModule\n"]}
@@ -1,10 +1,10 @@
1
1
  export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "3.5.0",
4
- "releaseIdentity": "3.5.0-dev.1462",
5
- "releaseSetId": "mentra-3.5.0-dev.1462",
6
- "sourceCommit": "4dc658df98cc64e6d48d0bbaaf7cc7e10803a6f6",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1462.json",
8
- "otaManifestSha256": "2c1cb9011d6d725760a395c3a2f35fa1c6c6f31159cc729963fa404d9851c1c9"
4
+ "releaseIdentity": "3.5.0-dev.1466",
5
+ "releaseSetId": "mentra-3.5.0-dev.1466",
6
+ "sourceCommit": "a56ee0ee343ad2adcc0ca08228329427a24f65cc",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1466.json",
8
+ "otaManifestSha256": "2db50d0e64095f2636baafc59eb44d1ef4e865ed651457efcb1260686be1fa7f"
9
9
  });
10
10
  //# sourceMappingURL=releaseMetadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.5.0\",\n \"releaseIdentity\": \"3.5.0-dev.1462\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1462\",\n \"sourceCommit\": \"4dc658df98cc64e6d48d0bbaaf7cc7e10803a6f6\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1462.json\",\n \"otaManifestSha256\": \"2c1cb9011d6d725760a395c3a2f35fa1c6c6f31159cc729963fa404d9851c1c9\"\n})\n"]}
1
+ {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.5.0\",\n \"releaseIdentity\": \"3.5.0-dev.1466\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1466\",\n \"sourceCommit\": \"a56ee0ee343ad2adcc0ca08228329427a24f65cc\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1466.json\",\n \"otaManifestSha256\": \"2db50d0e64095f2636baafc59eb44d1ef4e865ed651457efcb1260686be1fa7f\"\n})\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useBluetoothStatus.d.ts","sourceRoot":"","sources":["../../src/react/useBluetoothStatus.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,qBAAqB,EACrB,mBAAmB,EAGpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC/C,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;IACrB,aAAa,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC3C,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7B,CAAA;AAiCD,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,yBAAyB,CAmHrG"}
1
+ {"version":3,"file":"useBluetoothStatus.d.ts","sourceRoot":"","sources":["../../src/react/useBluetoothStatus.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,qBAAqB,EACrB,mBAAmB,EAGpB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC/C,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;IACrB,aAAa,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC3C,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7B,CAAA;AAkCD,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,yBAAyB,CAmHrG"}
@@ -16,6 +16,7 @@ function hotspotStatusFromEvent(event) {
16
16
  ssid: event.ssid,
17
17
  password: event.password,
18
18
  localIp: event.localIp,
19
+ ...(event.frequency ? { frequency: event.frequency } : {}),
19
20
  };
20
21
  }
21
22
  return { state: event.state };
@@ -1 +1 @@
1
- {"version":3,"file":"useBluetoothStatus.js","sourceRoot":"","sources":["../../src/react/useBluetoothStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAEjD,OAAO,YAAY,MAAM,gCAAgC,CAAA;AACzD,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,uBAAuB,CAAA;AA0B9B,SAAS,mBAAmB,CAAC,KAA4B;IACvD,QA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,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,kCAAkC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IACrF,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAE7E,OAAO;QACL,eAAe;QACf,SAAS;QACT,KAAK;QACL,aAAa;QACb,OAAO;QACP,KAAK;QACL,OAAO;KACR,CAAA;AACH,CAAC","sourcesContent":["import {useEffect, useRef, useState} from \"react\"\n\nimport BluetoothSdk from \"../_private/BluetoothSdkModule\"\nimport {\n createDisconnectedGlassesStatus,\n isConnectedGlassesConnectionStatus,\n isReadyGlassesConnectionStatus,\n} from \"../BluetoothSdk.types\"\nimport type {\n BatteryStatusEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\n\nexport type UseBluetoothStatusOptions = {\n enabled?: boolean\n onError?: (error: unknown) => void\n}\n\nexport type BluetoothStatusHookResult = {\n bluetoothStatus: Partial<PublicBluetoothStatus>\n connected: boolean\n error: unknown | null\n glassesStatus: Partial<PublicGlassesStatus>\n loading: boolean\n ready: boolean\n refresh: () => Promise<void>\n}\n\nfunction wifiStatusFromEvent(event: WifiStatusChangeEvent): WifiStatus {\n switch (event.state) {\n case \"connected\":\n return {state: \"connected\", ssid: event.ssid, localIp: event.localIp}\n case \"disconnected\":\n return {state: \"disconnected\"}\n }\n}\n\nfunction hotspotStatusFromEvent(event: HotspotStatusChangeEvent): HotspotStatus {\n if (event.state === \"enabled\") {\n return {\n state: \"enabled\",\n ssid: event.ssid,\n password: event.password,\n localIp: event.localIp,\n }\n }\n return {state: event.state}\n}\n\nfunction mergeGlassesStatus(\n current: Partial<PublicGlassesStatus>,\n changed: Partial<PublicGlassesStatus>,\n): Partial<PublicGlassesStatus> {\n if (changed.connection?.state === \"disconnected\") {\n return {...createDisconnectedGlassesStatus(), ...changed}\n }\n return {...current, ...changed}\n}\n\nexport function useBluetoothStatus(options: UseBluetoothStatusOptions = {}): BluetoothStatusHookResult {\n const enabled = options.enabled ?? true\n const onErrorRef = useRef(options.onError)\n const [bluetoothStatus, setBluetoothStatus] = useState<Partial<PublicBluetoothStatus>>({})\n const [error, setError] = useState<unknown | null>(null)\n const [glassesStatus, setGlassesStatus] = useState<Partial<PublicGlassesStatus>>(() =>\n createDisconnectedGlassesStatus(),\n )\n const [loading, setLoading] = useState(enabled)\n\n useEffect(() => {\n onErrorRef.current = options.onError\n }, [options.onError])\n\n async function refresh() {\n setLoading(true)\n try {\n const [nextGlassesStatus, nextBluetoothStatus] = await Promise.all([\n BluetoothSdk.getGlassesStatus(),\n BluetoothSdk.getBluetoothStatus(),\n ])\n setGlassesStatus(nextGlassesStatus)\n setBluetoothStatus(nextBluetoothStatus)\n setError(null)\n } catch (nextError) {\n setError(nextError)\n onErrorRef.current?.(nextError)\n } finally {\n setLoading(false)\n }\n }\n\n useEffect(() => {\n if (!enabled) {\n setLoading(false)\n return undefined\n }\n\n let mounted = true\n\n const loadInitialStatus = async () => {\n setLoading(true)\n try {\n const [nextGlassesStatus, nextBluetoothStatus] = await Promise.all([\n BluetoothSdk.getGlassesStatus(),\n BluetoothSdk.getBluetoothStatus(),\n ])\n if (!mounted) {\n return\n }\n setGlassesStatus(nextGlassesStatus)\n setBluetoothStatus(nextBluetoothStatus)\n setError(null)\n } catch (nextError) {\n if (!mounted) {\n return\n }\n setError(nextError)\n onErrorRef.current?.(nextError)\n } finally {\n if (mounted) {\n setLoading(false)\n }\n }\n }\n\n void loadInitialStatus()\n\n const removeGlasses = BluetoothSdk.onGlassesStatus((changed) => {\n setGlassesStatus((current) => mergeGlassesStatus(current, changed))\n })\n const removeBluetooth = BluetoothSdk.onBluetoothStatus((changed) => {\n setBluetoothStatus((current) => ({...current, ...changed}))\n })\n const batterySubscription = BluetoothSdk.addListener(\"battery_status\", (event: BatteryStatusEvent) => {\n setGlassesStatus((current) => ({\n ...current,\n batteryLevel: event.level,\n charging: event.charging,\n }))\n })\n const wifiSubscription = BluetoothSdk.addListener(\"wifi_status_change\", (event) => {\n setGlassesStatus((current) => ({...current, wifi: wifiStatusFromEvent(event)}))\n })\n const hotspotSubscription = BluetoothSdk.addListener(\"hotspot_status_change\", (event) => {\n setGlassesStatus((current) => ({...current, hotspot: hotspotStatusFromEvent(event)}))\n })\n const hotspotErrorSubscription = BluetoothSdk.addListener(\"hotspot_error\", () => {\n setGlassesStatus((current) => ({...current, hotspot: {state: \"disabled\"}}))\n })\n\n return () => {\n mounted = false\n removeGlasses()\n removeBluetooth()\n batterySubscription.remove()\n wifiSubscription.remove()\n hotspotSubscription.remove()\n hotspotErrorSubscription.remove()\n }\n }, [enabled])\n\n const connection = glassesStatus.connection\n const connected = connection ? isConnectedGlassesConnectionStatus(connection) : false\n const ready = connection ? isReadyGlassesConnectionStatus(connection) : false\n\n return {\n bluetoothStatus,\n connected,\n error,\n glassesStatus,\n loading,\n ready,\n refresh,\n }\n}\n"]}
1
+ {"version":3,"file":"useBluetoothStatus.js","sourceRoot":"","sources":["../../src/react/useBluetoothStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAEjD,OAAO,YAAY,MAAM,gCAAgC,CAAA;AACzD,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,8BAA8B,GAC/B,MAAM,uBAAuB,CAAA;AA0B9B,SAAS,mBAAmB,CAAC,KAA4B;IACvD,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,KAAK,WAAW;YACd,OAAO,EAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAC,CAAA;QACvE,KAAK,cAAc;YACjB,OAAO,EAAC,KAAK,EAAE,cA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rF,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAE7E,OAAO;QACL,eAAe;QACf,SAAS;QACT,KAAK;QACL,aAAa;QACb,OAAO;QACP,KAAK;QACL,OAAO;KACR,CAAA;AACH,CAAC","sourcesContent":["import {useEffect, useRef, useState} from \"react\"\n\nimport BluetoothSdk from \"../_private/BluetoothSdkModule\"\nimport {\n createDisconnectedGlassesStatus,\n isConnectedGlassesConnectionStatus,\n isReadyGlassesConnectionStatus,\n} from \"../BluetoothSdk.types\"\nimport type {\n BatteryStatusEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\n\nexport type UseBluetoothStatusOptions = {\n enabled?: boolean\n onError?: (error: unknown) => void\n}\n\nexport type BluetoothStatusHookResult = {\n bluetoothStatus: Partial<PublicBluetoothStatus>\n connected: boolean\n error: unknown | null\n glassesStatus: Partial<PublicGlassesStatus>\n loading: boolean\n ready: boolean\n refresh: () => Promise<void>\n}\n\nfunction wifiStatusFromEvent(event: WifiStatusChangeEvent): WifiStatus {\n switch (event.state) {\n case \"connected\":\n return {state: \"connected\", ssid: event.ssid, localIp: event.localIp}\n case \"disconnected\":\n return {state: \"disconnected\"}\n }\n}\n\nfunction hotspotStatusFromEvent(event: HotspotStatusChangeEvent): HotspotStatus {\n if (event.state === \"enabled\") {\n return {\n state: \"enabled\",\n ssid: event.ssid,\n password: event.password,\n localIp: event.localIp,\n ...(event.frequency ? {frequency: event.frequency} : {}),\n }\n }\n return {state: event.state}\n}\n\nfunction mergeGlassesStatus(\n current: Partial<PublicGlassesStatus>,\n changed: Partial<PublicGlassesStatus>,\n): Partial<PublicGlassesStatus> {\n if (changed.connection?.state === \"disconnected\") {\n return {...createDisconnectedGlassesStatus(), ...changed}\n }\n return {...current, ...changed}\n}\n\nexport function useBluetoothStatus(options: UseBluetoothStatusOptions = {}): BluetoothStatusHookResult {\n const enabled = options.enabled ?? true\n const onErrorRef = useRef(options.onError)\n const [bluetoothStatus, setBluetoothStatus] = useState<Partial<PublicBluetoothStatus>>({})\n const [error, setError] = useState<unknown | null>(null)\n const [glassesStatus, setGlassesStatus] = useState<Partial<PublicGlassesStatus>>(() =>\n createDisconnectedGlassesStatus(),\n )\n const [loading, setLoading] = useState(enabled)\n\n useEffect(() => {\n onErrorRef.current = options.onError\n }, [options.onError])\n\n async function refresh() {\n setLoading(true)\n try {\n const [nextGlassesStatus, nextBluetoothStatus] = await Promise.all([\n BluetoothSdk.getGlassesStatus(),\n BluetoothSdk.getBluetoothStatus(),\n ])\n setGlassesStatus(nextGlassesStatus)\n setBluetoothStatus(nextBluetoothStatus)\n setError(null)\n } catch (nextError) {\n setError(nextError)\n onErrorRef.current?.(nextError)\n } finally {\n setLoading(false)\n }\n }\n\n useEffect(() => {\n if (!enabled) {\n setLoading(false)\n return undefined\n }\n\n let mounted = true\n\n const loadInitialStatus = async () => {\n setLoading(true)\n try {\n const [nextGlassesStatus, nextBluetoothStatus] = await Promise.all([\n BluetoothSdk.getGlassesStatus(),\n BluetoothSdk.getBluetoothStatus(),\n ])\n if (!mounted) {\n return\n }\n setGlassesStatus(nextGlassesStatus)\n setBluetoothStatus(nextBluetoothStatus)\n setError(null)\n } catch (nextError) {\n if (!mounted) {\n return\n }\n setError(nextError)\n onErrorRef.current?.(nextError)\n } finally {\n if (mounted) {\n setLoading(false)\n }\n }\n }\n\n void loadInitialStatus()\n\n const removeGlasses = BluetoothSdk.onGlassesStatus((changed) => {\n setGlassesStatus((current) => mergeGlassesStatus(current, changed))\n })\n const removeBluetooth = BluetoothSdk.onBluetoothStatus((changed) => {\n setBluetoothStatus((current) => ({...current, ...changed}))\n })\n const batterySubscription = BluetoothSdk.addListener(\"battery_status\", (event: BatteryStatusEvent) => {\n setGlassesStatus((current) => ({\n ...current,\n batteryLevel: event.level,\n charging: event.charging,\n }))\n })\n const wifiSubscription = BluetoothSdk.addListener(\"wifi_status_change\", (event) => {\n setGlassesStatus((current) => ({...current, wifi: wifiStatusFromEvent(event)}))\n })\n const hotspotSubscription = BluetoothSdk.addListener(\"hotspot_status_change\", (event) => {\n setGlassesStatus((current) => ({...current, hotspot: hotspotStatusFromEvent(event)}))\n })\n const hotspotErrorSubscription = BluetoothSdk.addListener(\"hotspot_error\", () => {\n setGlassesStatus((current) => ({...current, hotspot: {state: \"disabled\"}}))\n })\n\n return () => {\n mounted = false\n removeGlasses()\n removeBluetooth()\n batterySubscription.remove()\n wifiSubscription.remove()\n hotspotSubscription.remove()\n hotspotErrorSubscription.remove()\n }\n }, [enabled])\n\n const connection = glassesStatus.connection\n const connected = connection ? isConnectedGlassesConnectionStatus(connection) : false\n const ready = connection ? isReadyGlassesConnectionStatus(connection) : false\n\n return {\n bluetoothStatus,\n connected,\n error,\n glassesStatus,\n loading,\n ready,\n refresh,\n }\n}\n"]}
@@ -17,7 +17,7 @@ enum BluetoothSdkDefaults {
17
17
  /// persist.mentra.wear_detection_off=1.
18
18
  static let autoPowerOffEnabled = true
19
19
  private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
20
- private static let swiftPackageSdkVersion = "3.5.0-dev.1462"
20
+ private static let swiftPackageSdkVersion = "3.5.0-dev.1466"
21
21
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
22
22
 
23
23
  private static func normalizedSdkVersion(_ value: String?) -> String? {
@@ -52,6 +52,7 @@ class DeviceStore {
52
52
  store.set("glasses", "hotspotSsid", "")
53
53
  store.set("glasses", "hotspotPassword", "")
54
54
  store.set("glasses", "hotspotGatewayIp", "")
55
+ store.set("glasses", "hotspotFrequency", 0)
55
56
  store.set("glasses", "bluetoothName", "")
56
57
  store.set("glasses", "macAddress", "")
57
58
  store.set("glasses", "controllerConnected", false)
@@ -3,9 +3,9 @@ import Foundation
3
3
  /// Generated by release CI. Do not edit in a release checkout.
4
4
  enum GeneratedReleaseMetadata {
5
5
  static let familyBaseVersion = "3.5.0"
6
- static let releaseIdentity = "3.5.0-dev.1462"
7
- static let releaseSetId = "mentra-3.5.0-dev.1462"
8
- static let sourceCommit = "4dc658df98cc64e6d48d0bbaaf7cc7e10803a6f6"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1462.json"
10
- static let otaManifestSha256 = "2c1cb9011d6d725760a395c3a2f35fa1c6c6f31159cc729963fa404d9851c1c9"
6
+ static let releaseIdentity = "3.5.0-dev.1466"
7
+ static let releaseSetId = "mentra-3.5.0-dev.1466"
8
+ static let sourceCommit = "a56ee0ee343ad2adcc0ca08228329427a24f65cc"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1466.json"
10
+ static let otaManifestSha256 = "2db50d0e64095f2636baafc59eb44d1ef4e865ed651457efcb1260686be1fa7f"
11
11
  }
@@ -3602,7 +3602,8 @@ class MentraLive: NSObject, SGCManager {
3602
3602
  let ssid = json["hotspot_ssid"] as? String ?? ""
3603
3603
  let password = json["hotspot_password"] as? String ?? ""
3604
3604
  let ip = json["hotspot_gateway_ip"] as? String ?? ""
3605
- updateHotspotStatus(enabled: enabled, ssid: ssid, password: password, ip: ip)
3605
+ let frequency = json["hotspot_frequency"] as? Int ?? 0
3606
+ updateHotspotStatus(enabled: enabled, ssid: ssid, password: password, ip: ip, frequency: frequency)
3606
3607
 
3607
3608
  case "hotspot_error":
3608
3609
  let errorMessage = json["error_message"] as? String ?? "Unknown hotspot error"
@@ -6947,12 +6948,13 @@ class MentraLive: NSObject, SGCManager {
6947
6948
  emitWifiStatusChange(error: error)
6948
6949
  }
6949
6950
 
6950
- private func updateHotspotStatus(enabled: Bool, ssid: String, password: String, ip: String) {
6951
+ private func updateHotspotStatus(enabled: Bool, ssid: String, password: String, ip: String, frequency: Int) {
6951
6952
  Bridge.log("LIVE: 🔥 Updating hotspot status - enabled: \(enabled), ssid: \(ssid)")
6952
6953
  DeviceStore.shared.apply("glasses", "hotspotEnabled", enabled)
6953
6954
  DeviceStore.shared.apply("glasses", "hotspotSsid", ssid)
6954
6955
  DeviceStore.shared.apply("glasses", "hotspotPassword", password)
6955
6956
  DeviceStore.shared.apply("glasses", "hotspotGatewayIp", ip) // This is the gateway IP from glasses
6957
+ DeviceStore.shared.apply("glasses", "hotspotFrequency", frequency)
6956
6958
  emitHotspotStatusChange()
6957
6959
  }
6958
6960
 
@@ -7374,7 +7376,8 @@ class MentraLive: NSObject, SGCManager {
7374
7376
  enabled: hotspotEnabled,
7375
7377
  ssid: hotspotSsid,
7376
7378
  password: hotspotPassword,
7377
- localIp: hotspotGatewayIp
7379
+ localIp: hotspotGatewayIp,
7380
+ frequency: hotspotFrequency
7378
7381
  ) else {
7379
7382
  return
7380
7383
  }
@@ -7480,6 +7483,7 @@ class MentraLive: NSObject, SGCManager {
7480
7483
  DeviceStore.shared.apply("glasses", "hotspotSsid", "")
7481
7484
  DeviceStore.shared.apply("glasses", "hotspotPassword", "")
7482
7485
  DeviceStore.shared.apply("glasses", "hotspotGatewayIp", "")
7486
+ DeviceStore.shared.apply("glasses", "hotspotFrequency", 0)
7483
7487
 
7484
7488
  connectedPeripheral = nil
7485
7489
  discoveredPeripherals.removeAll()
@@ -610,4 +610,8 @@ extension SGCManager {
610
610
  var hotspotGatewayIp: String {
611
611
  DeviceStore.shared.get("glasses", "hotspotGatewayIp") as? String ?? ""
612
612
  }
613
+
614
+ var hotspotFrequency: Int {
615
+ DeviceStore.shared.get("glasses", "hotspotFrequency") as? Int ?? 0
616
+ }
613
617
  }
@@ -343,6 +343,7 @@ struct GlassesStatus: CustomStringConvertible {
343
343
  dictionary.removeValue(forKey: "hotspotSsid")
344
344
  dictionary.removeValue(forKey: "hotspotPassword")
345
345
  dictionary.removeValue(forKey: "hotspotGatewayIp")
346
+ dictionary.removeValue(forKey: "hotspotFrequency")
346
347
  return dictionary
347
348
  }
348
349
 
@@ -380,6 +381,8 @@ struct GlassesStatus: CustomStringConvertible {
380
381
  dictionary.removeValue(forKey: "hotspotSsid")
381
382
  dictionary.removeValue(forKey: "hotspotPassword")
382
383
  dictionary.removeValue(forKey: "hotspotGatewayIp")
384
+ dictionary.removeValue(forKey: "hotspotFrequency")
385
+ dictionary.removeValue(forKey: "hotspotFrequency")
383
386
  }
384
387
  return dictionary
385
388
  }
@@ -180,9 +180,10 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
180
180
  }
181
181
 
182
182
  case disabled
183
- case enabled(ssid: String, password: String, localIp: String)
183
+ /// `frequency`: the AP's channel in MHz when the glasses know it (their station's, which the AP shares).
184
+ case enabled(ssid: String, password: String, localIp: String, frequency: Int?)
184
185
 
185
- public init?(enabled: Bool, ssid: String?, password: String?, localIp: String?) {
186
+ public init?(enabled: Bool, ssid: String?, password: String?, localIp: String?, frequency: Int? = nil) {
186
187
  if enabled {
187
188
  guard
188
189
  let ssid = ssid?.trimmingCharacters(in: .whitespacesAndNewlines),
@@ -194,7 +195,7 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
194
195
  else {
195
196
  return nil
196
197
  }
197
- self = .enabled(ssid: ssid, password: password, localIp: localIp)
198
+ self = .enabled(ssid: ssid, password: password, localIp: localIp, frequency: frequency.flatMap { $0 > 0 ? $0 : nil })
198
199
  } else {
199
200
  self = .disabled
200
201
  }
@@ -216,7 +217,8 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
216
217
  enabled: true,
217
218
  ssid: nonEmptyStringValue(values, "ssid"),
218
219
  password: nonEmptyStringValue(values, "password"),
219
- localIp: nonEmptyStringValue(values, "localIp")
220
+ localIp: nonEmptyStringValue(values, "localIp"),
221
+ frequency: intValue(values["frequency"])
220
222
  )
221
223
  case State.disabled.rawValue:
222
224
  self = .disabled
@@ -233,12 +235,13 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
233
235
  enabled: enabled,
234
236
  ssid: nonEmptyStringValue(values, "hotspotSsid"),
235
237
  password: nonEmptyStringValue(values, "hotspotPassword"),
236
- localIp: nonEmptyStringValue(values, "hotspotGatewayIp")
238
+ localIp: nonEmptyStringValue(values, "hotspotGatewayIp"),
239
+ frequency: intValue(values["hotspotFrequency"])
237
240
  )
238
241
  }
239
242
 
240
- static func fromStoreFields(enabled: Bool, ssid: String?, password: String?, localIp: String?) -> HotspotStatus? {
241
- HotspotStatus(enabled: enabled, ssid: ssid, password: password, localIp: localIp)
243
+ static func fromStoreFields(enabled: Bool, ssid: String?, password: String?, localIp: String?, frequency: Int? = nil) -> HotspotStatus? {
244
+ HotspotStatus(enabled: enabled, ssid: ssid, password: password, localIp: localIp, frequency: frequency)
242
245
  }
243
246
 
244
247
  var storeValues: [String: Any] {
@@ -249,13 +252,15 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
249
252
  "hotspotSsid": "",
250
253
  "hotspotPassword": "",
251
254
  "hotspotGatewayIp": "",
255
+ "hotspotFrequency": 0,
252
256
  ]
253
- case let .enabled(ssid, password, localIp):
257
+ case let .enabled(ssid, password, localIp, frequency):
254
258
  [
255
259
  "hotspotEnabled": true,
256
260
  "hotspotSsid": ssid,
257
261
  "hotspotPassword": password,
258
262
  "hotspotGatewayIp": localIp,
263
+ "hotspotFrequency": frequency ?? 0,
259
264
  ]
260
265
  }
261
266
  }
@@ -264,13 +269,13 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
264
269
  switch self {
265
270
  case .disabled:
266
271
  ["state": State.disabled.rawValue]
267
- case let .enabled(ssid, password, localIp):
268
- [
272
+ case let .enabled(ssid, password, localIp, frequency):
273
+ ([
269
274
  "state": State.enabled.rawValue,
270
275
  "ssid": ssid,
271
276
  "password": password,
272
277
  "localIp": localIp,
273
- ]
278
+ ] as [String: Any]).merging(frequency.map { ["frequency": $0] as [String: Any] } ?? [:]) { _, new in new }
274
279
  }
275
280
  }
276
281
 
@@ -294,7 +299,7 @@ public enum HotspotStatus: CustomStringConvertible, Equatable {
294
299
  switch self {
295
300
  case .disabled:
296
301
  "HotspotStatus(disabled)"
297
- case let .enabled(ssid, _, localIp):
302
+ case let .enabled(ssid, _, localIp, _):
298
303
  "HotspotStatus(enabled: \(ssid), localIp: \(localIp))"
299
304
  }
300
305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.5.0-dev.1462",
3
+ "version": "3.5.0-dev.1466",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",
@@ -115,7 +115,7 @@
115
115
  "registry": "https://registry.npmjs.org/"
116
116
  },
117
117
  "dependencies": {
118
- "@mentra/cloud-protocol": "3.5.0-dev.1462"
118
+ "@mentra/cloud-protocol": "3.5.0-dev.1466"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -216,7 +216,16 @@ export type SavedWifiNetworksEvent = {
216
216
  error?: string
217
217
  }
218
218
 
219
- export type HotspotStatus = {state: "disabled"} | {state: "enabled"; ssid: string; password: string; localIp: string}
219
+ export type HotspotStatus =
220
+ | {state: "disabled"}
221
+ | {
222
+ state: "enabled"
223
+ ssid: string
224
+ password: string
225
+ localIp: string
226
+ /** The AP's channel in MHz, when the glasses know it: their station's, which the AP shares. */
227
+ frequency?: number
228
+ }
220
229
 
221
230
  export type EnabledHotspotStatus = Extract<HotspotStatus, {state: "enabled"}>
222
231
 
@@ -515,6 +515,7 @@ function adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<stri
515
515
  hotspotSsid: hotspot.ssid,
516
516
  hotspotPassword: hotspot.password,
517
517
  hotspotGatewayIp: hotspot.localIp,
518
+ hotspotFrequency: hotspot.frequency ?? 0,
518
519
  }
519
520
  } else if (hotspot?.state === "disabled") {
520
521
  update = {
@@ -523,6 +524,7 @@ function adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<stri
523
524
  hotspotSsid: "",
524
525
  hotspotPassword: "",
525
526
  hotspotGatewayIp: "",
527
+ hotspotFrequency: 0,
526
528
  }
527
529
  }
528
530
  return update
@@ -12,9 +12,9 @@ export interface BluetoothSdkReleaseMetadata {
12
12
  export const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({
13
13
  "schemaVersion": 1,
14
14
  "familyBaseVersion": "3.5.0",
15
- "releaseIdentity": "3.5.0-dev.1462",
16
- "releaseSetId": "mentra-3.5.0-dev.1462",
17
- "sourceCommit": "4dc658df98cc64e6d48d0bbaaf7cc7e10803a6f6",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1462.json",
19
- "otaManifestSha256": "2c1cb9011d6d725760a395c3a2f35fa1c6c6f31159cc729963fa404d9851c1c9"
15
+ "releaseIdentity": "3.5.0-dev.1466",
16
+ "releaseSetId": "mentra-3.5.0-dev.1466",
17
+ "sourceCommit": "a56ee0ee343ad2adcc0ca08228329427a24f65cc",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1466.json",
19
+ "otaManifestSha256": "2db50d0e64095f2636baafc59eb44d1ef4e865ed651457efcb1260686be1fa7f"
20
20
  })
@@ -47,6 +47,7 @@ function hotspotStatusFromEvent(event: HotspotStatusChangeEvent): HotspotStatus
47
47
  ssid: event.ssid,
48
48
  password: event.password,
49
49
  localIp: event.localIp,
50
+ ...(event.frequency ? {frequency: event.frequency} : {}),
50
51
  }
51
52
  }
52
53
  return {state: event.state}