@mentra/bluetooth-sdk 3.4.0-beta.1293 → 3.4.0-beta.1296

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/MIGRATION.md +15 -6
  2. package/README.md +1 -1
  3. package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkDefaults.kt +4 -3
  4. package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +1 -3
  5. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
  6. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +7 -1
  7. package/build/BluetoothSdk.types.d.ts +3 -1
  8. package/build/BluetoothSdk.types.d.ts.map +1 -1
  9. package/build/BluetoothSdk.types.js.map +1 -1
  10. package/build/_private/BluetoothSdkModule.d.ts +0 -1
  11. package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
  12. package/build/_private/BluetoothSdkModule.js.map +1 -1
  13. package/build/generated/releaseMetadata.js +5 -5
  14. package/build/generated/releaseMetadata.js.map +1 -1
  15. package/build/index.js +1 -1
  16. package/build/index.js.map +1 -1
  17. package/build/react/useGlassesConnection.d.ts +1 -1
  18. package/build/react/useGlassesConnection.d.ts.map +1 -1
  19. package/build/react/useGlassesConnection.js +3 -3
  20. package/build/react/useGlassesConnection.js.map +1 -1
  21. package/build/react/useMentraBluetooth.d.ts +1 -1
  22. package/build/react/useMentraBluetooth.d.ts.map +1 -1
  23. package/build/react/useMentraBluetooth.js +1 -1
  24. package/build/react/useMentraBluetooth.js.map +1 -1
  25. package/ios/BluetoothSdkModule.swift +1 -7
  26. package/ios/Source/BluetoothSdkDefaults.swift +5 -5
  27. package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
  28. package/ios/Source/MentraBluetoothSDK.swift +8 -1
  29. package/package.json +2 -2
  30. package/src/BluetoothSdk.types.ts +3 -1
  31. package/src/_private/BluetoothSdkModule.ts +0 -1
  32. package/src/generated/releaseMetadata.ts +5 -5
  33. package/src/index.ts +1 -1
  34. package/src/react/useGlassesConnection.ts +4 -4
  35. package/src/react/useMentraBluetooth.ts +2 -2
@@ -188,12 +188,6 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
188
188
  }
189
189
  }
190
190
 
191
- AsyncFunction("clearDefaultDevice") {
192
- await MainActor.run {
193
- self.bluetoothSdk().clearDefaultDevice()
194
- }
195
- }
196
-
197
191
  AsyncFunction("connectWithOptions") { (device: [String: Any], options: [String: Any]) in
198
192
  try await MainActor.run {
199
193
  guard let target = Device(dictionary: device) else {
@@ -237,7 +231,7 @@ public class BluetoothSdkModule: Module, MentraBluetoothSDKDelegate {
237
231
  }
238
232
 
239
233
  AsyncFunction("unpair") {
240
- try await DeviceManager.shared.unpair()
234
+ try await self.bluetoothSdk().unpair()
241
235
  }
242
236
 
243
237
  AsyncFunction("forgetController") {
@@ -11,12 +11,12 @@ enum BluetoothSdkDefaults {
11
11
  static let voiceActivityDetectionEnabled = false
12
12
  static let loudnessGateEnabled = true
13
13
 
14
- /// Must stay true. The firmware defaults auto power-off on, and we re-push
15
- /// every Bluetooth setting on connect, so a false default here would
16
- /// silently disable it on every pair the app touches.
17
- static let autoPowerOffEnabled = true
14
+ /// Must match the firmware and Mentra App default (off). We re-push every
15
+ /// Bluetooth setting on connect, so a true default here turns on the
16
+ /// 20-minute unworn power-off on every pair the app touches.
17
+ static let autoPowerOffEnabled = false
18
18
  private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
19
- private static let swiftPackageSdkVersion = "3.4.0-beta.1293"
19
+ private static let swiftPackageSdkVersion = "3.4.0-beta.1296"
20
20
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
21
21
 
22
22
  private static func normalizedSdkVersion(_ value: String?) -> String? {
@@ -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.4.0"
6
- static let releaseIdentity = "3.4.0-beta.1293"
7
- static let releaseSetId = "mentra-3.4.0-beta.1293"
8
- static let sourceCommit = "8202d58f30a9eae28f93b45d44c8cc4834e10f44"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1293.json"
10
- static let otaManifestSha256 = "b927ecfbc4b8f99a7eb6024385df5ff72bafec18ccc89e2600e639927ed1dc4b"
6
+ static let releaseIdentity = "3.4.0-beta.1296"
7
+ static let releaseSetId = "mentra-3.4.0-beta.1296"
8
+ static let sourceCommit = "0380ba8fea16ed46215a90d762f595577994ec88"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1296.json"
10
+ static let otaManifestSha256 = "093a0c578fa5310d89900ea874eae0d3669c51d95b30efa386cd7db0a76de3b8"
11
11
  }
@@ -450,7 +450,7 @@ public final class MentraBluetoothSDK {
450
450
  finishDefaultDeviceApply(generation: generation)
451
451
  }
452
452
 
453
- public func clearDefaultDevice() {
453
+ private func clearDefaultDevice() {
454
454
  defaultDeviceApplyGeneration += 1
455
455
  let generation = defaultDeviceApplyGeneration
456
456
  suppressDefaultDeviceEvents = true
@@ -617,6 +617,13 @@ public final class MentraBluetoothSDK {
617
617
  DeviceManager.shared.forget()
618
618
  }
619
619
 
620
+ /// Unpair the glasses: disconnect, forget the default device and, on Mentra Live, remove the phone's Bluetooth bond.
621
+ public func unpair() async throws {
622
+ analytics.noteDisconnectRequested(BluetoothSdkAnalyticsTracker.disconnectForget)
623
+ clearBluetoothRestoreIntent()
624
+ try await DeviceManager.shared.unpair()
625
+ }
626
+
620
627
  public func displayText(_ text: String, x: Int = 0, y: Int = 0, size: Int = 24) async throws {
621
628
  try await displayText(DisplayTextRequest(text: text, x: x, y: y, size: size))
622
629
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.4.0-beta.1293",
3
+ "version": "3.4.0-beta.1296",
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.4.0-beta.1293"
118
+ "@mentra/cloud-protocol": "3.4.0-beta.1296"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -1554,7 +1554,6 @@ export interface BluetoothSdkPublicModule {
1554
1554
 
1555
1555
  getDefaultDevice(): Promise<Device | null>
1556
1556
  setDefaultDevice(device: Device | null): Promise<void>
1557
- clearDefaultDevice(): Promise<void>
1558
1557
 
1559
1558
  startScan(model: DeviceModel): Promise<void>
1560
1559
  stopScan(): Promise<void>
@@ -1565,6 +1564,9 @@ export interface BluetoothSdkPublicModule {
1565
1564
  cancelConnectionAttempt(): Promise<void>
1566
1565
  disconnect(): Promise<void>
1567
1566
  forget(): Promise<void>
1567
+ /** Unpair the glasses: disconnect, forget them as the default device and, on Mentra Live, remove the phone's Bluetooth
1568
+ * bond, so the next pairing starts from pairing mode. */
1569
+ unpair(): Promise<void>
1568
1570
 
1569
1571
  displayText(text: string, x?: number, y?: number, size?: number): Promise<void>
1570
1572
  clearDisplay(): Promise<void>
@@ -96,7 +96,6 @@ declare class BluetoothSdkNativeModule extends NativeModule<BluetoothSdkModuleEv
96
96
  connectDefault(options?: ConnectOptions): Promise<void>
97
97
  connectDefaultWithOptions(options: Required<ConnectOptions>): Promise<void>
98
98
  setDefaultDevice(device: Device | null): Promise<void>
99
- clearDefaultDevice(): Promise<void>
100
99
  /** Android only: iOS cannot read its Bluetooth bonds. */
101
100
  getBondedGlasses?: () => Promise<{name: string; address: string} | null>
102
101
  getScanDiagnostic?: (model: DeviceModel) => Promise<ScanDiagnostic | null>
@@ -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.4.0",
15
- "releaseIdentity": "3.4.0-beta.1293",
16
- "releaseSetId": "mentra-3.4.0-beta.1293",
17
- "sourceCommit": "8202d58f30a9eae28f93b45d44c8cc4834e10f44",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1293.json",
19
- "otaManifestSha256": "b927ecfbc4b8f99a7eb6024385df5ff72bafec18ccc89e2600e639927ed1dc4b"
15
+ "releaseIdentity": "3.4.0-beta.1296",
16
+ "releaseSetId": "mentra-3.4.0-beta.1296",
17
+ "sourceCommit": "0380ba8fea16ed46215a90d762f595577994ec88",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1296.json",
19
+ "otaManifestSha256": "093a0c578fa5310d89900ea874eae0d3669c51d95b30efa386cd7db0a76de3b8"
20
20
  })
package/src/index.ts CHANGED
@@ -108,7 +108,6 @@ export const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({
108
108
  PrivateBluetoothSdkModule.onBluetoothStatus(listener),
109
109
  getDefaultDevice: bindPublicMethod("getDefaultDevice"),
110
110
  setDefaultDevice: bindPublicMethod("setDefaultDevice"),
111
- clearDefaultDevice: bindPublicMethod("clearDefaultDevice"),
112
111
  startScan: bindPublicMethod("startScan"),
113
112
  stopScan: bindPublicMethod("stopScan"),
114
113
  scan: bindPublicMethod("scan") as BluetoothSdkPublicModule["scan"],
@@ -117,6 +116,7 @@ export const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({
117
116
  cancelConnectionAttempt: bindPublicMethod("cancelConnectionAttempt"),
118
117
  disconnect: bindPublicMethod("disconnect"),
119
118
  forget: bindPublicMethod("forget"),
119
+ unpair: bindPublicMethod("unpair"),
120
120
  displayText: bindPublicMethod("displayText"),
121
121
  clearDisplay: bindPublicMethod("clearDisplay"),
122
122
  setDashboardContent: bindPublicMethod("setDashboardContent"),
@@ -34,7 +34,7 @@ export type UseGlassesConnectionOptions = {
34
34
  export type GlassesConnectionHookResult = BluetoothStatusHookResult & {
35
35
  action: GlassesConnectionAction
36
36
  busy: boolean
37
- clearDefaultDevice: () => Promise<void>
37
+ unpair: () => Promise<void>
38
38
  connect: (device?: Device, options?: ConnectOptions) => Promise<void>
39
39
  connectDefault: (options?: ConnectOptions) => Promise<void>
40
40
  defaultDevice: Device | null
@@ -152,9 +152,9 @@ export function useGlassesConnection(
152
152
  })
153
153
  }
154
154
 
155
- async function clearDefaultDevice() {
155
+ async function unpair() {
156
156
  await runConnectionAction("forgetting", async () => {
157
- await BluetoothSdk.clearDefaultDevice()
157
+ await BluetoothSdk.unpair()
158
158
  await defaultDeviceStorageRef.current?.save(null)
159
159
  setDefaultDeviceState(null)
160
160
  scan.selectDevice(null)
@@ -201,7 +201,7 @@ export function useGlassesConnection(
201
201
  ...status,
202
202
  action: scan.scanning ? "scanning" : action,
203
203
  busy,
204
- clearDefaultDevice,
204
+ unpair,
205
205
  connect,
206
206
  connectDefault,
207
207
  defaultDevice,
@@ -131,7 +131,7 @@ export type UseMentraBluetoothOptions = {
131
131
 
132
132
  export type MentraBluetoothSession = {
133
133
  busy: boolean
134
- clearDefaultDevice: () => Promise<void>
134
+ unpair: () => Promise<void>
135
135
  connect: (device?: Device, options?: ConnectOptions) => Promise<void>
136
136
  connectDefault: (options?: ConnectOptions) => Promise<void>
137
137
  defaultDevice: Device | null
@@ -312,7 +312,7 @@ export function useMentraBluetooth(options: UseMentraBluetoothOptions = {}): Men
312
312
 
313
313
  return {
314
314
  busy: connection.busy || galleryModeApplying,
315
- clearDefaultDevice: connection.clearDefaultDevice,
315
+ unpair: connection.unpair,
316
316
  connect: connection.connect,
317
317
  connectDefault: connection.connectDefault,
318
318
  defaultDevice: connection.defaultDevice,