@mentra/bluetooth-sdk 3.5.0-dev.1274 → 3.5.0-dev.1276

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 (36) hide show
  1. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
  2. package/android/src/main/java/com/mentra/bluetoothsdk/MentraLocalNetworkModule.kt +57 -196
  3. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/Ipv4Prefix.kt +51 -0
  4. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/NetworkFacts.kt +81 -0
  5. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkError.kt +109 -0
  6. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkReadiness.kt +103 -0
  7. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkRequestSpec.kt +53 -0
  8. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkState.kt +127 -0
  9. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/ScopedSoftApNetwork.kt +604 -0
  10. package/android/src/main/java/com/mentra/bluetoothsdk/hotspot/SoftApTrace.kt +143 -0
  11. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/Ipv4PrefixTest.kt +59 -0
  12. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/NetworkFactsTest.kt +59 -0
  13. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/ScopedLocalNetworkPermissionTest.kt +35 -0
  14. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkErrorTest.kt +96 -0
  15. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkLifecycleTest.kt +187 -0
  16. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkReadinessTest.kt +141 -0
  17. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/ScopedNetworkRequestSpecTest.kt +69 -0
  18. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/SoftApTraceTest.kt +97 -0
  19. package/android/src/test/java/com/mentra/bluetoothsdk/hotspot/UnavailableRetryTest.kt +47 -0
  20. package/build/_private/MentraLocalNetworkModule.d.ts +1 -1
  21. package/build/_private/MentraLocalNetworkModule.d.ts.map +1 -1
  22. package/build/_private/MentraLocalNetworkModule.js.map +1 -1
  23. package/build/generated/releaseMetadata.js +5 -5
  24. package/build/generated/releaseMetadata.js.map +1 -1
  25. package/build/ota-transport/index.d.ts +3 -2
  26. package/build/ota-transport/index.d.ts.map +1 -1
  27. package/build/ota-transport/index.js +4 -3
  28. package/build/ota-transport/index.js.map +1 -1
  29. package/ios/Source/BluetoothSdkDefaults.swift +1 -1
  30. package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
  31. package/package.json +2 -2
  32. package/src/_private/MentraLocalNetworkModule.ts +5 -1
  33. package/src/generated/releaseMetadata.ts +5 -5
  34. package/src/ota-transport/index.ts +4 -3
  35. package/android/src/main/java/com/mentra/bluetoothsdk/ScopedNetworkReadiness.kt +0 -17
  36. package/android/src/test/java/com/mentra/bluetoothsdk/ScopedNetworkReadinessTest.kt +0 -39
@@ -0,0 +1,141 @@
1
+ package com.mentra.bluetoothsdk.hotspot
2
+
3
+ import com.mentra.bluetoothsdk.hotspot.ScopedNetworkReadiness.Verdict
4
+ import org.assertj.core.api.Assertions.assertThat
5
+ import org.junit.Test
6
+
7
+ /**
8
+ * The race these cases pin cost a misdiagnosis: ingest started on `onAvailable`, the hotspot address
9
+ * was not yet in the kernel table, and the resulting candidate-less answer was blamed on socket
10
+ * binding. Readiness now has to agree from three sources, and the missing one has to be named.
11
+ */
12
+ class ScopedNetworkReadinessTest {
13
+
14
+ private val readiness = ScopedNetworkReadiness()
15
+
16
+ private fun joined() {
17
+ readiness.onAvailable()
18
+ readiness.onCapabilities()
19
+ readiness.onLinkProperties("wlan0", "192.168.43.79")
20
+ }
21
+
22
+ @Test
23
+ fun `a fresh gate waits for onAvailable`() {
24
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Waiting("onAvailable"))
25
+ assertThat(readiness.callbacksSatisfied()).isFalse
26
+ }
27
+
28
+ /** Android's guidance, and the reason `onAvailable` alone was not enough. */
29
+ @Test
30
+ fun `onAvailable alone is not ready`() {
31
+ readiness.onAvailable()
32
+
33
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Waiting("onCapabilitiesChanged"))
34
+ }
35
+
36
+ @Test
37
+ fun `capabilities without an address is not ready`() {
38
+ readiness.onAvailable()
39
+ readiness.onCapabilities()
40
+
41
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Waiting("an IPv4 address from onLinkPropertiesChanged"))
42
+ }
43
+
44
+ /** The whole point: the callbacks can all agree while ICE still has nothing to gather. */
45
+ @Test
46
+ fun `every callback reporting is not ready until the kernel table has the address`() {
47
+ joined()
48
+
49
+ assertThat(readiness.callbacksSatisfied()).isTrue
50
+ assertThat(readiness.verdict())
51
+ .isEqualTo(Verdict.Waiting("the kernel interface table to carry 192.168.43.79"))
52
+ }
53
+
54
+ @Test
55
+ fun `the address appearing in the table late completes readiness`() {
56
+ joined()
57
+
58
+ readiness.onInterfaceTable("wlan0")
59
+
60
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Ready("192.168.43.79", "wlan0", "wlan0"))
61
+ }
62
+
63
+ /**
64
+ * A name disagreement is reported, not blocked on: ICE gathers per address, so the address being
65
+ * in the table is what matters. Blocking here would fail calls that actually work.
66
+ */
67
+ @Test
68
+ fun `the kernel owning the address under another name is still ready`() {
69
+ joined()
70
+
71
+ readiness.onInterfaceTable("wlan1")
72
+
73
+ val verdict = readiness.verdict() as Verdict.Ready
74
+ assertThat(verdict.interfaceName).isEqualTo("wlan0")
75
+ assertThat(verdict.owner).isEqualTo("wlan1")
76
+ }
77
+
78
+ /** A later poll that no longer finds the address must un-ready the gate, not latch. */
79
+ @Test
80
+ fun `the address leaving the table takes readiness away again`() {
81
+ joined()
82
+ readiness.onInterfaceTable("wlan0")
83
+
84
+ readiness.onInterfaceTable(null)
85
+
86
+ assertThat(readiness.verdict()).isInstanceOf(Verdict.Waiting::class.java)
87
+ }
88
+
89
+ /** LinkProperties is a whole-state snapshot, so a later one without an address means gone. */
90
+ @Test
91
+ fun `a link properties update without an address clears the observation`() {
92
+ joined()
93
+ readiness.onInterfaceTable("wlan0")
94
+
95
+ readiness.onLinkProperties("wlan0", null)
96
+
97
+ assertThat(readiness.callbacksSatisfied()).isFalse
98
+ }
99
+
100
+ /** The synchronous read inside `onAvailable` is a hint; it must not erase a real callback. */
101
+ @Test
102
+ fun `seeding with no address does not clear what a callback reported`() {
103
+ readiness.onLinkProperties("wlan0", "192.168.43.79")
104
+
105
+ readiness.seedLinkProperties(null, null)
106
+
107
+ assertThat(readiness.observations.linkAddress).isEqualTo("192.168.43.79")
108
+ }
109
+
110
+ @Test
111
+ fun `seeding supplies the address when the callback has not arrived`() {
112
+ readiness.onAvailable()
113
+ readiness.seedLinkProperties("wlan0", "192.168.43.79")
114
+ readiness.onCapabilities()
115
+
116
+ assertThat(readiness.callbacksSatisfied()).isTrue
117
+ }
118
+
119
+ /** Rejoin reuses the instance, so a stale Ready from the previous call would be fatal. */
120
+ @Test
121
+ fun `reset returns the gate to waiting for onAvailable`() {
122
+ joined()
123
+ readiness.onInterfaceTable("wlan0")
124
+
125
+ readiness.reset()
126
+
127
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Waiting("onAvailable"))
128
+ }
129
+
130
+ @Test
131
+ fun `callbacks arriving out of order still resolve`() {
132
+ readiness.onCapabilities()
133
+ readiness.onLinkProperties("wlan0", "192.168.43.79")
134
+ readiness.onInterfaceTable("wlan0")
135
+ assertThat(readiness.verdict()).isEqualTo(Verdict.Waiting("onAvailable"))
136
+
137
+ readiness.onAvailable()
138
+
139
+ assertThat(readiness.verdict()).isInstanceOf(Verdict.Ready::class.java)
140
+ }
141
+ }
@@ -0,0 +1,69 @@
1
+ package com.mentra.bluetoothsdk.hotspot
2
+
3
+ import android.net.NetworkCapabilities
4
+ import org.assertj.core.api.Assertions.assertThat
5
+ import org.junit.Test
6
+
7
+ /**
8
+ * Guards the one property the whole dual-homing design rests on: the SoftAP request must not ask
9
+ * for `NET_CAPABILITY_INTERNET`. If that regresses, Android can promote the glasses hotspot to the
10
+ * default network and ACS traffic silently stops using cellular.
11
+ */
12
+ class ScopedNetworkRequestSpecTest {
13
+
14
+ @Test
15
+ fun `the softap request removes the internet capability`() {
16
+ val spec = ScopedNetworkRequestSpec.forSoftAp("MentraLive-1234", "hunter2")
17
+
18
+ assertThat(spec.removedCapabilities).contains(NetworkCapabilities.NET_CAPABILITY_INTERNET)
19
+ assertThat(spec.avoidsInternetCapability).isTrue()
20
+ }
21
+
22
+ @Test
23
+ fun `the softap request is wifi only`() {
24
+ val spec = ScopedNetworkRequestSpec.forSoftAp("MentraLive-1234", "hunter2")
25
+
26
+ assertThat(spec.transportTypes).containsExactly(NetworkCapabilities.TRANSPORT_WIFI)
27
+ }
28
+
29
+ @Test
30
+ fun `ssid and passphrase are carried through`() {
31
+ val spec = ScopedNetworkRequestSpec.forSoftAp("MentraLive-1234", "hunter2")
32
+
33
+ assertThat(spec.ssid).isEqualTo("MentraLive-1234")
34
+ assertThat(spec.passphrase).isEqualTo("hunter2")
35
+ assertThat(spec.hasPassphrase).isTrue()
36
+ }
37
+
38
+ @Test
39
+ fun `an open network reports no passphrase`() {
40
+ assertThat(ScopedNetworkRequestSpec.forSoftAp("Open-AP", "").hasPassphrase).isFalse()
41
+ }
42
+
43
+ @Test
44
+ fun `the default timeout matches the bluetooth sdk hotspot join`() {
45
+ assertThat(ScopedNetworkRequestSpec.forSoftAp("x", "y").timeoutMs).isEqualTo(30_000)
46
+ assertThat(ScopedNetworkRequestSpec.DEFAULT_TIMEOUT_MS).isEqualTo(30_000)
47
+ }
48
+
49
+ @Test
50
+ fun `the timeout is overridable`() {
51
+ assertThat(ScopedNetworkRequestSpec.forSoftAp("x", "y", timeoutMs = 5_000).timeoutMs)
52
+ .isEqualTo(5_000)
53
+ }
54
+
55
+ /** A spec that kept the internet capability must not read as safe. */
56
+ @Test
57
+ fun `avoidsInternetCapability is false when the capability is not removed`() {
58
+ val unsafe =
59
+ ScopedNetworkRequestSpec(
60
+ ssid = "x",
61
+ passphrase = "y",
62
+ transportTypes = setOf(NetworkCapabilities.TRANSPORT_WIFI),
63
+ removedCapabilities = emptySet(),
64
+ timeoutMs = 1_000,
65
+ )
66
+
67
+ assertThat(unsafe.avoidsInternetCapability).isFalse()
68
+ }
69
+ }
@@ -0,0 +1,97 @@
1
+ package com.mentra.bluetoothsdk.hotspot
2
+
3
+ import org.assertj.core.api.Assertions.assertThat
4
+ import org.junit.Test
5
+
6
+ /**
7
+ * Covers the pure formatter. The `Log.i` wrapper is a one-liner and is exercised on device.
8
+ */
9
+ class SoftApTraceTest {
10
+
11
+ @Test
12
+ fun `format carries the grep marker`() {
13
+ assertThat(SoftApTrace.format("t1", "scoped_network_available", 12))
14
+ .contains("SOFTAP_TRACE")
15
+ }
16
+
17
+ @Test
18
+ fun `format includes traceId stage and elapsed`() {
19
+ assertThat(SoftApTrace.format("abc123", "ice_selected_pair", 450))
20
+ .isEqualTo("[SOFTAP_TRACE] traceId=abc123 stage=ice_selected_pair elapsedMs=450")
21
+ }
22
+
23
+ @Test
24
+ fun `format omits traceId when absent`() {
25
+ assertThat(SoftApTrace.format("", "boot", 0))
26
+ .isEqualTo("[SOFTAP_TRACE] stage=boot elapsedMs=0")
27
+ }
28
+
29
+ @Test
30
+ fun `format appends fields in order`() {
31
+ assertThat(SoftApTrace.format("t", "whip_request", 7, "method" to "POST", "status" to 201))
32
+ .endsWith("method=POST status=201")
33
+ }
34
+
35
+ @Test
36
+ fun `sanitize redacts the hotspot password`() {
37
+ assertThat(SoftApTrace.sanitize("password", "hunter2")).isEqualTo("<redacted>")
38
+ assertThat(SoftApTrace.sanitize("hotspotPassword", "hunter2")).isEqualTo("<redacted>")
39
+ assertThat(SoftApTrace.sanitize("psk", "hunter2")).isEqualTo("<redacted>")
40
+ assertThat(SoftApTrace.sanitize("passphrase", "hunter2")).isEqualTo("<redacted>")
41
+ }
42
+
43
+ @Test
44
+ fun `sanitize redacts tokens and credentials`() {
45
+ assertThat(SoftApTrace.sanitize("token", "eyJhbGciOi")).isEqualTo("<redacted>")
46
+ assertThat(SoftApTrace.sanitize("acsToken", "eyJhbGciOi")).isEqualTo("<redacted>")
47
+ assertThat(SoftApTrace.sanitize("Authorization", "Bearer x")).isEqualTo("<redacted>")
48
+ assertThat(SoftApTrace.sanitize("meetingUrl", "https://teams.microsoft.com/l/x"))
49
+ .isEqualTo("<redacted>")
50
+ }
51
+
52
+ @Test
53
+ fun `format never leaks a secret value into the line`() {
54
+ val line = SoftApTrace.format(
55
+ "t", "hotspot_started", 5,
56
+ "ssid" to "MentraLive", "password" to "hunter2",
57
+ )
58
+ assertThat(line).doesNotContain("hunter2")
59
+ assertThat(line).contains("ssid=MentraLive")
60
+ assertThat(line).contains("password=<redacted>")
61
+ }
62
+
63
+ @Test
64
+ fun `sanitize keeps the local whip url which is diagnostic`() {
65
+ assertThat(SoftApTrace.sanitize("whipUrl", "http://192.168.43.20:8790/whip/abc"))
66
+ .isEqualTo("http://192.168.43.20:8790/whip/abc")
67
+ }
68
+
69
+ @Test
70
+ fun `sanitize strips query strings that may carry tokens`() {
71
+ assertThat(SoftApTrace.sanitize("playbackUrl", "https://example.com/live?token=secret123"))
72
+ .isEqualTo("https://example.com/live?<redacted>")
73
+ }
74
+
75
+ @Test
76
+ fun `sanitize strips userinfo from urls`() {
77
+ val result = SoftApTrace.sanitize("endpoint", "https://user:pw@example.com/x")
78
+ assertThat(result).doesNotContain("pw@")
79
+ assertThat(result).contains("<redacted>@example.com/x")
80
+ }
81
+
82
+ @Test
83
+ fun `sanitize quotes values containing spaces`() {
84
+ assertThat(SoftApTrace.sanitize("reason", "two words")).isEqualTo("\"two words\"")
85
+ }
86
+
87
+ @Test
88
+ fun `sanitize renders null and empty`() {
89
+ assertThat(SoftApTrace.sanitize("reason", null)).isEqualTo("null")
90
+ assertThat(SoftApTrace.sanitize("reason", "")).isEqualTo("\"\"")
91
+ }
92
+
93
+ @Test
94
+ fun `newTraceId produces distinct ids`() {
95
+ assertThat(SoftApTrace.newTraceId()).isNotEqualTo(SoftApTrace.newTraceId())
96
+ }
97
+ }
@@ -0,0 +1,47 @@
1
+ package com.mentra.bluetoothsdk.hotspot
2
+
3
+ import org.assertj.core.api.Assertions.assertThat
4
+ import org.assertj.core.api.Assertions.assertThatThrownBy
5
+ import org.junit.Test
6
+
7
+ class UnavailableRetryTest {
8
+
9
+ @Test
10
+ fun `asks once more after an Unavailable`() {
11
+ var requests = 0
12
+ val result = ScopedSoftApNetwork.retryUnavailableOnce(
13
+ request = { if (++requests == 1) throw ScopedNetworkError.Unavailable("glasses") else "joined" },
14
+ settle = {},
15
+ released = { false },
16
+ )
17
+ assertThat(result).isEqualTo("joined")
18
+ assertThat(requests).isEqualTo(2)
19
+ }
20
+
21
+ @Test
22
+ fun `a release during the settle stops the second request`() {
23
+ var requests = 0
24
+ var released = false
25
+ assertThatThrownBy {
26
+ ScopedSoftApNetwork.retryUnavailableOnce(
27
+ request = { requests++; throw ScopedNetworkError.Unavailable("glasses") },
28
+ settle = { released = true },
29
+ released = { released },
30
+ )
31
+ }.isInstanceOf(ScopedNetworkError.Unavailable::class.java)
32
+ assertThat(requests).isEqualTo(1)
33
+ }
34
+
35
+ @Test
36
+ fun `a release before the settle skips it`() {
37
+ var settled = false
38
+ assertThatThrownBy {
39
+ ScopedSoftApNetwork.retryUnavailableOnce<String>(
40
+ request = { throw ScopedNetworkError.Unavailable("glasses") },
41
+ settle = { settled = true },
42
+ released = { true },
43
+ )
44
+ }.isInstanceOf(ScopedNetworkError.Unavailable::class.java)
45
+ assertThat(settled).isFalse()
46
+ }
47
+ }
@@ -46,7 +46,7 @@ type LocalNetworkEvents = {
46
46
  };
47
47
  declare class MentraLocalNetworkNativeModule extends NativeModule<LocalNetworkEvents> {
48
48
  getNetworkDiagnostics(): NetworkDiagnostics;
49
- connect(ssid: string, password: string): Promise<{
49
+ connect(ssid: string, password: string, incoming: boolean): Promise<{
50
50
  connected: boolean;
51
51
  ssid: string;
52
52
  localAddress?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"MentraLocalNetworkModule.d.ts","sourceRoot":"","sources":["../../src/_private/MentraLocalNetworkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAA8B,MAAM,MAAM,CAAA;AAE9D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,GAAG,EAAE,OAAO,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAA;IAEhB,YAAY,EAAE,6BAA6B,GAAG,IAAI,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,kBAAkB,CAAA;IAEhC,aAAa,EAAE,kBAAkB,CAAA;IACjC,YAAY,EAAE,kBAAkB,CAAA;IAChC,yBAAyB,EAAE,OAAO,CAAA;IAClC,+BAA+B,EAAE,OAAO,CAAA;IACxC,gCAAgC,EAAE,OAAO,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IAC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AE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IACxC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAC5B;;AAED,wBAAgG"}
@@ -1 +1 @@
1
- {"version":3,"file":"MentraLocalNetworkModule.js","sourceRoot":"","sources":["../../src/_private/MentraLocalNetworkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,2BAA2B,EAAC,MAAM,MAAM,CAAA;AA6E9D,eAAe,2BAA2B,CAAiC,oBAAoB,CAAC,CAAA","sourcesContent":["import {NativeModule, requireOptionalNativeModule} from \"expo\"\n\nexport type NetworkCapabilitiesDiagnostic = {\n wifi: boolean\n cellular: boolean\n ethernet: boolean\n vpn: boolean\n internet: boolean\n validated: boolean\n captivePortal: boolean\n}\n\nexport type NetworkObservation = {\n present: boolean\n // A present network with null capabilities has disappeared or cannot be inspected.\n capabilities: NetworkCapabilitiesDiagnostic | null\n}\n\nexport type NetworkDiagnostics = {\n sampledAtMs: number\n processBound: NetworkObservation\n // ConnectivityManager.activeNetwork is the caller's active default, not a privileged global read.\n activeNetwork: NetworkObservation\n glassesLocal: NetworkObservation\n processBoundMatchesActive: boolean\n processBoundMatchesGlassesLocal: boolean\n activeNetworkMatchesGlassesLocal: boolean\n}\n\nexport type LocalNetworkResponse = {\n status: number\n headers: Record<string, string>\n bodyBase64: string\n}\n\nexport type LocalNetworkDownloadResult = {\n statusCode: number\n bytesWritten: number\n headers: Record<string, string>\n}\n\nexport type LocalNetworkDownloadProgress = {\n requestId: string\n bytesWritten: number\n contentLength: number\n statusCode?: number\n headers?: Record<string, string>\n}\n\ntype LocalNetworkEvents = {\n downloadProgress: (event: LocalNetworkDownloadProgress) => void\n networkLost: (event: {ssid: string}) => void\n}\n\ndeclare class MentraLocalNetworkNativeModule extends NativeModule<LocalNetworkEvents> {\n getNetworkDiagnostics(): NetworkDiagnostics\n connect(ssid: string, password: string): Promise<{connected: boolean; ssid: string; localAddress?: string}>\n request(\n requestId: string,\n url: string,\n method: string,\n headers: Record<string, string>,\n body: string | null,\n timeoutMs: number,\n ): Promise<LocalNetworkResponse>\n download(\n requestId: string,\n url: string,\n destination: string,\n headers: Record<string, string>,\n connectionTimeoutMs: number,\n readTimeoutMs: number,\n ): Promise<LocalNetworkDownloadResult>\n cancel(requestId: string): Promise<void>\n disconnect(): Promise<void>\n}\n\nexport default requireOptionalNativeModule<MentraLocalNetworkNativeModule>(\"MentraLocalNetwork\")\n"]}
1
+ {"version":3,"file":"MentraLocalNetworkModule.js","sourceRoot":"","sources":["../../src/_private/MentraLocalNetworkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,2BAA2B,EAAC,MAAM,MAAM,CAAA;AAiF9D,eAAe,2BAA2B,CAAiC,oBAAoB,CAAC,CAAA","sourcesContent":["import {NativeModule, requireOptionalNativeModule} from \"expo\"\n\nexport type NetworkCapabilitiesDiagnostic = {\n wifi: boolean\n cellular: boolean\n ethernet: boolean\n vpn: boolean\n internet: boolean\n validated: boolean\n captivePortal: boolean\n}\n\nexport type NetworkObservation = {\n present: boolean\n // A present network with null capabilities has disappeared or cannot be inspected.\n capabilities: NetworkCapabilitiesDiagnostic | null\n}\n\nexport type NetworkDiagnostics = {\n sampledAtMs: number\n processBound: NetworkObservation\n // ConnectivityManager.activeNetwork is the caller's active default, not a privileged global read.\n activeNetwork: NetworkObservation\n glassesLocal: NetworkObservation\n processBoundMatchesActive: boolean\n processBoundMatchesGlassesLocal: boolean\n activeNetworkMatchesGlassesLocal: boolean\n}\n\nexport type LocalNetworkResponse = {\n status: number\n headers: Record<string, string>\n bodyBase64: string\n}\n\nexport type LocalNetworkDownloadResult = {\n statusCode: number\n bytesWritten: number\n headers: Record<string, string>\n}\n\nexport type LocalNetworkDownloadProgress = {\n requestId: string\n bytesWritten: number\n contentLength: number\n statusCode?: number\n headers?: Record<string, string>\n}\n\ntype LocalNetworkEvents = {\n downloadProgress: (event: LocalNetworkDownloadProgress) => void\n networkLost: (event: {ssid: string}) => void\n}\n\ndeclare class MentraLocalNetworkNativeModule extends NativeModule<LocalNetworkEvents> {\n getNetworkDiagnostics(): NetworkDiagnostics\n connect(\n ssid: string,\n password: string,\n incoming: boolean,\n ): Promise<{connected: boolean; ssid: string; localAddress?: string}>\n request(\n requestId: string,\n url: string,\n method: string,\n headers: Record<string, string>,\n body: string | null,\n timeoutMs: number,\n ): Promise<LocalNetworkResponse>\n download(\n requestId: string,\n url: string,\n destination: string,\n headers: Record<string, string>,\n connectionTimeoutMs: number,\n readTimeoutMs: number,\n ): Promise<LocalNetworkDownloadResult>\n cancel(requestId: string): Promise<void>\n disconnect(): Promise<void>\n}\n\nexport default requireOptionalNativeModule<MentraLocalNetworkNativeModule>(\"MentraLocalNetwork\")\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.1274",
5
- "releaseSetId": "mentra-3.5.0-dev.1274",
6
- "sourceCommit": "e66ef4b09f74fdc206bdba333babe53c2973e723",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1274.json",
8
- "otaManifestSha256": "21f4450ee60a8051909291a28cf5e8095f8e2b5188944bf61df707ab49e9baf1"
4
+ "releaseIdentity": "3.5.0-dev.1276",
5
+ "releaseSetId": "mentra-3.5.0-dev.1276",
6
+ "sourceCommit": "2951837f72b37f35559f0ffa29eeb1d8c7ccedf4",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1276.json",
8
+ "otaManifestSha256": "ffa521f8e633cd79e50d1df7466c4268ab2ea1f34428f293092395f85fecf5d0"
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.1274\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1274\",\n \"sourceCommit\": \"e66ef4b09f74fdc206bdba333babe53c2973e723\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1274.json\",\n \"otaManifestSha256\": \"21f4450ee60a8051909291a28cf5e8095f8e2b5188944bf61df707ab49e9baf1\"\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.1276\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1276\",\n \"sourceCommit\": \"2951837f72b37f35559f0ffa29eeb1d8c7ccedf4\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1276.json\",\n \"otaManifestSha256\": \"ffa521f8e633cd79e50d1df7466c4268ab2ea1f34428f293092395f85fecf5d0\"\n})\n"]}
@@ -43,13 +43,14 @@ export type OtaServerResult = {
43
43
  * Scoped networking for traffic that must stay on a Mentra Live hotspot while
44
44
  * the phone's default route remains on cellular or another Wi-Fi network.
45
45
  *
46
- * The module is optional because iOS uses its system Wi-Fi join flow instead.
46
+ * The module is optional because iOS joins through glasses-media's hotspot owner instead.
47
47
  */
48
48
  export declare const otaLocalNetwork: Readonly<{
49
49
  isAvailable: () => boolean;
50
50
  /** Synchronous local observation; no network I/O, route changes or network identities. */
51
51
  getNetworkDiagnostics: () => NetworkDiagnostics | null;
52
- connect: (ssid: string, password: string) => Promise<OtaLocalNetworkConnection>;
52
+ /** `incoming`: the glasses will connect to a server on this phone (OTA), not only the reverse. */
53
+ connect: (ssid: string, password: string, incoming?: boolean) => Promise<OtaLocalNetworkConnection>;
53
54
  request: (requestId: string, url: string, method: string, headers: Record<string, string>, body: string | null, timeoutMs: number) => Promise<OtaLocalNetworkResponse>;
54
55
  download: (requestId: string, url: string, destination: string, headers: Record<string, string>, connectionTimeoutMs: number, readTimeoutMs: number) => Promise<OtaLocalNetworkDownloadResult>;
55
56
  cancel: (requestId: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ota-transport/index.ts"],"names":[],"mappings":"AAEA,OAA2B,EAAC,KAAK,kBAAkB,EAAC,MAAM,sCAAsC,CAAA;AAKhG,YAAY,EACV,6BAA6B,EAC7B,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sCAAsC,CAAA;AAE7C,MAAM,MAAM,wBAAwB,GAAG;IAAC,MAAM,IAAI,IAAI,CAAA;CAAC,CAAA;AAEvD,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAA;AAErD,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,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
@@ -7,16 +7,17 @@ import MentraOtaServer from "../ota-server";
7
7
  * Scoped networking for traffic that must stay on a Mentra Live hotspot while
8
8
  * the phone's default route remains on cellular or another Wi-Fi network.
9
9
  *
10
- * The module is optional because iOS uses its system Wi-Fi join flow instead.
10
+ * The module is optional because iOS joins through glasses-media's hotspot owner instead.
11
11
  */
12
12
  export const otaLocalNetwork = Object.freeze({
13
13
  isAvailable: () => MentraLocalNetwork != null,
14
14
  /** Synchronous local observation; no network I/O, route changes or network identities. */
15
15
  getNetworkDiagnostics: () => MentraLocalNetwork?.getNetworkDiagnostics() ?? null,
16
- connect: async (ssid, password) => {
16
+ /** `incoming`: the glasses will connect to a server on this phone (OTA), not only the reverse. */
17
+ connect: async (ssid, password, incoming = true) => {
17
18
  if (!MentraLocalNetwork)
18
19
  throw new Error("Scoped local networking is not available in this native build");
19
- return MentraLocalNetwork.connect(ssid, password);
20
+ return MentraLocalNetwork.connect(ssid, password, incoming);
20
21
  },
21
22
  request: async (requestId, url, method, headers, body, timeoutMs) => {
22
23
  if (!MentraLocalNetwork)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ota-transport/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,iDAAiD;AACjD,OAAO,kBAA6C,MAAM,sCAAsC,CAAA;AAChG,iDAAiD;AACjD,OAAO,eAAe,MAAM,eAAe,CAAA;AAoD3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,IAAI,IAAI;IACtD,0FAA0F;IAC1F,qBAAqB,EAAE,GAA8B,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,IAAI,IAAI;IAC3G,OAAO,EAAE,KAAK,EAAE,IAAY,EAAE,QAAgB,EAAsC,EAAE;QACpF,IAAI,CAAC,kBAAkB;YAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAA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IACD,aAAa,EAAE,CAAC,QAAmD,EAA4B,EAAE;QAC/F,IAAI,CAAC,kBAAkB;YAAE,OAAO,EAAC,MAAM,KAAI,CAAC,EAAC,CAAA;QAC7C,OAAO,kBAAkB,CAAC,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAChE,CAAC;CACF,CAAC,CAAA;AAEF,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CACL,YAAoB,EACpB,aAAqC,EACrC,IAAoB,EACM,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC;IAChG,IAAI,EAAE,GAAkB,EAAE,CAAC,eAAe,CAAC,aAAa,EAAE;IAC1D,gBAAgB,EAAE,CAAC,MAAc,EAAE,WAAmB,EAAuD,EAAE,CAC7G,eAAe,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC;IACvD,0BAA0B,EAAE,CAAC,QAAsD,EAA4B,EAAE,CAC/G,eAAe,CAAC,WAAW,CAAC,0BAA0B,EAAE,QAAQ,CAAC;CACpE,CAAC,CAAA","sourcesContent":["// This public adapter is the package-owned boundary over its native implementation.\n// eslint-disable-next-line no-restricted-imports\nimport MentraLocalNetwork, {type NetworkDiagnostics} from \"../_private/MentraLocalNetworkModule\"\n// eslint-disable-next-line no-restricted-imports\nimport MentraOtaServer from \"../ota-server\"\n\n// eslint-disable-next-line no-restricted-imports\nexport type {\n NetworkCapabilitiesDiagnostic,\n NetworkDiagnostics,\n NetworkObservation,\n} from \"../_private/MentraLocalNetworkModule\"\n\nexport type OtaTransportSubscription = {remove(): void}\n\nexport type OtaLocalNetworkConnection = {\n connected: boolean\n ssid: string\n localAddress?: string\n}\n\nexport type OtaLocalNetworkLostEvent = {ssid: string}\n\nexport type OtaLocalNetworkResponse = {\n status: number\n headers: Record<string, string>\n bodyBase64: string\n}\n\nexport type OtaLocalNetworkDownloadResult = {\n statusCode: number\n bytesWritten: number\n headers: Record<string, string>\n}\n\nexport type OtaLocalNetworkDownloadProgress = {\n requestId: string\n bytesWritten: number\n contentLength: number\n statusCode?: number\n headers?: Record<string, string>\n}\n\nexport type OtaArtifactDownloadProgress = {\n destination: string\n bytesWritten: number\n contentLength: number\n}\n\nexport type OtaServerResult = {\n baseUrl: string\n host: string\n manifestUrl: string\n port: number\n}\n\n/**\n * Scoped networking for traffic that must stay on a Mentra Live hotspot while\n * the phone's default route remains on cellular or another Wi-Fi network.\n *\n * The module is optional because iOS uses its system Wi-Fi join flow instead.\n */\nexport const otaLocalNetwork = Object.freeze({\n isAvailable: (): boolean => MentraLocalNetwork != null,\n /** Synchronous local observation; no network I/O, route changes or network identities. */\n getNetworkDiagnostics: (): NetworkDiagnostics | null => MentraLocalNetwork?.getNetworkDiagnostics() ?? null,\n connect: async (ssid: string, password: string): Promise<OtaLocalNetworkConnection> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.connect(ssid, password)\n },\n request: async (\n requestId: string,\n url: string,\n method: string,\n headers: Record<string, string>,\n body: string | null,\n timeoutMs: number,\n ): Promise<OtaLocalNetworkResponse> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.request(requestId, url, method, headers, body, timeoutMs)\n },\n download: async (\n requestId: string,\n url: string,\n destination: string,\n headers: Record<string, string>,\n connectionTimeoutMs: number,\n readTimeoutMs: number,\n ): Promise<OtaLocalNetworkDownloadResult> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.download(requestId, url, destination, headers, connectionTimeoutMs, readTimeoutMs)\n },\n cancel: async (requestId: string): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.cancel(requestId)\n },\n disconnect: async (): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.disconnect()\n },\n onDownloadProgress: (listener: (event: OtaLocalNetworkDownloadProgress) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"downloadProgress\", listener)\n },\n onNetworkLost: (listener: (event: OtaLocalNetworkLostEvent) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"networkLost\", listener)\n },\n})\n\n/** Native HTTP server and artifact downloader used by the Engine OTA coordinator. */\nexport const otaServer = Object.freeze({\n start: (\n manifestJson: string,\n artifactPaths: Record<string, string>,\n host?: string | null,\n ): Promise<OtaServerResult> => MentraOtaServer.startOtaServer(manifestJson, artifactPaths, host),\n stop: (): Promise<void> => MentraOtaServer.stopOtaServer(),\n downloadArtifact: (source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}> =>\n MentraOtaServer.downloadArtifact(source, destination),\n onArtifactDownloadProgress: (listener: (event: OtaArtifactDownloadProgress) => void): OtaTransportSubscription =>\n MentraOtaServer.addListener(\"artifactDownloadProgress\", listener),\n})\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ota-transport/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,iDAAiD;AACjD,OAAO,kBAA6C,MAAM,sCAAsC,CAAA;AAChG,iDAAiD;AACjD,OAAO,eAAe,MAAM,eAAe,CAAA;AAoD3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,IAAI,IAAI;IACtD,0FAA0F;IAC1F,qBAAqB,EAAE,GAA8B,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,IAAI,IAAI;IAC3G,kGAAkG;IAClG,OAAO,EAAE,KAAK,EAAE,IAAY,EAAE,QAAgB,EAAE,QAAQ,GAAG,IAAI,EAAsC,EAAE;QACrG,IAAI,CAAC,kBAAkB;YAAE,MAAM,IAAI,KAAK,CAAC,+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,CAAC,CAAA;IACrE,CAAC;IACD,aAAa,EAAE,CAAC,QAAmD,EAA4B,EAAE;QAC/F,IAAI,CAAC,kBAAkB;YAAE,OAAO,EAAC,MAAM,KAAI,CAAC,EAAC,CAAA;QAC7C,OAAO,kBAAkB,CAAC,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAChE,CAAC;CACF,CAAC,CAAA;AAEF,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CACL,YAAoB,EACpB,aAAqC,EACrC,IAAoB,EACM,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC;IAChG,IAAI,EAAE,GAAkB,EAAE,CAAC,eAAe,CAAC,aAAa,EAAE;IAC1D,gBAAgB,EAAE,CAAC,MAAc,EAAE,WAAmB,EAAuD,EAAE,CAC7G,eAAe,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC;IACvD,0BAA0B,EAAE,CAAC,QAAsD,EAA4B,EAAE,CAC/G,eAAe,CAAC,WAAW,CAAC,0BAA0B,EAAE,QAAQ,CAAC;CACpE,CAAC,CAAA","sourcesContent":["// This public adapter is the package-owned boundary over its native implementation.\n// eslint-disable-next-line no-restricted-imports\nimport MentraLocalNetwork, {type NetworkDiagnostics} from \"../_private/MentraLocalNetworkModule\"\n// eslint-disable-next-line no-restricted-imports\nimport MentraOtaServer from \"../ota-server\"\n\n// eslint-disable-next-line no-restricted-imports\nexport type {\n NetworkCapabilitiesDiagnostic,\n NetworkDiagnostics,\n NetworkObservation,\n} from \"../_private/MentraLocalNetworkModule\"\n\nexport type OtaTransportSubscription = {remove(): void}\n\nexport type OtaLocalNetworkConnection = {\n connected: boolean\n ssid: string\n localAddress?: string\n}\n\nexport type OtaLocalNetworkLostEvent = {ssid: string}\n\nexport type OtaLocalNetworkResponse = {\n status: number\n headers: Record<string, string>\n bodyBase64: string\n}\n\nexport type OtaLocalNetworkDownloadResult = {\n statusCode: number\n bytesWritten: number\n headers: Record<string, string>\n}\n\nexport type OtaLocalNetworkDownloadProgress = {\n requestId: string\n bytesWritten: number\n contentLength: number\n statusCode?: number\n headers?: Record<string, string>\n}\n\nexport type OtaArtifactDownloadProgress = {\n destination: string\n bytesWritten: number\n contentLength: number\n}\n\nexport type OtaServerResult = {\n baseUrl: string\n host: string\n manifestUrl: string\n port: number\n}\n\n/**\n * Scoped networking for traffic that must stay on a Mentra Live hotspot while\n * the phone's default route remains on cellular or another Wi-Fi network.\n *\n * The module is optional because iOS joins through glasses-media's hotspot owner instead.\n */\nexport const otaLocalNetwork = Object.freeze({\n isAvailable: (): boolean => MentraLocalNetwork != null,\n /** Synchronous local observation; no network I/O, route changes or network identities. */\n getNetworkDiagnostics: (): NetworkDiagnostics | null => MentraLocalNetwork?.getNetworkDiagnostics() ?? null,\n /** `incoming`: the glasses will connect to a server on this phone (OTA), not only the reverse. */\n connect: async (ssid: string, password: string, incoming = true): Promise<OtaLocalNetworkConnection> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.connect(ssid, password, incoming)\n },\n request: async (\n requestId: string,\n url: string,\n method: string,\n headers: Record<string, string>,\n body: string | null,\n timeoutMs: number,\n ): Promise<OtaLocalNetworkResponse> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.request(requestId, url, method, headers, body, timeoutMs)\n },\n download: async (\n requestId: string,\n url: string,\n destination: string,\n headers: Record<string, string>,\n connectionTimeoutMs: number,\n readTimeoutMs: number,\n ): Promise<OtaLocalNetworkDownloadResult> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.download(requestId, url, destination, headers, connectionTimeoutMs, readTimeoutMs)\n },\n cancel: async (requestId: string): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.cancel(requestId)\n },\n disconnect: async (): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.disconnect()\n },\n onDownloadProgress: (listener: (event: OtaLocalNetworkDownloadProgress) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"downloadProgress\", listener)\n },\n onNetworkLost: (listener: (event: OtaLocalNetworkLostEvent) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"networkLost\", listener)\n },\n})\n\n/** Native HTTP server and artifact downloader used by the Engine OTA coordinator. */\nexport const otaServer = Object.freeze({\n start: (\n manifestJson: string,\n artifactPaths: Record<string, string>,\n host?: string | null,\n ): Promise<OtaServerResult> => MentraOtaServer.startOtaServer(manifestJson, artifactPaths, host),\n stop: (): Promise<void> => MentraOtaServer.stopOtaServer(),\n downloadArtifact: (source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}> =>\n MentraOtaServer.downloadArtifact(source, destination),\n onArtifactDownloadProgress: (listener: (event: OtaArtifactDownloadProgress) => void): OtaTransportSubscription =>\n MentraOtaServer.addListener(\"artifactDownloadProgress\", listener),\n})\n"]}
@@ -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.1274"
19
+ private static let swiftPackageSdkVersion = "3.5.0-dev.1276"
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.1274"
7
- static let releaseSetId = "mentra-3.5.0-dev.1274"
8
- static let sourceCommit = "e66ef4b09f74fdc206bdba333babe53c2973e723"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1274.json"
10
- static let otaManifestSha256 = "21f4450ee60a8051909291a28cf5e8095f8e2b5188944bf61df707ab49e9baf1"
6
+ static let releaseIdentity = "3.5.0-dev.1276"
7
+ static let releaseSetId = "mentra-3.5.0-dev.1276"
8
+ static let sourceCommit = "2951837f72b37f35559f0ffa29eeb1d8c7ccedf4"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1276.json"
10
+ static let otaManifestSha256 = "ffa521f8e633cd79e50d1df7466c4268ab2ea1f34428f293092395f85fecf5d0"
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.5.0-dev.1274",
3
+ "version": "3.5.0-dev.1276",
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.1274"
118
+ "@mentra/cloud-protocol": "3.5.0-dev.1276"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -54,7 +54,11 @@ type LocalNetworkEvents = {
54
54
 
55
55
  declare class MentraLocalNetworkNativeModule extends NativeModule<LocalNetworkEvents> {
56
56
  getNetworkDiagnostics(): NetworkDiagnostics
57
- connect(ssid: string, password: string): Promise<{connected: boolean; ssid: string; localAddress?: string}>
57
+ connect(
58
+ ssid: string,
59
+ password: string,
60
+ incoming: boolean,
61
+ ): Promise<{connected: boolean; ssid: string; localAddress?: string}>
58
62
  request(
59
63
  requestId: string,
60
64
  url: string,
@@ -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.1274",
16
- "releaseSetId": "mentra-3.5.0-dev.1274",
17
- "sourceCommit": "e66ef4b09f74fdc206bdba333babe53c2973e723",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1274.json",
19
- "otaManifestSha256": "21f4450ee60a8051909291a28cf5e8095f8e2b5188944bf61df707ab49e9baf1"
15
+ "releaseIdentity": "3.5.0-dev.1276",
16
+ "releaseSetId": "mentra-3.5.0-dev.1276",
17
+ "sourceCommit": "2951837f72b37f35559f0ffa29eeb1d8c7ccedf4",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1276.json",
19
+ "otaManifestSha256": "ffa521f8e633cd79e50d1df7466c4268ab2ea1f34428f293092395f85fecf5d0"
20
20
  })
@@ -58,15 +58,16 @@ export type OtaServerResult = {
58
58
  * Scoped networking for traffic that must stay on a Mentra Live hotspot while
59
59
  * the phone's default route remains on cellular or another Wi-Fi network.
60
60
  *
61
- * The module is optional because iOS uses its system Wi-Fi join flow instead.
61
+ * The module is optional because iOS joins through glasses-media's hotspot owner instead.
62
62
  */
63
63
  export const otaLocalNetwork = Object.freeze({
64
64
  isAvailable: (): boolean => MentraLocalNetwork != null,
65
65
  /** Synchronous local observation; no network I/O, route changes or network identities. */
66
66
  getNetworkDiagnostics: (): NetworkDiagnostics | null => MentraLocalNetwork?.getNetworkDiagnostics() ?? null,
67
- connect: async (ssid: string, password: string): Promise<OtaLocalNetworkConnection> => {
67
+ /** `incoming`: the glasses will connect to a server on this phone (OTA), not only the reverse. */
68
+ connect: async (ssid: string, password: string, incoming = true): Promise<OtaLocalNetworkConnection> => {
68
69
  if (!MentraLocalNetwork) throw new Error("Scoped local networking is not available in this native build")
69
- return MentraLocalNetwork.connect(ssid, password)
70
+ return MentraLocalNetwork.connect(ssid, password, incoming)
70
71
  },
71
72
  request: async (
72
73
  requestId: string,
@@ -1,17 +0,0 @@
1
- package com.mentra.bluetoothsdk
2
-
3
- internal class ScopedNetworkReadiness<T> {
4
- private var candidate: T? = null
5
-
6
- fun onAvailable(network: T) {
7
- candidate = network
8
- }
9
-
10
- fun isReady(network: T, isForeground: Boolean): Boolean = candidate == network && isForeground
11
-
12
- fun contains(network: T): Boolean = candidate == network
13
-
14
- fun clear() {
15
- candidate = null
16
- }
17
- }