@mentra/bluetooth-sdk 0.1.17 → 0.1.19

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 (57) hide show
  1. package/README.md +1 -1
  2. package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +52 -4
  3. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +119 -16
  4. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +0 -6
  5. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +22 -21
  6. package/android/src/main/java/com/mentra/bluetoothsdk/OtaManifest.kt +1 -1
  7. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +488 -15
  8. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +457 -31
  9. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLiveL2capChannel.kt +274 -0
  10. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +361 -67
  11. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraosBle.java +7501 -3704
  12. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +134 -0
  13. package/android/src/main/java/com/mentra/bluetoothsdk/status/DeviceStatus.kt +0 -6
  14. package/android/src/main/java/com/mentra/bluetoothsdk/utils/BleJsonCompact.java +493 -0
  15. package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +4 -1
  16. package/android/src/main/java/com/mentra/bluetoothsdk/utils/BleWireProtocol.java +108 -0
  17. package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleUploadService.java +4 -3
  18. package/android/src/main/java/com/mentra/bluetoothsdk/utils/K900LengthCodec.java +115 -0
  19. package/android/src/main/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtils.java +103 -68
  20. package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunkReassembler.java +106 -0
  21. package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunker.java +93 -0
  22. package/android/src/main/java/com/mentra/bluetoothsdk/utils/NexSGCUtils.kt +111 -11
  23. package/android/src/test/java/com/mentra/bluetoothsdk/camera/PhotoRequestTest.kt +7 -9
  24. package/android/src/test/java/com/mentra/bluetoothsdk/utils/AvifExifStripperTest.java +17 -1
  25. package/android/src/test/java/com/mentra/bluetoothsdk/utils/BinaryMessageChunkerTest.java +84 -0
  26. package/android/src/test/java/com/mentra/bluetoothsdk/utils/BleJsonCompactTest.java +158 -0
  27. package/android/src/test/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtilsEndiannessTest.java +172 -0
  28. package/android/src/test/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtilsTest.java +24 -0
  29. package/build/BluetoothSdk.types.d.ts +12 -1
  30. package/build/BluetoothSdk.types.d.ts.map +1 -1
  31. package/build/BluetoothSdk.types.js.map +1 -1
  32. package/build/types/index.d.ts +3 -0
  33. package/build/types/index.d.ts.map +1 -0
  34. package/build/types/index.js +2 -0
  35. package/build/types/index.js.map +1 -0
  36. package/ios/LocalPhotoUploadServer.swift +78 -0
  37. package/ios/MentraPhotoReceiverModule.swift +10 -0
  38. package/ios/Source/BluetoothSdkDefaults.swift +1 -1
  39. package/ios/Source/Bridge.swift +63 -0
  40. package/ios/Source/DeviceManager.swift +134 -29
  41. package/ios/Source/DeviceStore.swift +0 -5
  42. package/ios/Source/MentraBluetoothSDK.swift +26 -23
  43. package/ios/Source/OtaManifest.swift +1 -1
  44. package/ios/Source/internal/BleTraceLogger.swift +192 -0
  45. package/ios/Source/sgcs/G2.swift +518 -11
  46. package/ios/Source/sgcs/MentraLive.swift +607 -39
  47. package/ios/Source/sgcs/MentraNex.swift +416 -32
  48. package/ios/Source/sgcs/SGCManager.swift +155 -0
  49. package/ios/Source/sgcs/mentraos_ble.pb.swift +726 -122
  50. package/ios/Source/status/DeviceStatus.swift +0 -8
  51. package/ios/Source/utils/BleJsonCompact.swift +395 -0
  52. package/ios/Source/utils/BleWireProtocol.swift +92 -0
  53. package/ios/Source/utils/MessageChunkReassembler.swift +82 -0
  54. package/ios/Source/utils/MessageChunker.swift +73 -0
  55. package/package.json +14 -7
  56. package/src/BluetoothSdk.types.ts +13 -1
  57. package/src/types/index.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",
@@ -8,28 +8,33 @@
8
8
  "types": "build/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./build/index.d.ts",
12
11
  "react-native": "./src/index.ts",
12
+ "types": "./build/index.d.ts",
13
13
  "default": "./build/index.js"
14
14
  },
15
15
  "./internal": {
16
- "types": "./build/_internal.d.ts",
17
16
  "react-native": "./src/_internal.ts",
17
+ "types": "./build/_internal.d.ts",
18
18
  "default": "./build/_internal.js"
19
19
  },
20
20
  "./react": {
21
- "types": "./build/react/index.d.ts",
22
21
  "react-native": "./src/react/index.ts",
22
+ "types": "./build/react/index.d.ts",
23
23
  "default": "./build/react/index.js"
24
24
  },
25
+ "./types": {
26
+ "react-native": "./src/types/index.ts",
27
+ "types": "./build/types/index.d.ts",
28
+ "default": "./build/types/index.js"
29
+ },
25
30
  "./photo-receiver": {
26
- "types": "./build/photo-receiver/index.d.ts",
27
31
  "react-native": "./src/photo-receiver/index.ts",
32
+ "types": "./build/photo-receiver/index.d.ts",
28
33
  "default": "./build/photo-receiver/index.js"
29
34
  },
30
35
  "./debug": {
31
- "types": "./build/debug.d.ts",
32
36
  "react-native": "./src/debug.ts",
37
+ "types": "./build/debug.d.ts",
33
38
  "default": "./build/debug.js"
34
39
  },
35
40
  "./_private/*": null,
@@ -102,7 +107,9 @@
102
107
  },
103
108
  "dependencies": {},
104
109
  "devDependencies": {
105
- "expo-module-scripts": "^55.0.2"
110
+ "@types/node": "^25.9.3",
111
+ "expo-module-scripts": "^55.0.2",
112
+ "typescript": "~5.9.2"
106
113
  },
107
114
  "peerDependencies": {
108
115
  "@expo/config-plugins": ">=8.0.0",
@@ -542,6 +542,7 @@ export type MicMode = "phone" | "glasses" | "bluetoothClassic" | "bluetooth"
542
542
 
543
543
  export type PhotoRequestParams = {
544
544
  requestId?: string
545
+ appId?: string
545
546
  size: PhotoSize
546
547
  webhookUrl: string | null
547
548
  authToken: string | null
@@ -761,6 +762,15 @@ export type OtaStartAckEvent = {
761
762
  timestamp: number
762
763
  }
763
764
 
765
+ export type OtaUpdateAvailableEvent = {
766
+ type: "ota_update_available"
767
+ version_code?: number
768
+ version_name?: string
769
+ updates?: string[]
770
+ total_size?: number
771
+ cache_ready?: boolean
772
+ }
773
+
764
774
  export type OtaStatusEvent = {
765
775
  type: "ota_status"
766
776
  session_id: string
@@ -837,6 +847,7 @@ export type BluetoothSdkModuleEvents = {
837
847
  stream_status: (event: StreamStatusEvent) => void
838
848
  keep_alive_ack: (event: KeepAliveAckEvent) => void
839
849
  mtk_update_complete: (event: MtkUpdateCompleteEvent) => void
850
+ ota_update_available: (event: OtaUpdateAvailableEvent) => void
840
851
  ota_start_ack: (event: OtaStartAckEvent) => void
841
852
  ota_status: (event: OtaStatusEvent) => void
842
853
  version_info: (event: VersionInfoEvent) => void
@@ -907,6 +918,7 @@ export type BluetoothSdkEventMap = {
907
918
  mic_pcm: MicPcmEvent
908
919
  mic_lc3: MicLc3Event
909
920
  stream_status: StreamStatusEvent
921
+ ota_update_available: OtaUpdateAvailableEvent
910
922
  ota_start_ack: OtaStartAckEvent
911
923
  ota_status: OtaStatusEvent
912
924
  version_info: VersionInfoEvent
@@ -1085,6 +1097,7 @@ export interface OtaUpdateInfo {
1085
1097
  versionName: string
1086
1098
  updates: string[] // ["apk", "mtk", "bes"]
1087
1099
  totalSize: number
1100
+ cacheReady?: boolean
1088
1101
  }
1089
1102
 
1090
1103
  export interface OtaProgress {
@@ -1270,7 +1283,6 @@ export type BluetoothSettingsUpdate = Partial<{
1270
1283
  should_send_lc3: boolean
1271
1284
  should_send_transcript: boolean
1272
1285
  offline_mode: boolean
1273
- offline_captions_running: boolean
1274
1286
  local_stt_fallback_active: boolean
1275
1287
  pending_wearable: DeviceModel | ""
1276
1288
  default_wearable: DeviceModel | ""
@@ -0,0 +1,7 @@
1
+ export {
2
+ isBusyGlassesConnectionStatus,
3
+ isConnectedGlassesConnectionStatus,
4
+ isReadyGlassesConnectionStatus,
5
+ } from "../BluetoothSdk.types"
6
+
7
+ export type {ConnectedGlassesConnectionStatus, GlassesConnectionStatus} from "../BluetoothSdk.types"