@mentra/bluetooth-sdk 3.4.0-beta.1320 → 3.4.0-beta.1323

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.4.0"
6
- const val RELEASE_IDENTITY: String = "3.4.0-beta.1320"
7
- const val RELEASE_SET_ID: String = "mentra-3.4.0-beta.1320"
8
- const val SOURCE_COMMIT: String = "5dd2abb3eca4823ead32f76d5b470f448a922e14"
9
- const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1320.json"
10
- const val OTA_MANIFEST_SHA256: String = "e40a5dfd7a3b83e372b075100c5d5057e4768b375a7ea627fc309be08f45234e"
6
+ const val RELEASE_IDENTITY: String = "3.4.0-beta.1323"
7
+ const val RELEASE_SET_ID: String = "mentra-3.4.0-beta.1323"
8
+ const val SOURCE_COMMIT: String = "0f824efafd38e25e56e5e2b34bbec5c9b88b31d0"
9
+ const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1323.json"
10
+ const val OTA_MANIFEST_SHA256: String = "08adbae55ebdd2415fd2869141431de2ba46930ec6b368b6db2711d4bc886079"
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 ->
@@ -4378,6 +4378,9 @@ class MentraLive : SGCManager() {
4378
4378
  }
4379
4379
 
4380
4380
  when (type) {
4381
+ // The glasses send this every few seconds while their hotspot is up, so iPhones keep
4382
+ // running hotspot downloads in the background. Android needs nothing from it.
4383
+ "hotspot_keepalive" -> return
4381
4384
  "file_announce" -> handleFileTransferAnnouncement(json)
4382
4385
  "transfer_timeout" -> handleTransferTimeout(json)
4383
4386
  "transfer_failed" -> handleTransferFailed(json)
@@ -10218,13 +10221,15 @@ class MentraLive : SGCManager() {
10218
10221
  Log.w(TAG, "Rejected unsupported compact reassembled wire form")
10219
10222
  return
10220
10223
  }
10221
- logWireMetrics(
10222
- reassembled.size,
10223
- data.size,
10224
- info.fragCount,
10225
- BleWireProtocol.PROTOCOL_V2,
10226
- "glasses_to_phone"
10227
- )
10224
+ if (!BleTraceLogger.isQuietType(json.optString("type"))) {
10225
+ logWireMetrics(
10226
+ reassembled.size,
10227
+ data.size,
10228
+ info.fragCount,
10229
+ BleWireProtocol.PROTOCOL_V2,
10230
+ "glasses_to_phone"
10231
+ )
10232
+ }
10228
10233
  processJsonMessage(json)
10229
10234
  } catch (e: JSONException) {
10230
10235
  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.4.0",
4
- "releaseIdentity": "3.4.0-beta.1320",
5
- "releaseSetId": "mentra-3.4.0-beta.1320",
6
- "sourceCommit": "5dd2abb3eca4823ead32f76d5b470f448a922e14",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1320.json",
8
- "otaManifestSha256": "e40a5dfd7a3b83e372b075100c5d5057e4768b375a7ea627fc309be08f45234e"
4
+ "releaseIdentity": "3.4.0-beta.1323",
5
+ "releaseSetId": "mentra-3.4.0-beta.1323",
6
+ "sourceCommit": "0f824efafd38e25e56e5e2b34bbec5c9b88b31d0",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1323.json",
8
+ "otaManifestSha256": "08adbae55ebdd2415fd2869141431de2ba46930ec6b368b6db2711d4bc886079"
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,iBAAiB;IACpC,cAAc,EAAE,wBAAwB;IACxC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,mIAAmI;IACrJ,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.4.0\",\n \"releaseIdentity\": \"3.4.0-beta.1320\",\n \"releaseSetId\": \"mentra-3.4.0-beta.1320\",\n \"sourceCommit\": \"5dd2abb3eca4823ead32f76d5b470f448a922e14\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1320.json\",\n \"otaManifestSha256\": \"e40a5dfd7a3b83e372b075100c5d5057e4768b375a7ea627fc309be08f45234e\"\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,iBAAiB;IACpC,cAAc,EAAE,wBAAwB;IACxC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,mIAAmI;IACrJ,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.4.0\",\n \"releaseIdentity\": \"3.4.0-beta.1323\",\n \"releaseSetId\": \"mentra-3.4.0-beta.1323\",\n \"sourceCommit\": \"0f824efafd38e25e56e5e2b34bbec5c9b88b31d0\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1323.json\",\n \"otaManifestSha256\": \"08adbae55ebdd2415fd2869141431de2ba46930ec6b368b6db2711d4bc886079\"\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.4.0-beta.1320"
19
+ private static let swiftPackageSdkVersion = "3.4.0-beta.1323"
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.4.0"
6
- static let releaseIdentity = "3.4.0-beta.1320"
7
- static let releaseSetId = "mentra-3.4.0-beta.1320"
8
- static let sourceCommit = "5dd2abb3eca4823ead32f76d5b470f448a922e14"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1320.json"
10
- static let otaManifestSha256 = "e40a5dfd7a3b83e372b075100c5d5057e4768b375a7ea627fc309be08f45234e"
6
+ static let releaseIdentity = "3.4.0-beta.1323"
7
+ static let releaseSetId = "mentra-3.4.0-beta.1323"
8
+ static let sourceCommit = "0f824efafd38e25e56e5e2b34bbec5c9b88b31d0"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1323.json"
10
+ static let otaManifestSha256 = "08adbae55ebdd2415fd2869141431de2ba46930ec6b368b6db2711d4bc886079"
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
@@ -3396,6 +3396,11 @@ class MentraLive: NSObject, SGCManager {
3396
3396
  }
3397
3397
 
3398
3398
  switch type {
3399
+ case "hotspot_keepalive":
3400
+ // Sent every few seconds while the glasses hotspot is up. Receiving it is the whole
3401
+ // point: each BLE notification lets iOS run this app a little longer, so a gallery or
3402
+ // OTA download over the hotspot keeps going while backgrounded or locked.
3403
+ return
3399
3404
  case "glasses_ready":
3400
3405
  // A queued glasses_ready from the connection just left for a pairing window
3401
3406
  // must not count as a session. Only accept readiness on a live GATT.
@@ -6007,7 +6012,8 @@ class MentraLive: NSObject, SGCManager {
6007
6012
  wireBytes: data.count,
6008
6013
  packetCount: Int(info.fragCount),
6009
6014
  protocolVersion: BleWireProtocol.protocolV2,
6010
- direction: "glasses_to_phone"
6015
+ direction: "glasses_to_phone",
6016
+ bridgeLogging: !BleTraceLogger.isQuietJson(jsonString)
6011
6017
  )
6012
6018
  processJsonMessage(jsonString)
6013
6019
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.4.0-beta.1320",
3
+ "version": "3.4.0-beta.1323",
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.4.0-beta.1320"
118
+ "@mentra/cloud-protocol": "3.4.0-beta.1323"
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.4.0",
15
- "releaseIdentity": "3.4.0-beta.1320",
16
- "releaseSetId": "mentra-3.4.0-beta.1320",
17
- "sourceCommit": "5dd2abb3eca4823ead32f76d5b470f448a922e14",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1320.json",
19
- "otaManifestSha256": "e40a5dfd7a3b83e372b075100c5d5057e4768b375a7ea627fc309be08f45234e"
15
+ "releaseIdentity": "3.4.0-beta.1323",
16
+ "releaseSetId": "mentra-3.4.0-beta.1323",
17
+ "sourceCommit": "0f824efafd38e25e56e5e2b34bbec5c9b88b31d0",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-beta.1323.json",
19
+ "otaManifestSha256": "08adbae55ebdd2415fd2869141431de2ba46930ec6b368b6db2711d4bc886079"
20
20
  })