@mentra/bluetooth-sdk 3.5.0-dev.1291 → 3.5.0-dev.1294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +15 -6
- package/README.md +1 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +1 -3
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +7 -1
- package/build/BluetoothSdk.types.d.ts +3 -1
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +0 -1
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/react/useGlassesConnection.d.ts +1 -1
- package/build/react/useGlassesConnection.d.ts.map +1 -1
- package/build/react/useGlassesConnection.js +3 -3
- package/build/react/useGlassesConnection.js.map +1 -1
- package/build/react/useMentraBluetooth.d.ts +1 -1
- package/build/react/useMentraBluetooth.d.ts.map +1 -1
- package/build/react/useMentraBluetooth.js +1 -1
- package/build/react/useMentraBluetooth.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +1 -7
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/ios/Source/MentraBluetoothSDK.swift +8 -1
- package/package.json +2 -2
- package/src/BluetoothSdk.types.ts +3 -1
- package/src/_private/BluetoothSdkModule.ts +0 -1
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/index.ts +1 -1
- package/src/react/useGlassesConnection.ts +4 -4
- 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
|
|
234
|
+
try await self.bluetoothSdk().unpair()
|
|
241
235
|
}
|
|
242
236
|
|
|
243
237
|
AsyncFunction("forgetController") {
|
|
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
|
|
|
16
16
|
/// silently disable it on every pair the app touches.
|
|
17
17
|
static let autoPowerOffEnabled = true
|
|
18
18
|
private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
|
|
19
|
-
private static let swiftPackageSdkVersion = "3.5.0-dev.
|
|
19
|
+
private static let swiftPackageSdkVersion = "3.5.0-dev.1294"
|
|
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.5.0"
|
|
6
|
-
static let releaseIdentity = "3.5.0-dev.
|
|
7
|
-
static let releaseSetId = "mentra-3.5.0-dev.
|
|
8
|
-
static let sourceCommit = "
|
|
9
|
-
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
10
|
-
static let otaManifestSha256 = "
|
|
6
|
+
static let releaseIdentity = "3.5.0-dev.1294"
|
|
7
|
+
static let releaseSetId = "mentra-3.5.0-dev.1294"
|
|
8
|
+
static let sourceCommit = "261d8dc6b7b0758a51e2e86fcb4f6ae7dc1d5031"
|
|
9
|
+
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1294.json"
|
|
10
|
+
static let otaManifestSha256 = "bf0195f92299e88580d2a1c533f974d11982f99fcf58343dd7139a9d9247be83"
|
|
11
11
|
}
|
|
@@ -450,7 +450,7 @@ public final class MentraBluetoothSDK {
|
|
|
450
450
|
finishDefaultDeviceApply(generation: generation)
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
|
|
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.5.0-dev.
|
|
3
|
+
"version": "3.5.0-dev.1294",
|
|
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.
|
|
118
|
+
"@mentra/cloud-protocol": "3.5.0-dev.1294"
|
|
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.5.0",
|
|
15
|
-
"releaseIdentity": "3.5.0-dev.
|
|
16
|
-
"releaseSetId": "mentra-3.5.0-dev.
|
|
17
|
-
"sourceCommit": "
|
|
18
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
19
|
-
"otaManifestSha256": "
|
|
15
|
+
"releaseIdentity": "3.5.0-dev.1294",
|
|
16
|
+
"releaseSetId": "mentra-3.5.0-dev.1294",
|
|
17
|
+
"sourceCommit": "261d8dc6b7b0758a51e2e86fcb4f6ae7dc1d5031",
|
|
18
|
+
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1294.json",
|
|
19
|
+
"otaManifestSha256": "bf0195f92299e88580d2a1c533f974d11982f99fcf58343dd7139a9d9247be83"
|
|
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
|
-
|
|
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
|
|
155
|
+
async function unpair() {
|
|
156
156
|
await runConnectionAction("forgetting", async () => {
|
|
157
|
-
await BluetoothSdk.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
315
|
+
unpair: connection.unpair,
|
|
316
316
|
connect: connection.connect,
|
|
317
317
|
connectDefault: connection.connectDefault,
|
|
318
318
|
defaultDevice: connection.defaultDevice,
|