@mentra/bluetooth-sdk 3.5.0-dev.1503 → 3.5.0-dev.1505

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.
@@ -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.1503"
7
- static let releaseSetId = "mentra-3.5.0-dev.1503"
8
- static let sourceCommit = "a4f32ad528757b20a19b001039a6790f2c055961"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1503.json"
10
- static let otaManifestSha256 = "a89a829632d8ebd9f211989ff9332d619031ccc1dcfc36738012b9105f691d86"
6
+ static let releaseIdentity = "3.5.0-dev.1505"
7
+ static let releaseSetId = "mentra-3.5.0-dev.1505"
8
+ static let sourceCommit = "01d8beea33cfb777a24014e8855bba6504e04a7a"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1505.json"
10
+ static let otaManifestSha256 = "bf1279d0c7fd5e4939f19581580334d090b5dea5c226506b60fd977c8178ea99"
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.5.0-dev.1503",
3
+ "version": "3.5.0-dev.1505",
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.1503"
118
+ "@mentra/cloud-protocol": "3.5.0-dev.1505"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -237,6 +237,34 @@ export type HotspotStatusChangeEvent = HotspotStatus & {
237
237
  type: "hotspot_status_change"
238
238
  }
239
239
 
240
+ /**
241
+ * The fast photo link: Wi-Fi Direct between an Android phone and Mentra Live. While it is
242
+ * `open`, photos travel over it; otherwise over Bluetooth. `unavailable` carries a `reason`,
243
+ * such as `glasses_unsupported`, `permission` (NEARBY_WIFI_DEVICES, or location before Android 13), `wifi_off`,
244
+ * `glasses_not_connected`, `join_timeout` or a `glasses_...` error.
245
+ */
246
+ export type FastLinkState = "closed" | "opening" | "open" | "unavailable"
247
+
248
+ export type FastLinkStatus = {
249
+ state: FastLinkState
250
+ link: "wifi_direct"
251
+ /**
252
+ * Whether the connected glasses can hold a Wi-Fi Direct group (they advertise
253
+ * `wifi_direct_version`). Without it, use the glasses hotspot.
254
+ */
255
+ glassesSupported: boolean
256
+ reason?: string
257
+ /** How long the link took to open, from the request. */
258
+ openedAfterMs?: number
259
+ }
260
+
261
+ export type FastLinkStatusEvent = FastLinkStatus & {
262
+ type: "fast_link_status"
263
+ }
264
+
265
+ /** How a photo reached the phone. */
266
+ export type PhotoTransport = "ble" | "wifi_direct" | "hotspot"
267
+
240
268
  export type HotspotErrorEvent = {
241
269
  type: "hotspot_error"
242
270
  errorMessage: string
@@ -297,6 +325,12 @@ export type PhotoResponseEvent =
297
325
  contentType?: string
298
326
  fileSizeBytes?: number
299
327
  timestamp: number
328
+ /** How the photo reached the phone (Android `localFile` requests). */
329
+ transport?: PhotoTransport
330
+ /** Its last hop: the fetch over a fast link, or the Bluetooth packets. */
331
+ transferMs?: number
332
+ /** From the phone's request to the saved file. */
333
+ totalMs?: number
300
334
  }
301
335
  | {
302
336
  type: "photo_response"
@@ -1324,6 +1358,7 @@ export type BluetoothSdkModuleEvents = {
1324
1358
  saved_wifi_networks: (event: SavedWifiNetworksEvent) => void
1325
1359
  hotspot_status_change: (event: HotspotStatusChangeEvent) => void
1326
1360
  hotspot_error: (event: HotspotErrorEvent) => void
1361
+ fast_link_status: (event: FastLinkStatusEvent) => void
1327
1362
  photo_response: (event: PhotoResponseEvent) => void
1328
1363
  photo_status: (event: PhotoStatusEvent) => void
1329
1364
  camera_status: (event: CameraStatusEvent) => void
@@ -1497,6 +1532,7 @@ export type BluetoothSdkEventMap = {
1497
1532
  saved_wifi_networks: SavedWifiNetworksEvent
1498
1533
  hotspot_status_change: HotspotStatusChangeEvent
1499
1534
  hotspot_error: HotspotErrorEvent
1535
+ fast_link_status: FastLinkStatusEvent
1500
1536
  photo_response: PhotoResponseEvent
1501
1537
  photo_status: PhotoStatusEvent
1502
1538
  camera_status: CameraStatusEvent
@@ -1605,6 +1641,15 @@ export interface BluetoothSdkPublicModule {
1605
1641
  /** Forget a saved network and return its correlated semantic outcome. */
1606
1642
  forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>
1607
1643
  setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>
1644
+ /**
1645
+ * Open the fast photo link (Wi-Fi Direct to Mentra Live, Android only). Returns the state now;
1646
+ * `fast_link_status` reports each change. Photos use the link while it is open, and Bluetooth
1647
+ * otherwise, with no change to `requestPhoto`. Needs NEARBY_WIFI_DEVICES on Android 13+.
1648
+ */
1649
+ openFastLink(): FastLinkStatus
1650
+ /** Close the fast photo link; photos go over Bluetooth again. */
1651
+ closeFastLink(): void
1652
+ getFastLinkStatus(): FastLinkStatus
1608
1653
  /** Set the glasses clock from the phone after an OTA clock-skew failure. */
1609
1654
  setSystemTime(timestampMs: number): Promise<void>
1610
1655
  /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */
@@ -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.1503",
16
- "releaseSetId": "mentra-3.5.0-dev.1503",
17
- "sourceCommit": "a4f32ad528757b20a19b001039a6790f2c055961",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1503.json",
19
- "otaManifestSha256": "a89a829632d8ebd9f211989ff9332d619031ccc1dcfc36738012b9105f691d86"
15
+ "releaseIdentity": "3.5.0-dev.1505",
16
+ "releaseSetId": "mentra-3.5.0-dev.1505",
17
+ "sourceCommit": "01d8beea33cfb777a24014e8855bba6504e04a7a",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1505.json",
19
+ "otaManifestSha256": "bf1279d0c7fd5e4939f19581580334d090b5dea5c226506b60fd977c8178ea99"
20
20
  })
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ import type {
4
4
  BluetoothSdkEventListener,
5
5
  BluetoothSdkEventName,
6
6
  BluetoothSdkPublicModule,
7
+ FastLinkStatus,
7
8
  PhotoCaptureDefaults,
8
9
  PublicBluetoothStatus,
9
10
  PublicGlassesStatus,
@@ -34,6 +35,7 @@ const PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([
34
35
  "saved_wifi_networks",
35
36
  "hotspot_status_change",
36
37
  "hotspot_error",
38
+ "fast_link_status",
37
39
  "photo_response",
38
40
  "photo_status",
39
41
  "camera_status",
@@ -85,6 +87,20 @@ const queryOtaStatus: BluetoothSdkPublicModule["queryOtaStatus"] = () => {
85
87
  return PrivateBluetoothSdkModule.sendOtaQueryStatus()
86
88
  }
87
89
 
90
+ const UNSUPPORTED_FAST_LINK: FastLinkStatus = {
91
+ state: "unavailable",
92
+ link: "wifi_direct",
93
+ glassesSupported: false,
94
+ reason: "unsupported_platform",
95
+ }
96
+
97
+ /** Wi-Fi Direct exists only in the Android native module; elsewhere the link is unavailable. */
98
+ const fastLinkNative = PrivateBluetoothSdkModule as unknown as {
99
+ openFastLink?: () => FastLinkStatus
100
+ closeFastLink?: () => void
101
+ getFastLinkStatus?: () => FastLinkStatus
102
+ }
103
+
88
104
  const bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {
89
105
  const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]
90
106
  if (typeof method === "function") {
@@ -131,6 +147,9 @@ export const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({
131
147
  sendWifiCredentials: bindPublicMethod("sendWifiCredentials"),
132
148
  forgetWifiNetwork: bindPublicMethod("forgetWifiNetwork"),
133
149
  setHotspotState: bindPublicMethod("setHotspotState"),
150
+ openFastLink: () => fastLinkNative.openFastLink?.() ?? UNSUPPORTED_FAST_LINK,
151
+ closeFastLink: () => fastLinkNative.closeFastLink?.(),
152
+ getFastLinkStatus: () => fastLinkNative.getFastLinkStatus?.() ?? UNSUPPORTED_FAST_LINK,
134
153
  setSystemTime: bindPublicMethod("setSystemTime"),
135
154
  setWifiAdbState: bindPublicMethod("setWifiAdbState"),
136
155
  setGalleryServerEnabled: bindPublicMethod("setGalleryServerEnabled"),
@@ -258,6 +277,10 @@ export type {
258
277
  GlassesNotReadyEvent,
259
278
  HeadUpEvent,
260
279
  HotspotErrorEvent,
280
+ FastLinkState,
281
+ FastLinkStatus,
282
+ FastLinkStatusEvent,
283
+ PhotoTransport,
261
284
  HotspotStatus,
262
285
  HotspotStatusChangeEvent,
263
286
  GlassesSessionChangedEvent,