@mentra/bluetooth-sdk 3.3.0-dev.915 → 3.3.0-dev.917
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/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/ClassicAudioServiceDiscovery.kt +70 -0
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +40 -11
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/ClassicAudioServiceDiscoveryTest.kt +124 -0
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/package.json +2 -2
- package/src/generated/releaseMetadata.ts +5 -5
|
@@ -3,9 +3,9 @@ package com.mentra.bluetoothsdk
|
|
|
3
3
|
/** Generated by release CI. Do not edit in a release checkout. */
|
|
4
4
|
internal object GeneratedReleaseMetadata {
|
|
5
5
|
const val FAMILY_BASE_VERSION: String = "3.3.0"
|
|
6
|
-
const val RELEASE_IDENTITY: String = "3.3.0-dev.
|
|
7
|
-
const val RELEASE_SET_ID: String = "mentra-3.3.0-dev.
|
|
8
|
-
const val SOURCE_COMMIT: String = "
|
|
9
|
-
const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.
|
|
10
|
-
const val OTA_MANIFEST_SHA256: String = "
|
|
6
|
+
const val RELEASE_IDENTITY: String = "3.3.0-dev.917"
|
|
7
|
+
const val RELEASE_SET_ID: String = "mentra-3.3.0-dev.917"
|
|
8
|
+
const val SOURCE_COMMIT: String = "99f77350360ce687afa61be98a8c0e0cfe743e77"
|
|
9
|
+
const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.917.json"
|
|
10
|
+
const val OTA_MANIFEST_SHA256: String = "f6464930997126fd0c9f8aff4be529859ff22dbaec6655f188c0161fa0ef469e"
|
|
11
11
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
package com.mentra.bluetoothsdk.sgcs
|
|
2
|
+
|
|
3
|
+
import android.bluetooth.BluetoothDevice
|
|
4
|
+
import android.os.Handler
|
|
5
|
+
import android.os.ParcelUuid
|
|
6
|
+
|
|
7
|
+
/** One bounded SDP discovery; a BLE bond alone does not populate Android's Classic UUID cache. */
|
|
8
|
+
internal class ClassicAudioServiceDiscovery(
|
|
9
|
+
private val handler: Handler,
|
|
10
|
+
private val timeoutMs: Long,
|
|
11
|
+
private val log: (String) -> Unit,
|
|
12
|
+
) {
|
|
13
|
+
private class Pending(val device: BluetoothDevice, val ready: () -> Unit) {
|
|
14
|
+
lateinit var timeout: Runnable
|
|
15
|
+
}
|
|
16
|
+
private var pending: Pending? = null
|
|
17
|
+
|
|
18
|
+
fun connectWhenDiscovered(device: BluetoothDevice, ready: () -> Unit) {
|
|
19
|
+
if (hasAudioSink(device)) {
|
|
20
|
+
cancel()
|
|
21
|
+
ready()
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
if (pending?.device?.address == device.address) return
|
|
25
|
+
cancel()
|
|
26
|
+
val request = Pending(device, ready)
|
|
27
|
+
request.timeout = Runnable {
|
|
28
|
+
if (pending === request) {
|
|
29
|
+
cancel()
|
|
30
|
+
log("SDP timed out for ${device.address}; Classic audio remains disconnected")
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
pending = request
|
|
34
|
+
handler.postDelayed(request.timeout, timeoutMs)
|
|
35
|
+
try {
|
|
36
|
+
log("Refreshing Classic service UUIDs for ${device.address}")
|
|
37
|
+
if (!device.fetchUuidsWithSdp()) {
|
|
38
|
+
cancel()
|
|
39
|
+
log("SDP request rejected for ${device.address}; Classic audio remains disconnected")
|
|
40
|
+
}
|
|
41
|
+
} catch (error: Exception) {
|
|
42
|
+
cancel()
|
|
43
|
+
log("SDP request failed for ${device.address}: ${error.message}")
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** ACTION_UUID is a completion hint. Read the current OS cache, not a stale intent payload. */
|
|
48
|
+
fun onUuids(device: BluetoothDevice) {
|
|
49
|
+
val request = pending ?: return
|
|
50
|
+
if (device.address != request.device.address) return
|
|
51
|
+
if (hasAudioSink(request.device)) {
|
|
52
|
+
cancel()
|
|
53
|
+
log("Discovered A2DP Sink UUID for ${device.address}")
|
|
54
|
+
request.ready()
|
|
55
|
+
} else {
|
|
56
|
+
// Bonding can announce cached UUIDs before SDP finishes. Keep the original deadline.
|
|
57
|
+
log("UUID event without A2DP Sink for ${device.address}; waiting for SDP within the existing deadline")
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
fun cancel() {
|
|
62
|
+
pending?.let { handler.removeCallbacks(it.timeout) }
|
|
63
|
+
pending = null
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
companion object {
|
|
67
|
+
private val AUDIO_SINK = ParcelUuid.fromString("0000110b-0000-1000-8000-00805f9b34fb")
|
|
68
|
+
fun hasAudioSink(device: BluetoothDevice): Boolean = device.uuids?.contains(AUDIO_SINK) == true
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -646,6 +646,10 @@ class MentraLive : SGCManager() {
|
|
|
646
646
|
private var a2dpProfile: BluetoothA2dp? = null
|
|
647
647
|
private var isA2dpProxyRegistered = false
|
|
648
648
|
private var a2dpConnectAttempts = 0
|
|
649
|
+
private val classicAudioServiceDiscovery =
|
|
650
|
+
ClassicAudioServiceDiscovery(handler, CONNECTION_TIMEOUT_MS.toLong()) {
|
|
651
|
+
Bridge.log("LIVE: Classic: $it")
|
|
652
|
+
}
|
|
649
653
|
|
|
650
654
|
private data class OutgoingBleCommandTraceInfo(
|
|
651
655
|
val commandType: String,
|
|
@@ -1709,6 +1713,7 @@ class MentraLive : SGCManager() {
|
|
|
1709
1713
|
readinessCompletedThisBleSession = false
|
|
1710
1714
|
glassesReadyReceived = false
|
|
1711
1715
|
ctkdInitiatedThisGattSession = false
|
|
1716
|
+
classicAudioServiceDiscovery.cancel()
|
|
1712
1717
|
audioConnected = false
|
|
1713
1718
|
notificationsEnabled = false
|
|
1714
1719
|
currentMtu = 23
|
|
@@ -1984,6 +1989,7 @@ class MentraLive : SGCManager() {
|
|
|
1984
1989
|
readinessCompletedThisBleSession = false
|
|
1985
1990
|
glassesReadyReceived = false
|
|
1986
1991
|
ctkdInitiatedThisGattSession = false
|
|
1992
|
+
classicAudioServiceDiscovery.cancel()
|
|
1987
1993
|
audioConnected = false
|
|
1988
1994
|
notificationsEnabled = false
|
|
1989
1995
|
processSendQueueRunnable?.let { handler.removeCallbacks(it) }
|
|
@@ -2351,6 +2357,7 @@ class MentraLive : SGCManager() {
|
|
|
2351
2357
|
registerBondingReceiver()
|
|
2352
2358
|
bondingRetryCount = 0
|
|
2353
2359
|
ctkdInitiatedThisGattSession = false
|
|
2360
|
+
classicAudioServiceDiscovery.cancel()
|
|
2354
2361
|
Bridge.log(
|
|
2355
2362
|
"LIVE: CTKD: BLE GATT up - deferring Classic/A2DP until notifications ready"
|
|
2356
2363
|
)
|
|
@@ -2399,6 +2406,7 @@ class MentraLive : SGCManager() {
|
|
|
2399
2406
|
// Reset audio pairing flags
|
|
2400
2407
|
glassesReadyReceived = false
|
|
2401
2408
|
ctkdInitiatedThisGattSession = false
|
|
2409
|
+
classicAudioServiceDiscovery.cancel()
|
|
2402
2410
|
audioConnected = false
|
|
2403
2411
|
|
|
2404
2412
|
notificationsEnabled = false
|
|
@@ -2461,6 +2469,7 @@ class MentraLive : SGCManager() {
|
|
|
2461
2469
|
glassesReadyReceived = false
|
|
2462
2470
|
audioConnected = false
|
|
2463
2471
|
ctkdInitiatedThisGattSession = false
|
|
2472
|
+
classicAudioServiceDiscovery.cancel()
|
|
2464
2473
|
|
|
2465
2474
|
notificationsEnabled = false
|
|
2466
2475
|
|
|
@@ -7234,7 +7243,7 @@ class MentraLive : SGCManager() {
|
|
|
7234
7243
|
BluetoothDevice.BOND_BONDED ->
|
|
7235
7244
|
run {
|
|
7236
7245
|
Bridge.log(
|
|
7237
|
-
"LIVE: CTKD:
|
|
7246
|
+
"LIVE: CTKD: Successfully bonded - checking Classic audio services"
|
|
7238
7247
|
)
|
|
7239
7248
|
markPairingTiming(
|
|
7240
7249
|
"ctkd_bonded",
|
|
@@ -7253,7 +7262,7 @@ class MentraLive : SGCManager() {
|
|
|
7253
7262
|
// path does this at GATT connect).
|
|
7254
7263
|
// markAudioConnected / sendAudioConnected fire
|
|
7255
7264
|
// when the A2DP path completes.
|
|
7256
|
-
|
|
7265
|
+
prepareClassicAudio(device)
|
|
7257
7266
|
|
|
7258
7267
|
// Safety net: if glasses_ready somehow missed
|
|
7259
7268
|
// setting fullyBooted, catch up here.
|
|
@@ -7290,6 +7299,7 @@ class MentraLive : SGCManager() {
|
|
|
7290
7299
|
}
|
|
7291
7300
|
}
|
|
7292
7301
|
BluetoothDevice.BOND_NONE -> {
|
|
7302
|
+
classicAudioServiceDiscovery.cancel()
|
|
7293
7303
|
Bridge.log(
|
|
7294
7304
|
"LIVE: CTKD: ❌ Bonding failed or removed for device"
|
|
7295
7305
|
)
|
|
@@ -7411,6 +7421,10 @@ class MentraLive : SGCManager() {
|
|
|
7411
7421
|
classicAudioReceiver =
|
|
7412
7422
|
object : BroadcastReceiver() {
|
|
7413
7423
|
override fun onReceive(context: Context?, intent: Intent?) {
|
|
7424
|
+
if (intent?.action == BluetoothDevice.ACTION_UUID) {
|
|
7425
|
+
intent.bluetoothDeviceExtra()?.let { classicAudioServiceDiscovery.onUuids(it) }
|
|
7426
|
+
return
|
|
7427
|
+
}
|
|
7414
7428
|
if (intent?.action != BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED &&
|
|
7415
7429
|
intent?.action != BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED) return
|
|
7416
7430
|
val device = intent.bluetoothDeviceExtra() ?: return
|
|
@@ -7427,6 +7441,7 @@ class MentraLive : SGCManager() {
|
|
|
7427
7441
|
try {
|
|
7428
7442
|
val filter =
|
|
7429
7443
|
IntentFilter().apply {
|
|
7444
|
+
addAction(BluetoothDevice.ACTION_UUID)
|
|
7430
7445
|
addAction(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)
|
|
7431
7446
|
addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED)
|
|
7432
7447
|
}
|
|
@@ -7551,10 +7566,10 @@ class MentraLive : SGCManager() {
|
|
|
7551
7566
|
when (device.bondState) {
|
|
7552
7567
|
BluetoothDevice.BOND_BONDED -> {
|
|
7553
7568
|
Bridge.log(
|
|
7554
|
-
"LIVE: CTKD: Device is already bonded -
|
|
7569
|
+
"LIVE: CTKD: Device is already bonded - checking Classic audio services"
|
|
7555
7570
|
)
|
|
7556
7571
|
markPairingTiming("ctkd_already_bonded")
|
|
7557
|
-
|
|
7572
|
+
prepareClassicAudio(device)
|
|
7558
7573
|
}
|
|
7559
7574
|
BluetoothDevice.BOND_BONDING -> {
|
|
7560
7575
|
// Secure pairing firmware may request SMP as soon as GATT connects.
|
|
@@ -7613,6 +7628,19 @@ class MentraLive : SGCManager() {
|
|
|
7613
7628
|
return classicAudioConnectionTracker.connected
|
|
7614
7629
|
}
|
|
7615
7630
|
|
|
7631
|
+
private fun prepareClassicAudio(device: BluetoothDevice) {
|
|
7632
|
+
if (!canConnectClassicAudio(device)) return
|
|
7633
|
+
val gatt = bluetoothGatt
|
|
7634
|
+
classicAudioServiceDiscovery.connectWhenDiscovered(device) {
|
|
7635
|
+
if (bluetoothGatt === gatt && canConnectClassicAudio(device)) connectA2dpProfile(device)
|
|
7636
|
+
}
|
|
7637
|
+
}
|
|
7638
|
+
|
|
7639
|
+
private fun canConnectClassicAudio(device: BluetoothDevice): Boolean =
|
|
7640
|
+
!isKilled && !pairingYieldActive && isConnected && notificationsEnabled &&
|
|
7641
|
+
ctkdInitiatedThisGattSession && connectedDevice?.address == device.address &&
|
|
7642
|
+
device.bondState == BluetoothDevice.BOND_BONDED
|
|
7643
|
+
|
|
7616
7644
|
/** A2DP profile service listener for connecting to already-bonded devices */
|
|
7617
7645
|
private val a2dpServiceListener: BluetoothProfile.ServiceListener =
|
|
7618
7646
|
object : BluetoothProfile.ServiceListener {
|
|
@@ -7661,7 +7689,9 @@ class MentraLive : SGCManager() {
|
|
|
7661
7689
|
Bridge.log("LIVE: A2DP: Skipping connectA2dpWithProxy — SGC destroyed")
|
|
7662
7690
|
return
|
|
7663
7691
|
}
|
|
7664
|
-
if (
|
|
7692
|
+
if (device == null || !canConnectClassicAudio(device) ||
|
|
7693
|
+
!ClassicAudioServiceDiscovery.hasAudioSink(device)) return
|
|
7694
|
+
if (a2dpProfile == null) {
|
|
7665
7695
|
Bridge.log("LIVE: A2DP: Cannot connect - proxy or device is null")
|
|
7666
7696
|
return
|
|
7667
7697
|
}
|
|
@@ -7711,14 +7741,11 @@ class MentraLive : SGCManager() {
|
|
|
7711
7741
|
"LIVE: A2DP: Retry $a2dpConnectAttempts/$A2DP_CONNECT_MAX_ATTEMPTS in " +
|
|
7712
7742
|
"${A2DP_CONNECT_RETRY_MS}ms ($reason)"
|
|
7713
7743
|
)
|
|
7744
|
+
val gatt = bluetoothGatt
|
|
7714
7745
|
handler.postDelayed(
|
|
7715
7746
|
Runnable {
|
|
7716
|
-
if (
|
|
7717
|
-
|
|
7718
|
-
}
|
|
7719
|
-
val target = connectedDevice ?: return@Runnable
|
|
7720
|
-
if (a2dpProfile != null) {
|
|
7721
|
-
connectA2dpWithProxy(target)
|
|
7747
|
+
if (bluetoothGatt === gatt && canConnectClassicAudio(device)) {
|
|
7748
|
+
connectA2dpWithProxy(device)
|
|
7722
7749
|
}
|
|
7723
7750
|
},
|
|
7724
7751
|
A2DP_CONNECT_RETRY_MS
|
|
@@ -7938,6 +7965,7 @@ class MentraLive : SGCManager() {
|
|
|
7938
7965
|
|
|
7939
7966
|
// Mark as killed to prevent reconnection attempts
|
|
7940
7967
|
isKilled = true
|
|
7968
|
+
classicAudioServiceDiscovery.cancel()
|
|
7941
7969
|
explicitConnectByName = false
|
|
7942
7970
|
pairingYieldActive = false
|
|
7943
7971
|
pairingYieldAwaitingReclaim = false
|
|
@@ -8036,6 +8064,7 @@ class MentraLive : SGCManager() {
|
|
|
8036
8064
|
glassesReadyReceived = false
|
|
8037
8065
|
audioConnected = false
|
|
8038
8066
|
ctkdInitiatedThisGattSession = false
|
|
8067
|
+
classicAudioServiceDiscovery.cancel()
|
|
8039
8068
|
DeviceStore.apply("glasses", "fullyBooted", false)
|
|
8040
8069
|
updateConnectionState(ConnTypes.DISCONNECTED)
|
|
8041
8070
|
|
package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/ClassicAudioServiceDiscoveryTest.kt
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
package com.mentra.bluetoothsdk.sgcs
|
|
2
|
+
|
|
3
|
+
import android.bluetooth.BluetoothAdapter
|
|
4
|
+
import android.bluetooth.BluetoothDevice
|
|
5
|
+
import android.os.Handler
|
|
6
|
+
import android.os.Looper
|
|
7
|
+
import android.os.ParcelUuid
|
|
8
|
+
import java.time.Duration
|
|
9
|
+
import org.assertj.core.api.Assertions.assertThat
|
|
10
|
+
import org.junit.Test
|
|
11
|
+
import org.junit.runner.RunWith
|
|
12
|
+
import org.robolectric.RobolectricTestRunner
|
|
13
|
+
import org.robolectric.Shadows.shadowOf
|
|
14
|
+
import org.robolectric.annotation.Config
|
|
15
|
+
import org.robolectric.annotation.LooperMode
|
|
16
|
+
|
|
17
|
+
@RunWith(RobolectricTestRunner::class)
|
|
18
|
+
@Config(sdk = [33])
|
|
19
|
+
@LooperMode(LooperMode.Mode.PAUSED)
|
|
20
|
+
class ClassicAudioServiceDiscoveryTest {
|
|
21
|
+
private val target = BluetoothAdapter.getDefaultAdapter().getRemoteDevice("AA:BB:CC:DD:EE:FF")
|
|
22
|
+
private val sink = ParcelUuid.fromString("0000110b-0000-1000-8000-00805f9b34fb")
|
|
23
|
+
private val zero = ParcelUuid.fromString("00000000-0000-0000-0000-000000000000")
|
|
24
|
+
private val messages = mutableListOf<String>()
|
|
25
|
+
private val discovery = ClassicAudioServiceDiscovery(Handler(Looper.getMainLooper()), 30000, messages::add)
|
|
26
|
+
private var connects = 0
|
|
27
|
+
|
|
28
|
+
private fun request(device: BluetoothDevice = target) {
|
|
29
|
+
discovery.connectWhenDiscovered(device) { connects++ }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Test fun `bonded Samsung zero UUID inventory waits for real Audio Sink discovery`() {
|
|
33
|
+
shadowOf(target).setBondState(BluetoothDevice.BOND_BONDED)
|
|
34
|
+
shadowOf(target).setUuids(arrayOf(zero))
|
|
35
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
36
|
+
request()
|
|
37
|
+
assertThat(connects).isZero()
|
|
38
|
+
assertThat(shadowOf(target).fetchUuidsWithSdpCount).isEqualTo(1)
|
|
39
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
40
|
+
discovery.onUuids(target)
|
|
41
|
+
discovery.onUuids(target)
|
|
42
|
+
assertThat(connects).isEqualTo(1)
|
|
43
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(30))
|
|
44
|
+
assertThat(messages.none { it.contains("timed out") }).isTrue()
|
|
45
|
+
assertThat(target.bondState).isEqualTo(BluetoothDevice.BOND_BONDED)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Test fun `valid cached Audio Sink needs no refresh`() {
|
|
49
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
50
|
+
request()
|
|
51
|
+
assertThat(connects).isEqualTo(1)
|
|
52
|
+
assertThat(shadowOf(target).fetchUuidsWithSdpCount).isZero()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Test fun `early empty UUID broadcast preserves the wait for the actual SDP result`() {
|
|
56
|
+
shadowOf(target).setUuids(arrayOf(zero))
|
|
57
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
58
|
+
request()
|
|
59
|
+
discovery.onUuids(target)
|
|
60
|
+
assertThat(connects).isZero()
|
|
61
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
62
|
+
discovery.onUuids(target)
|
|
63
|
+
assertThat(connects).isEqualTo(1)
|
|
64
|
+
assertThat(shadowOf(target).fetchUuidsWithSdpCount).isEqualTo(1)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Test fun `unrelated device and duplicate requests cannot complete or multiply discovery`() {
|
|
68
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
69
|
+
request()
|
|
70
|
+
request()
|
|
71
|
+
val other = BluetoothAdapter.getDefaultAdapter().getRemoteDevice("11:22:33:44:55:66")
|
|
72
|
+
shadowOf(other).setUuids(arrayOf(sink))
|
|
73
|
+
discovery.onUuids(other)
|
|
74
|
+
assertThat(connects).isZero()
|
|
75
|
+
assertThat(shadowOf(target).fetchUuidsWithSdpCount).isEqualTo(1)
|
|
76
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
77
|
+
discovery.onUuids(target)
|
|
78
|
+
assertThat(connects).isEqualTo(1)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@Test fun `rejected SDP request does not connect on a later unsolicited event`() {
|
|
82
|
+
shadowOf(target).setFetchUuidsWithSdpResult(false)
|
|
83
|
+
request()
|
|
84
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
85
|
+
discovery.onUuids(target)
|
|
86
|
+
assertThat(connects).isZero()
|
|
87
|
+
assertThat(messages.last()).contains("rejected")
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@Test fun `missing UUID broadcast times out without connecting on a late event`() {
|
|
91
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
92
|
+
request()
|
|
93
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(20))
|
|
94
|
+
discovery.onUuids(target)
|
|
95
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(10))
|
|
96
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
97
|
+
discovery.onUuids(target)
|
|
98
|
+
assertThat(connects).isZero()
|
|
99
|
+
assertThat(messages.last()).contains("timed out")
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@Test fun `teardown cancellation invalidates callback and removes its timeout`() {
|
|
103
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
104
|
+
request()
|
|
105
|
+
discovery.cancel()
|
|
106
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
107
|
+
discovery.onUuids(target)
|
|
108
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(30))
|
|
109
|
+
assertThat(connects).isZero()
|
|
110
|
+
assertThat(messages.none { it.contains("timed out") }).isTrue()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@Test fun `previous session timeout cannot cancel rediscovery for the same glasses`() {
|
|
114
|
+
shadowOf(target).setFetchUuidsWithSdpResult(true)
|
|
115
|
+
request()
|
|
116
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(20))
|
|
117
|
+
discovery.cancel()
|
|
118
|
+
request()
|
|
119
|
+
shadowOf(Looper.getMainLooper()).idleFor(Duration.ofSeconds(10))
|
|
120
|
+
shadowOf(target).setUuids(arrayOf(sink))
|
|
121
|
+
discovery.onUuids(target)
|
|
122
|
+
assertThat(connects).isEqualTo(1)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"familyBaseVersion": "3.3.0",
|
|
4
|
-
"releaseIdentity": "3.3.0-dev.
|
|
5
|
-
"releaseSetId": "mentra-3.3.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
7
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.
|
|
8
|
-
"otaManifestSha256": "
|
|
4
|
+
"releaseIdentity": "3.3.0-dev.917",
|
|
5
|
+
"releaseSetId": "mentra-3.3.0-dev.917",
|
|
6
|
+
"sourceCommit": "99f77350360ce687afa61be98a8c0e0cfe743e77",
|
|
7
|
+
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.917.json",
|
|
8
|
+
"otaManifestSha256": "f6464930997126fd0c9f8aff4be529859ff22dbaec6655f188c0161fa0ef469e"
|
|
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,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,iIAAiI;IACnJ,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.3.0\",\n \"releaseIdentity\": \"3.3.0-dev.
|
|
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,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,iIAAiI;IACnJ,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.3.0\",\n \"releaseIdentity\": \"3.3.0-dev.917\",\n \"releaseSetId\": \"mentra-3.3.0-dev.917\",\n \"sourceCommit\": \"99f77350360ce687afa61be98a8c0e0cfe743e77\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.917.json\",\n \"otaManifestSha256\": \"f6464930997126fd0c9f8aff4be529859ff22dbaec6655f188c0161fa0ef469e\"\n})\n"]}
|
|
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
|
|
|
16
16
|
/// silently disable it on every pair the app touches.
|
|
17
17
|
static let autoPowerOffEnabled = false
|
|
18
18
|
private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
|
|
19
|
-
private static let swiftPackageSdkVersion = "3.3.0-dev.
|
|
19
|
+
private static let swiftPackageSdkVersion = "3.3.0-dev.917"
|
|
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.3.0"
|
|
6
|
-
static let releaseIdentity = "3.3.0-dev.
|
|
7
|
-
static let releaseSetId = "mentra-3.3.0-dev.
|
|
8
|
-
static let sourceCommit = "
|
|
9
|
-
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.
|
|
10
|
-
static let otaManifestSha256 = "
|
|
6
|
+
static let releaseIdentity = "3.3.0-dev.917"
|
|
7
|
+
static let releaseSetId = "mentra-3.3.0-dev.917"
|
|
8
|
+
static let sourceCommit = "99f77350360ce687afa61be98a8c0e0cfe743e77"
|
|
9
|
+
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.917.json"
|
|
10
|
+
static let otaManifestSha256 = "f6464930997126fd0c9f8aff4be529859ff22dbaec6655f188c0161fa0ef469e"
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/bluetooth-sdk",
|
|
3
|
-
"version": "3.3.0-dev.
|
|
3
|
+
"version": "3.3.0-dev.917",
|
|
4
4
|
"description": "SDK for communicating with smart glasses",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"registry": "https://registry.npmjs.org/"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@mentra/cloud-protocol": "3.3.0-dev.
|
|
117
|
+
"@mentra/cloud-protocol": "3.3.0-dev.917"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
120
|
"@types/node": "^25.9.3",
|
|
@@ -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.3.0",
|
|
15
|
-
"releaseIdentity": "3.3.0-dev.
|
|
16
|
-
"releaseSetId": "mentra-3.3.0-dev.
|
|
17
|
-
"sourceCommit": "
|
|
18
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.
|
|
19
|
-
"otaManifestSha256": "
|
|
15
|
+
"releaseIdentity": "3.3.0-dev.917",
|
|
16
|
+
"releaseSetId": "mentra-3.3.0-dev.917",
|
|
17
|
+
"sourceCommit": "99f77350360ce687afa61be98a8c0e0cfe743e77",
|
|
18
|
+
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.3.0/mentra-live-ota-3.3.0-dev.917.json",
|
|
19
|
+
"otaManifestSha256": "f6464930997126fd0c9f8aff4be529859ff22dbaec6655f188c0161fa0ef469e"
|
|
20
20
|
})
|