@mentra/bluetooth-sdk 3.5.0-dev.1318 → 3.5.0-dev.1324

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 @@ 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.5.0"
6
- const val RELEASE_IDENTITY: String = "3.5.0-dev.1318"
7
- const val RELEASE_SET_ID: String = "mentra-3.5.0-dev.1318"
8
- const val SOURCE_COMMIT: String = "a4f1b9da0a49d9acfd9bed5b061ce6005813f416"
9
- const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1318.json"
10
- const val OTA_MANIFEST_SHA256: String = "a3d24535c50b97f43c9114f8cf1434edaa934a40995f40c3d90205eb98f3699f"
6
+ const val RELEASE_IDENTITY: String = "3.5.0-dev.1324"
7
+ const val RELEASE_SET_ID: String = "mentra-3.5.0-dev.1324"
8
+ const val SOURCE_COMMIT: String = "d500fedf6db746c41857bc05a86668b1a631427c"
9
+ const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1324.json"
10
+ const val OTA_MANIFEST_SHA256: String = "2077d8e8415f91be0718efd8db15f8066821f28b837909d0740fa71793da16e3"
11
11
  }
@@ -21,8 +21,10 @@ object BleTraceLogger {
21
21
  return
22
22
  }
23
23
 
24
+ val type = extractType(payload)
25
+ if (isQuietType(type)) return
24
26
  val sanitized = sanitize(payload)
25
- Log.i(TAG, format(direction, layer, caller(), extractType(payload), bytes, sanitized.toString()))
27
+ Log.i(TAG, format(direction, layer, caller(), type, bytes, sanitized.toString()))
26
28
  }
27
29
 
28
30
  @JvmStatic
@@ -74,6 +76,13 @@ object BleTraceLogger {
74
76
  return "BLE_TRACE direction=$direction layer=$layer source=$source type=$type$bytesText payload=${truncate(payload)}"
75
77
  }
76
78
 
79
+ /**
80
+ * Messages sent every few seconds (the glasses' hotspot keepalive); tracing each would push
81
+ * everything else out of the logs attached to bug reports.
82
+ */
83
+ @JvmStatic
84
+ fun isQuietType(type: String?): Boolean = type == "hotspot_keepalive"
85
+
77
86
  private fun extractType(payload: JSONObject): String {
78
87
  payload.optString("type").takeIf { it.isNotBlank() }?.let { return it }
79
88
  payload.optString("C").takeIf { it.isNotBlank() }?.let { cValue ->
@@ -4425,6 +4425,9 @@ class MentraLive : SGCManager() {
4425
4425
  }
4426
4426
 
4427
4427
  when (type) {
4428
+ // The glasses send this every few seconds while their hotspot is up, so iPhones keep
4429
+ // running hotspot downloads in the background. Android needs nothing from it.
4430
+ "hotspot_keepalive" -> return
4428
4431
  "file_announce" -> handleFileTransferAnnouncement(json)
4429
4432
  "transfer_timeout" -> handleTransferTimeout(json)
4430
4433
  "transfer_failed" -> handleTransferFailed(json)
@@ -10275,13 +10278,15 @@ class MentraLive : SGCManager() {
10275
10278
  Log.w(TAG, "Rejected unsupported compact reassembled wire form")
10276
10279
  return
10277
10280
  }
10278
- logWireMetrics(
10279
- reassembled.size,
10280
- data.size,
10281
- info.fragCount,
10282
- BleWireProtocol.PROTOCOL_V2,
10283
- "glasses_to_phone"
10284
- )
10281
+ if (!BleTraceLogger.isQuietType(json.optString("type"))) {
10282
+ logWireMetrics(
10283
+ reassembled.size,
10284
+ data.size,
10285
+ info.fragCount,
10286
+ BleWireProtocol.PROTOCOL_V2,
10287
+ "glasses_to_phone"
10288
+ )
10289
+ }
10285
10290
  processJsonMessage(json)
10286
10291
  } catch (e: JSONException) {
10287
10292
  Log.e(TAG, "Failed to parse reassembled binary wire JSON", e)
@@ -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.1318",
5
- "releaseSetId": "mentra-3.5.0-dev.1318",
6
- "sourceCommit": "a4f1b9da0a49d9acfd9bed5b061ce6005813f416",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1318.json",
8
- "otaManifestSha256": "a3d24535c50b97f43c9114f8cf1434edaa934a40995f40c3d90205eb98f3699f"
4
+ "releaseIdentity": "3.5.0-dev.1324",
5
+ "releaseSetId": "mentra-3.5.0-dev.1324",
6
+ "sourceCommit": "d500fedf6db746c41857bc05a86668b1a631427c",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1324.json",
8
+ "otaManifestSha256": "2077d8e8415f91be0718efd8db15f8066821f28b837909d0740fa71793da16e3"
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.1318\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1318\",\n \"sourceCommit\": \"a4f1b9da0a49d9acfd9bed5b061ce6005813f416\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1318.json\",\n \"otaManifestSha256\": \"a3d24535c50b97f43c9114f8cf1434edaa934a40995f40c3d90205eb98f3699f\"\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.1324\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1324\",\n \"sourceCommit\": \"d500fedf6db746c41857bc05a86668b1a631427c\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1324.json\",\n \"otaManifestSha256\": \"2077d8e8415f91be0718efd8db15f8066821f28b837909d0740fa71793da16e3\"\n})\n"]}
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
16
16
  /// 20-minute unworn power-off 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.5.0-dev.1318"
19
+ private static let swiftPackageSdkVersion = "3.5.0-dev.1324"
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.1318"
7
- static let releaseSetId = "mentra-3.5.0-dev.1318"
8
- static let sourceCommit = "a4f1b9da0a49d9acfd9bed5b061ce6005813f416"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1318.json"
10
- static let otaManifestSha256 = "a3d24535c50b97f43c9114f8cf1434edaa934a40995f40c3d90205eb98f3699f"
6
+ static let releaseIdentity = "3.5.0-dev.1324"
7
+ static let releaseSetId = "mentra-3.5.0-dev.1324"
8
+ static let sourceCommit = "d500fedf6db746c41857bc05a86668b1a631427c"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1324.json"
10
+ static let otaManifestSha256 = "2077d8e8415f91be0718efd8db15f8066821f28b837909d0740fa71793da16e3"
11
11
  }
@@ -32,12 +32,14 @@ enum BleTraceLogger {
32
32
  return
33
33
  }
34
34
 
35
+ let type = extractType(from: payload)
36
+ if isQuietType(type) { return }
35
37
  let sanitized = sanitizeDictionary(payload)
36
38
  emit(format(
37
39
  direction: direction,
38
40
  layer: layer,
39
41
  source: source(file: sourceFile, function: sourceFunction, line: sourceLine),
40
- type: extractType(from: payload),
42
+ type: type,
41
43
  bytes: bytes,
42
44
  payload: jsonString(sanitized)
43
45
  ), forwardToBridge: forwardToBridge)
@@ -104,6 +106,17 @@ enum BleTraceLogger {
104
106
  return "BLE_TRACE direction=\(direction) layer=\(layer) source=\(source) type=\(type)\(bytesText) payload=\(truncate(payload))"
105
107
  }
106
108
 
109
+ /// Messages sent every few seconds; tracing each would push everything else out of the
110
+ /// logs attached to bug reports.
111
+ static func isQuietType(_ type: String?) -> Bool {
112
+ type == "hotspot_keepalive"
113
+ }
114
+
115
+ /// Cheap check on a raw inbound JSON string, before it is parsed.
116
+ static func isQuietJson(_ json: String) -> Bool {
117
+ json.count <= 256 && json.contains("\"hotspot_keepalive\"")
118
+ }
119
+
107
120
  private static func extractType(from payload: [String: Any]) -> String {
108
121
  if let type = payload["type"] as? String, !type.isEmpty {
109
122
  return type
@@ -3434,6 +3434,11 @@ class MentraLive: NSObject, SGCManager {
3434
3434
  }
3435
3435
 
3436
3436
  switch type {
3437
+ case "hotspot_keepalive":
3438
+ // Sent every few seconds while the glasses hotspot is up. Receiving it is the whole
3439
+ // point: each BLE notification lets iOS run this app a little longer, so a gallery or
3440
+ // OTA download over the hotspot keeps going while backgrounded or locked.
3441
+ return
3437
3442
  case "glasses_ready":
3438
3443
  // A queued glasses_ready from the connection just left for a pairing window
3439
3444
  // must not count as a session. Only accept readiness on a live GATT.
@@ -6289,7 +6294,8 @@ class MentraLive: NSObject, SGCManager {
6289
6294
  wireBytes: data.count,
6290
6295
  packetCount: Int(info.fragCount),
6291
6296
  protocolVersion: BleWireProtocol.protocolV2,
6292
- direction: "glasses_to_phone"
6297
+ direction: "glasses_to_phone",
6298
+ bridgeLogging: !BleTraceLogger.isQuietJson(jsonString)
6293
6299
  )
6294
6300
  processJsonMessage(jsonString)
6295
6301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.5.0-dev.1318",
3
+ "version": "3.5.0-dev.1324",
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.1318"
118
+ "@mentra/cloud-protocol": "3.5.0-dev.1324"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@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.5.0",
15
- "releaseIdentity": "3.5.0-dev.1318",
16
- "releaseSetId": "mentra-3.5.0-dev.1318",
17
- "sourceCommit": "a4f1b9da0a49d9acfd9bed5b061ce6005813f416",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1318.json",
19
- "otaManifestSha256": "a3d24535c50b97f43c9114f8cf1434edaa934a40995f40c3d90205eb98f3699f"
15
+ "releaseIdentity": "3.5.0-dev.1324",
16
+ "releaseSetId": "mentra-3.5.0-dev.1324",
17
+ "sourceCommit": "d500fedf6db746c41857bc05a86668b1a631427c",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1324.json",
19
+ "otaManifestSha256": "2077d8e8415f91be0718efd8db15f8066821f28b837909d0740fa71793da16e3"
20
20
  })