@mentra/bluetooth-sdk 3.2.0-dev.200 → 3.2.0-dev.206

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 (60) hide show
  1. package/README.md +46 -45
  2. package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +5 -9
  3. package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +63 -0
  4. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +5 -4
  5. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedChangelogCatalog.kt +1 -1
  6. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
  7. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +298 -181
  8. package/android/src/main/java/com/mentra/bluetoothsdk/MessageAckPolicy.kt +4 -0
  9. package/android/src/main/java/com/mentra/bluetoothsdk/WifiRequestResolution.kt +246 -0
  10. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/ClassicAudioConnectionTracker.kt +104 -0
  11. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +326 -45
  12. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +2 -0
  13. package/android/src/main/java/com/mentra/bluetoothsdk/status/DeviceStatus.kt +14 -0
  14. package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamControllerProbe.kt +14 -0
  15. package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamModels.kt +16 -0
  16. package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamSessionState.kt +32 -0
  17. package/android/src/test/java/com/mentra/bluetoothsdk/GlassesStatusClassicAudioTest.kt +14 -0
  18. package/android/src/test/java/com/mentra/bluetoothsdk/MessageAckPolicyTest.kt +16 -0
  19. package/android/src/test/java/com/mentra/bluetoothsdk/WifiRequestResolutionTest.kt +271 -0
  20. package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/ClassicAudioConnectionTrackerTest.kt +131 -0
  21. package/android/src/test/java/com/mentra/bluetoothsdk/streaming/StreamControllerProbeTest.kt +24 -0
  22. package/android/src/test/java/com/mentra/bluetoothsdk/streaming/StreamSessionStateTest.kt +43 -0
  23. package/build/BluetoothSdk.types.d.ts +68 -2
  24. package/build/BluetoothSdk.types.d.ts.map +1 -1
  25. package/build/BluetoothSdk.types.js.map +1 -1
  26. package/build/_private/BluetoothSdkModule.d.ts +3 -4
  27. package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
  28. package/build/_private/BluetoothSdkModule.js.map +1 -1
  29. package/build/generated/changelogCatalog.d.ts +1 -1
  30. package/build/generated/changelogCatalog.js +1 -1
  31. package/build/generated/changelogCatalog.js.map +1 -1
  32. package/build/generated/releaseMetadata.js +5 -5
  33. package/build/generated/releaseMetadata.js.map +1 -1
  34. package/build/index.d.ts +1 -1
  35. package/build/index.d.ts.map +1 -1
  36. package/build/index.js +3 -0
  37. package/build/index.js.map +1 -1
  38. package/ios/BluetoothSdkModule.swift +8 -13
  39. package/ios/Source/BluetoothSdkDefaults.swift +1 -1
  40. package/ios/Source/Bridge.swift +63 -0
  41. package/ios/Source/DeviceManager.swift +6 -3
  42. package/ios/Source/GeneratedChangelogCatalog.swift +1 -1
  43. package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
  44. package/ios/Source/MentraBluetoothSDK.swift +372 -220
  45. package/ios/Source/WifiRequestResolution.swift +251 -0
  46. package/ios/Source/sgcs/MentraLive.swift +216 -70
  47. package/ios/Source/sgcs/SGCManager.swift +13 -1
  48. package/ios/Source/status/DeviceStatus.swift +28 -0
  49. package/ios/Source/streaming/StreamControllerProbe.swift +18 -0
  50. package/ios/Source/streaming/StreamModels.swift +12 -0
  51. package/ios/Source/streaming/StreamSessionState.swift +29 -0
  52. package/ios/Tests/StreamControllerProbeTests.swift +27 -0
  53. package/ios/Tests/StreamSessionStateTests.swift +38 -0
  54. package/ios/Tests/WifiRequestResolutionTests.swift +320 -0
  55. package/package.json +1 -1
  56. package/src/BluetoothSdk.types.ts +82 -2
  57. package/src/_private/BluetoothSdkModule.ts +4 -4
  58. package/src/generated/changelogCatalog.ts +1 -1
  59. package/src/generated/releaseMetadata.ts +5 -5
  60. package/src/index.ts +11 -0
@@ -370,6 +370,8 @@ class Bridge {
370
370
  var body: [String: Any] = [
371
371
  "type": "version_info",
372
372
  VersionInfoResponseAccumulator.responseChunkKey: responseChunk,
373
+ "versionInfoType": stringValue(values, "versionInfoType", "version_info_type") ?? "",
374
+ "sid": stringValue(values, "sid") ?? "",
373
375
  "androidVersion": stringValue(values, "androidVersion", "android_version") ?? "",
374
376
  "firmwareVersion": stringValue(values, "firmwareVersion", "firmware_version") ?? "",
375
377
  "besFirmwareVersion": stringValue(values, "besFirmwareVersion", "bes_fw_version") ?? "",
@@ -404,6 +406,16 @@ class Bridge {
404
406
  if let packageName = stringValue(values, "packageName", "package_name"), !packageName.isEmpty {
405
407
  body["packageName"] = packageName
406
408
  }
409
+ if let version = values["wifiForgetResultVersion"]
410
+ ?? values["wifi_forget_result_version"]
411
+ {
412
+ body["wifiForgetResultVersion"] = version
413
+ }
414
+ if let version = values["savedWifiNetworksVersion"]
415
+ ?? values["saved_wifi_networks_version"]
416
+ {
417
+ body["savedWifiNetworksVersion"] = version
418
+ }
407
419
  Bridge.sendTypedMessage("version_info", body: body)
408
420
  }
409
421
 
@@ -488,6 +500,57 @@ class Bridge {
488
500
  Bridge.sendTypedMessage("wifi_status_change", body: body)
489
501
  }
490
502
 
503
+ static func sendWifiForgetResult(
504
+ requestId: String,
505
+ sid: String,
506
+ ssid: String,
507
+ protocolVersion: Int,
508
+ outcome: String,
509
+ legacyDispatched: Bool?,
510
+ connected: Bool?,
511
+ currentSsid: String,
512
+ localIp: String,
513
+ error: String?
514
+ ) {
515
+ guard let body = normalizeWifiForgetResultEvent(
516
+ requestId: requestId,
517
+ sid: sid,
518
+ ssid: ssid,
519
+ protocolVersion: protocolVersion,
520
+ outcome: outcome,
521
+ legacyDispatched: legacyDispatched,
522
+ connected: connected,
523
+ currentSsid: currentSsid,
524
+ localIp: localIp,
525
+ error: error
526
+ ) else {
527
+ log("Dropping malformed wifi_forget_result without modern or legacy fields")
528
+ return
529
+ }
530
+ Bridge.sendTypedMessage("wifi_forget_result", body: body)
531
+ }
532
+
533
+ static func sendSavedWifiNetworks(
534
+ requestId: String,
535
+ sid: String,
536
+ protocolVersion: Int,
537
+ outcome: String,
538
+ networks: [String],
539
+ error: String?
540
+ ) {
541
+ var body: [String: Any] = [
542
+ "requestId": requestId,
543
+ "sid": sid,
544
+ "protocolVersion": protocolVersion,
545
+ "outcome": outcome,
546
+ "networks": networks,
547
+ ]
548
+ if let error {
549
+ body["error"] = error
550
+ }
551
+ Bridge.sendTypedMessage("saved_wifi_networks", body: body)
552
+ }
553
+
491
554
  /// Claim the WiFi scan-results store for a newly requested scan. Called by the
492
555
  /// SDK when it generates the scanId, BEFORE the scan command goes out: store
493
556
  /// ownership is decided at request time, not by whichever chunk arrives first,
@@ -1510,6 +1510,10 @@ struct ViewState {
1510
1510
  sgc?.requestWifiScan(scanId: scanId)
1511
1511
  }
1512
1512
 
1513
+ @discardableResult func requestSavedWifiNetworks(requestId: String, sid: String) -> Bool {
1514
+ sgc?.requestSavedWifiNetworks(requestId: requestId, sid: sid) ?? false
1515
+ }
1516
+
1513
1517
  func sendIncidentId(_ incidentId: String, apiBaseUrl: String? = nil) {
1514
1518
  Bridge.log("MAN: Sending incidentId to glasses for log upload: \(incidentId)")
1515
1519
  sgc?.sendIncidentId(incidentId, apiBaseUrl: apiBaseUrl)
@@ -1520,9 +1524,8 @@ struct ViewState {
1520
1524
  sgc?.sendWifiCredentials(ssid, password)
1521
1525
  }
1522
1526
 
1523
- func forgetWifiNetwork(_ ssid: String) {
1524
- Bridge.log("MAN: Forgetting wifi network: \(ssid)")
1525
- sgc?.forgetWifiNetwork(ssid)
1527
+ @discardableResult func forgetWifiNetwork(_ ssid: String, requestId: String? = nil, sid: String? = nil) -> Bool {
1528
+ sgc?.forgetWifiNetwork(ssid, requestId: requestId, sid: sid) ?? false
1526
1529
  }
1527
1530
 
1528
1531
  func setHotspotState(_ enabled: Bool) {
@@ -2,6 +2,6 @@ import Foundation
2
2
 
3
3
  /// Generated from /changelogs. Do not edit directly.
4
4
  let generatedReleaseChangelogs: [ReleaseChangelog] = [
5
- ReleaseChangelog(version: "3.2.0", markdown: "This release is under active development. User-facing changes will be documented as they land."),
5
+ ReleaseChangelog(version: "3.2.0", markdown: "This release is under active development. User-facing changes will be documented as they land.\n\n- Breaking Bluetooth SDK change: `forgetWifiNetwork(ssid)` now returns `WifiForgetResult` instead of `WifiStatusChangeEvent`. Migrate status-only consumers to the semantic `outcome`; the requested network remains `ssid`, while optional post-command connectivity is reported by `connected`, `currentSsid`, and `localIp`."),
6
6
  ReleaseChangelog(version: "3.1.0", markdown: "Software updates are more reliable, with clearer progress and recovery when the glasses restart.\n\n- MentraOS, Mentra Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic."),
7
7
  ]
@@ -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.2.0"
6
- static let releaseIdentity = "3.2.0-dev.200"
7
- static let releaseSetId = "mentra-3.2.0-dev.200"
8
- static let sourceCommit = "1cdd911f596eba7b2b2f0e9ba5655c7ff16b5362"
9
- static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.200.json"
10
- static let otaManifestSha256 = "f0b5cca2fa4d1d43acf5933fb4de629819d36a145a162c763f4faa27a7c8ff79"
6
+ static let releaseIdentity = "3.2.0-dev.206"
7
+ static let releaseSetId = "mentra-3.2.0-dev.206"
8
+ static let sourceCommit = "3c22b92a5a53ce608c087503417ca5b3d16cc926"
9
+ static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.206.json"
10
+ static let otaManifestSha256 = "7bc5e09f2757b2c11da58c93459bb0a554f406dd0ae5b50b58db28b64b92c838"
11
11
  }