@mentra/bluetooth-sdk 3.2.0-dev.193 → 3.2.0-dev.200
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/README.md +30 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +14 -1
- package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +7 -2
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +33 -7
- package/android/src/main/java/com/mentra/bluetoothsdk/VersionInfoResponseAccumulator.kt +88 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/services/Foreground.kt +50 -16
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +314 -75
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLiveGattLifecycle.kt +64 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SerializedGattCallback.kt +76 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/status/DeviceStatus.kt +2 -3
- package/android/src/test/java/com/mentra/bluetoothsdk/VersionInfoBridgeTest.kt +33 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/VersionInfoResponseAccumulatorTest.kt +169 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/services/ForegroundServiceManifestTest.kt +57 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/services/ForegroundServiceTypeTest.kt +52 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveGattCallbackTest.kt +94 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveGattLifecycleTest.kt +112 -0
- package/build/BluetoothSdk.types.d.ts +7 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +1 -0
- 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/react/useGlassesConnection.d.ts +5 -0
- package/build/react/useGlassesConnection.d.ts.map +1 -1
- package/build/react/useGlassesConnection.js +2 -2
- package/build/react/useGlassesConnection.js.map +1 -1
- package/build/react/useMentraBluetooth.d.ts +5 -0
- package/build/react/useMentraBluetooth.d.ts.map +1 -1
- package/build/react/useMentraBluetooth.js +1 -0
- package/build/react/useMentraBluetooth.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +2 -2
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/Bridge.swift +15 -1
- package/ios/Source/DeviceManager.swift +11 -5
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/ios/Source/MentraBluetoothSDK.swift +42 -9
- package/ios/Source/requests/VersionInfoResponseAccumulator.swift +101 -0
- package/ios/Source/sgcs/MentraLive.swift +29 -5
- package/ios/Source/status/DeviceStatus.swift +2 -3
- package/ios/Source/types/DeviceModels.swift +9 -1
- package/ios/Tests/MentraLiveConnectionOptionsTests.swift +30 -0
- package/ios/Tests/VersionInfoBridgeTests.swift +32 -0
- package/ios/Tests/VersionInfoResponseAccumulatorTests.swift +181 -0
- package/package.json +1 -1
- package/src/BluetoothSdk.types.ts +7 -0
- package/src/_private/BluetoothSdkModule.ts +1 -0
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/react/useGlassesConnection.ts +7 -2
- package/src/react/useMentraBluetooth.ts +6 -0
|
@@ -22,6 +22,11 @@ export type UseGlassesConnectionOptions = {
|
|
|
22
22
|
autoConnectDefault?: boolean
|
|
23
23
|
defaultDeviceStorage?: DefaultDeviceStorage
|
|
24
24
|
onError?: (error: unknown) => void
|
|
25
|
+
/**
|
|
26
|
+
* Whether iOS should require ANCS authorization when automatically connecting.
|
|
27
|
+
* Defaults to true. Android accepts this option as a no-op.
|
|
28
|
+
*/
|
|
29
|
+
requiresAncs?: boolean
|
|
25
30
|
scanModel?: DeviceModel
|
|
26
31
|
scanTimeoutMs?: number
|
|
27
32
|
}
|
|
@@ -117,8 +122,8 @@ export function useGlassesConnection(
|
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
autoConnectAttemptedRef.current = true
|
|
120
|
-
void connectDefault().catch(() => undefined)
|
|
121
|
-
}, [defaultDevice, options.autoConnectDefault, status.connected])
|
|
125
|
+
void connectDefault({requiresAncs: options.requiresAncs ?? true}).catch(() => undefined)
|
|
126
|
+
}, [defaultDevice, options.autoConnectDefault, options.requiresAncs, status.connected])
|
|
122
127
|
|
|
123
128
|
async function runConnectionAction<T>(
|
|
124
129
|
nextAction: Exclude<GlassesConnectionAction, "idle" | "scanning">,
|
|
@@ -121,6 +121,11 @@ export type UseMentraBluetoothOptions = {
|
|
|
121
121
|
defaultDeviceStorage?: DefaultDeviceStorage
|
|
122
122
|
defaultModel?: DeviceModel
|
|
123
123
|
onError?: (error: unknown) => void
|
|
124
|
+
/**
|
|
125
|
+
* Whether iOS should require ANCS authorization when automatically connecting.
|
|
126
|
+
* Defaults to true. Android accepts this option as a no-op.
|
|
127
|
+
*/
|
|
128
|
+
requiresAncs?: boolean
|
|
124
129
|
scanTimeoutMs?: number
|
|
125
130
|
}
|
|
126
131
|
|
|
@@ -269,6 +274,7 @@ export function useMentraBluetooth(options: UseMentraBluetoothOptions = {}): Men
|
|
|
269
274
|
autoConnectDefault: options.autoConnectDefault,
|
|
270
275
|
defaultDeviceStorage: options.defaultDeviceStorage,
|
|
271
276
|
onError: options.onError,
|
|
277
|
+
requiresAncs: options.requiresAncs,
|
|
272
278
|
scanModel: options.defaultModel ?? DeviceModels.MentraLive,
|
|
273
279
|
scanTimeoutMs: options.scanTimeoutMs,
|
|
274
280
|
})
|