@mentra/bluetooth-sdk 3.2.0-dev.254 → 3.2.0-dev.259
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.
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamModels.kt +11 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/StreamDegradationPreferenceTest.kt +61 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/StreamRequestTest.kt +134 -0
- package/android/src/test/java/com/mentra/bluetoothsdk/utils/BleJsonCompactTest.java +31 -0
- package/build/BluetoothSdk.types.d.ts +7 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +5 -0
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/_private/streamRequestPayload.d.ts +8 -0
- package/build/_private/streamRequestPayload.d.ts.map +1 -0
- package/build/_private/streamRequestPayload.js +42 -0
- package/build/_private/streamRequestPayload.js.map +1 -0
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/ios/Source/streaming/StreamModels.swift +34 -6
- package/ios/Tests/StreamDegradationPreferenceTests.swift +55 -0
- package/ios/Tests/StreamRequestTests.swift +113 -0
- package/package.json +2 -2
- package/src/BluetoothSdk.types.ts +8 -0
- package/src/_private/BluetoothSdkModule.ts +9 -0
- package/src/_private/streamRequestPayload.ts +43 -0
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/index.ts +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes stream start request parameters for the native module bridge.
|
|
3
|
+
* Preserves omission of telemetry when undefined so the glasses use their build default,
|
|
4
|
+
* and forwards explicit true / false.
|
|
5
|
+
*/
|
|
6
|
+
export function streamRequestParamsForNative(params) {
|
|
7
|
+
const payload = {
|
|
8
|
+
streamUrl: params.streamUrl,
|
|
9
|
+
};
|
|
10
|
+
if (params.type !== undefined) {
|
|
11
|
+
payload.type = params.type;
|
|
12
|
+
}
|
|
13
|
+
if (params.streamId !== undefined) {
|
|
14
|
+
payload.streamId = params.streamId;
|
|
15
|
+
}
|
|
16
|
+
if (params.sound !== undefined) {
|
|
17
|
+
payload.sound = params.sound;
|
|
18
|
+
}
|
|
19
|
+
if (params.video !== undefined) {
|
|
20
|
+
payload.video = params.video;
|
|
21
|
+
}
|
|
22
|
+
if (params.audio !== undefined) {
|
|
23
|
+
payload.audio = params.audio;
|
|
24
|
+
}
|
|
25
|
+
if (params.ice !== undefined) {
|
|
26
|
+
payload.ice = params.ice;
|
|
27
|
+
}
|
|
28
|
+
if (params.captureAudio !== undefined) {
|
|
29
|
+
payload.captureAudio = params.captureAudio;
|
|
30
|
+
}
|
|
31
|
+
if (params.traceId !== undefined && params.traceId.length > 0) {
|
|
32
|
+
payload.traceId = params.traceId;
|
|
33
|
+
}
|
|
34
|
+
if (params.authToken !== undefined && params.authToken.length > 0) {
|
|
35
|
+
payload.authToken = params.authToken;
|
|
36
|
+
}
|
|
37
|
+
if (params.telemetry !== undefined) {
|
|
38
|
+
payload.telemetry = params.telemetry;
|
|
39
|
+
}
|
|
40
|
+
return payload;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=streamRequestPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamRequestPayload.js","sourceRoot":"","sources":["../../src/_private/streamRequestPayload.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAA0B;IACrE,MAAM,OAAO,GAA4B;QACv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IACD,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;IACtC,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import type {StreamStartRequest} from \"../BluetoothSdk.types\"\n\n/**\n * Normalizes stream start request parameters for the native module bridge.\n * Preserves omission of telemetry when undefined so the glasses use their build default,\n * and forwards explicit true / false.\n */\nexport function streamRequestParamsForNative(params: StreamStartRequest): Record<string, unknown> {\n const payload: Record<string, unknown> = {\n streamUrl: params.streamUrl,\n }\n if (params.type !== undefined) {\n payload.type = params.type\n }\n if (params.streamId !== undefined) {\n payload.streamId = params.streamId\n }\n if (params.sound !== undefined) {\n payload.sound = params.sound\n }\n if (params.video !== undefined) {\n payload.video = params.video\n }\n if (params.audio !== undefined) {\n payload.audio = params.audio\n }\n if (params.ice !== undefined) {\n payload.ice = params.ice\n }\n if (params.captureAudio !== undefined) {\n payload.captureAudio = params.captureAudio\n }\n if (params.traceId !== undefined && params.traceId.length > 0) {\n payload.traceId = params.traceId\n }\n if (params.authToken !== undefined && params.authToken.length > 0) {\n payload.authToken = params.authToken\n }\n if (params.telemetry !== undefined) {\n payload.telemetry = params.telemetry\n }\n return payload\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"familyBaseVersion": "3.2.0",
|
|
4
|
-
"releaseIdentity": "3.2.0-dev.
|
|
5
|
-
"releaseSetId": "mentra-3.2.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
7
|
-
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.
|
|
8
|
-
"otaManifestSha256": "
|
|
4
|
+
"releaseIdentity": "3.2.0-dev.259",
|
|
5
|
+
"releaseSetId": "mentra-3.2.0-dev.259",
|
|
6
|
+
"sourceCommit": "a813257666fd73103cf743ec50a4a158ed021d41",
|
|
7
|
+
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.259.json",
|
|
8
|
+
"otaManifestSha256": "b72673f29592ac9357d40b639d093bd50914c8f6f0f4bb02cf0f4fe03fbf0f38"
|
|
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,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,wHAAwH;IAC1I,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.2.0\",\n \"releaseIdentity\": \"3.2.0-dev.
|
|
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,eAAe;IAClC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,wHAAwH;IAC1I,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.2.0\",\n \"releaseIdentity\": \"3.2.0-dev.259\",\n \"releaseSetId\": \"mentra-3.2.0-dev.259\",\n \"sourceCommit\": \"a813257666fd73103cf743ec50a4a158ed021d41\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.259.json\",\n \"otaManifestSha256\": \"b72673f29592ac9357d40b639d093bd50914c8f6f0f4bb02cf0f4fe03fbf0f38\"\n})\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { BluetoothSdkPublicModule } from "./BluetoothSdk.types";
|
|
|
2
2
|
export declare const BluetoothSdk: BluetoothSdkPublicModule;
|
|
3
3
|
export default BluetoothSdk;
|
|
4
4
|
export { CAMERA_FOV_DEFAULT, CAMERA_FOV_MAX, CAMERA_FOV_MIN, DeviceModels, isBusyGlassesConnectionStatus, isConnectedGlassesConnectionStatus, isConnectedWifiStatus, isEnabledHotspotStatus, isReadyGlassesConnectionStatus, } from "./BluetoothSdk.types";
|
|
5
|
-
export type { AccelEvent, Ar99OtaStatusEvent, AudioConnectedEvent, AudioDisconnectedEvent, AudioPairingNeededEvent, BatteryStatusEvent, BluetoothSdkEvent, BluetoothSdkEventListener, BluetoothSdkEventMap, BluetoothSdkEventName, BluetoothSdkPublicModule as BluetoothSdkModule, BluetoothSdkSubscription, ButtonPhotoSize, PhotoCaptureDefaults, ButtonPressEvent, CameraFovPreset, CameraFovRequest, CameraFovResult, CameraRoiPosition, CompatibleGlassesSearchStopEvent, ConnectOptions, ConnectedGlassesConnectionStatus, ConnectedWifiStatus, Device, DeviceModel, EnabledHotspotStatus, GalleryStatusEvent, GlassesConnectionStatus, GlassesMediaVolumeGetResult, GlassesMediaVolumeSetResult, GlassesNotReadyEvent, HeadUpEvent, HotspotErrorEvent, HotspotStatus, HotspotStatusChangeEvent, GlassesSessionChangedEvent, KeepAliveAckEvent, LocalTranscriptionEvent, LogEvent, MicLc3Event, MicHealthEvent, MicMode, MicPcmEvent, MicPreference, OtaStartAckEvent, OtaProgress, OtaProgressStatus, OtaStage, OtaStatus, OtaStatusEvent, OtaQueryResult, OtaUpdateInfo, ReleaseChangelog, MtkUpdateCompleteEvent, PairFailureEvent, PairingInfoEvent, EnteringPairingModeEvent, OwnerReplacedEvent, PhotoCaptureMetadata, PhotoResolvedConfig, PhotoCompression, PhotoFpsRange, PhotoMeteredPreview, PhotoMode, PublicBluetoothStatus, PublicGlassesStatus, PhotoTransferMethod, PhotoResponseEvent, PhotoRequestedCaptureConfig, PhotoRequestParams, PhotoSize, PhotoStatusEvent, PhotoStatusState, PhotoSuccessResponseEvent, RgbLedAction, RgbLedColor, RgbLedControlResponseEvent, RgbLedControlSuccessResponseEvent, ScanModelOptions, ScanDiagnostic, ScanOptions, ScanResultsCallback, SpeakingStatusEvent, SettingsAckEvent, SettingsAckSetting, SettingsAckSuccessEvent, SettingsAckSuccessStatus, SettingsAckStatus, StreamAudioConfig, StreamResolvedConfig, StreamStartRequest, StreamStatusEvent, StreamStatusLifecycleState, StreamStatusReconnectState, StreamStatusState, StreamVideoConfig, SwipeVolumeStatusEvent, SwitchStatusEvent, TouchEvent, VideoRecordingDefaults, VideoRecordingStartedStatusEvent, VideoRecordingStatusEvent, VideoRecordingStatusState, VideoRecordingStoppedStatusEvent, VideoRecordingSuccessStatusEvent, VersionInfoEvent, VersionInfoResult, SavedWifiNetworksEvent, SavedWifiNetworksOutcome, SavedWifiNetworksResult, WifiForgetOutcome, WifiForgetResult, WifiForgetResultEvent, LegacyWifiForgetResultEvent, ModernWifiForgetResultEvent, WifiScanResultEvent, VoiceActivityDetectionStatusEvent, WifiSearchResult, WifiStatus, WifiStatusChangeEvent, } from "./BluetoothSdk.types";
|
|
5
|
+
export type { AccelEvent, Ar99OtaStatusEvent, AudioConnectedEvent, AudioDisconnectedEvent, AudioPairingNeededEvent, BatteryStatusEvent, BluetoothSdkEvent, BluetoothSdkEventListener, BluetoothSdkEventMap, BluetoothSdkEventName, BluetoothSdkPublicModule as BluetoothSdkModule, BluetoothSdkSubscription, ButtonPhotoSize, PhotoCaptureDefaults, ButtonPressEvent, CameraFovPreset, CameraFovRequest, CameraFovResult, CameraRoiPosition, CompatibleGlassesSearchStopEvent, ConnectOptions, ConnectedGlassesConnectionStatus, ConnectedWifiStatus, Device, DeviceModel, EnabledHotspotStatus, GalleryStatusEvent, GlassesConnectionStatus, GlassesMediaVolumeGetResult, GlassesMediaVolumeSetResult, GlassesNotReadyEvent, HeadUpEvent, HotspotErrorEvent, HotspotStatus, HotspotStatusChangeEvent, GlassesSessionChangedEvent, KeepAliveAckEvent, LocalTranscriptionEvent, LogEvent, MicLc3Event, MicHealthEvent, MicMode, MicPcmEvent, MicPreference, OtaStartAckEvent, OtaProgress, OtaProgressStatus, OtaStage, OtaStatus, OtaStatusEvent, OtaQueryResult, OtaUpdateInfo, ReleaseChangelog, MtkUpdateCompleteEvent, PairFailureEvent, PairingInfoEvent, EnteringPairingModeEvent, OwnerReplacedEvent, PhotoCaptureMetadata, PhotoResolvedConfig, PhotoCompression, PhotoFpsRange, PhotoMeteredPreview, PhotoMode, PublicBluetoothStatus, PublicGlassesStatus, PhotoTransferMethod, PhotoResponseEvent, PhotoRequestedCaptureConfig, PhotoRequestParams, PhotoSize, PhotoStatusEvent, PhotoStatusState, PhotoSuccessResponseEvent, RgbLedAction, RgbLedColor, RgbLedControlResponseEvent, RgbLedControlSuccessResponseEvent, ScanModelOptions, ScanDiagnostic, ScanOptions, ScanResultsCallback, SpeakingStatusEvent, SettingsAckEvent, SettingsAckSetting, SettingsAckSuccessEvent, SettingsAckSuccessStatus, SettingsAckStatus, StreamAudioConfig, StreamDegradationPreference, StreamResolvedConfig, StreamStartRequest, StreamStatusEvent, StreamStatusLifecycleState, StreamStatusReconnectState, StreamStatusState, StreamVideoConfig, SwipeVolumeStatusEvent, SwitchStatusEvent, TouchEvent, VideoRecordingDefaults, VideoRecordingStartedStatusEvent, VideoRecordingStatusEvent, VideoRecordingStatusState, VideoRecordingStoppedStatusEvent, VideoRecordingSuccessStatusEvent, VersionInfoEvent, VersionInfoResult, SavedWifiNetworksEvent, SavedWifiNetworksOutcome, SavedWifiNetworksResult, WifiForgetOutcome, WifiForgetResult, WifiForgetResultEvent, LegacyWifiForgetResultEvent, ModernWifiForgetResultEvent, WifiScanResultEvent, VoiceActivityDetectionStatusEvent, WifiSearchResult, WifiStatus, WifiStatusChangeEvent, } from "./BluetoothSdk.types";
|
|
6
6
|
export type { NativeNotificationConfig, NativeNotificationStatus, NativeNotificationDelivery } from "./BluetoothSdk.types";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,wBAAwB,EAKzB,MAAM,sBAAsB,CAAA;AAkF7B,eAAO,MAAM,YAAY,EAAE,wBAsGzB,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,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,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,gCAAgC,EAChC,yBAAyB,EACzB,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EAChC,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,iCAAiC,EACjC,gBAAgB,EAChB,UAAU,EACV,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAC,wBAAwB,EAAE,wBAAwB,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,wBAAwB,EAKzB,MAAM,sBAAsB,CAAA;AAkF7B,eAAO,MAAM,YAAY,EAAE,wBAsGzB,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,IAAI,kBAAkB,EAC9C,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gCAAgC,EAChC,cAAc,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BAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,iCAAiC,EACjC,gBAAgB,EAChB,UAAU,EACV,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EAAC,wBAAwB,EAAE,wBAAwB,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAA"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAA;AAC9E,OAAO,yBAAyB,MAAM,+BAA+B,CAAA;AAUrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAwB;IACxD,4BAA4B;IAC5B,8BAA8B;IAC9B,KAAK;IACL,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,aAAa;IACb,SAAS;IACT,iCAAiC;IACjC,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,uBAAuB;IACvB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,gCAAgC;IAChC,qBAAqB;IACrB,eAAe;IACf,0BAA0B;IAC1B,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,gBAAgB;IAChB,sBAAsB;IACtB,iBAAiB;IACjB,oBAAoB;IACpB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,eAAe;IACf,qBAAqB;IACrB,yBAAyB;IACzB,eAAe;IACf,YAAY;IACZ,iBAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAC,CAAA;AAEF,MAAM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C;IACpD,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC;IAChD,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,kBAAkB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC1D,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;IAC5D,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CACvD,CAAC,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import {parsePhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nimport PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PhotoCaptureDefaults,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"native_notification_status\",\n \"native_notification_delivery\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"wifi_forget_result\",\n \"saved_wifi_networks\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"version_info\",\n \"extraction_progress\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @mentra/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n configureNativeNotifications: bindPublicMethod(\"configureNativeNotifications\"),\n getNativeNotificationStatus: bindPublicMethod(\"getNativeNotificationStatus\"),\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n setDashboardContent: bindPublicMethod(\"setDashboardContent\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n getSavedWifiNetworks: bindPublicMethod(\"getSavedWifiNetworks\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: (settings: PhotoCaptureDefaults) => {\n if (settings.compress !== undefined) parsePhotoCompression(settings.compress)\n return bindPublicMethod(\"setPhotoCaptureDefaults\")(settings)\n },\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n GlassesConnectionStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n MtkUpdateCompleteEvent,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanDiagnostic,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n SavedWifiNetworksEvent,\n SavedWifiNetworksOutcome,\n SavedWifiNetworksResult,\n WifiForgetOutcome,\n WifiForgetResult,\n WifiForgetResultEvent,\n LegacyWifiForgetResultEvent,\n ModernWifiForgetResultEvent,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n\nexport type {NativeNotificationConfig, NativeNotificationStatus, NativeNotificationDelivery} from \"./BluetoothSdk.types\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,0CAA0C,CAAA;AAC9E,O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gB,CAAC,kBAAkB,CAAC;IACtD,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CACvD,CAAC,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import {parsePhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nimport PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PhotoCaptureDefaults,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"native_notification_status\",\n \"native_notification_delivery\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"wifi_forget_result\",\n \"saved_wifi_networks\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"version_info\",\n \"extraction_progress\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @mentra/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n configureNativeNotifications: bindPublicMethod(\"configureNativeNotifications\"),\n getNativeNotificationStatus: bindPublicMethod(\"getNativeNotificationStatus\"),\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n setDashboardContent: bindPublicMethod(\"setDashboardContent\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n getSavedWifiNetworks: bindPublicMethod(\"getSavedWifiNetworks\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: (settings: PhotoCaptureDefaults) => {\n if (settings.compress !== undefined) parsePhotoCompression(settings.compress)\n return bindPublicMethod(\"setPhotoCaptureDefaults\")(settings)\n },\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n GlassesConnectionStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n MtkUpdateCompleteEvent,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanDiagnostic,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamDegradationPreference,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n SavedWifiNetworksEvent,\n SavedWifiNetworksOutcome,\n SavedWifiNetworksResult,\n WifiForgetOutcome,\n WifiForgetResult,\n WifiForgetResultEvent,\n LegacyWifiForgetResultEvent,\n ModernWifiForgetResultEvent,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n\nexport type {NativeNotificationConfig, NativeNotificationStatus, NativeNotificationDelivery} from \"./BluetoothSdk.types\"\n"]}
|
|
@@ -11,7 +11,7 @@ enum BluetoothSdkDefaults {
|
|
|
11
11
|
static let voiceActivityDetectionEnabled = false
|
|
12
12
|
static let loudnessGateEnabled = false
|
|
13
13
|
private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
|
|
14
|
-
private static let swiftPackageSdkVersion = "3.2.0-dev.
|
|
14
|
+
private static let swiftPackageSdkVersion = "3.2.0-dev.259"
|
|
15
15
|
private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
|
|
16
16
|
|
|
17
17
|
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.2.0"
|
|
6
|
-
static let releaseIdentity = "3.2.0-dev.
|
|
7
|
-
static let releaseSetId = "mentra-3.2.0-dev.
|
|
8
|
-
static let sourceCommit = "
|
|
9
|
-
static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.
|
|
10
|
-
static let otaManifestSha256 = "
|
|
6
|
+
static let releaseIdentity = "3.2.0-dev.259"
|
|
7
|
+
static let releaseSetId = "mentra-3.2.0-dev.259"
|
|
8
|
+
static let sourceCommit = "a813257666fd73103cf743ec50a4a158ed021d41"
|
|
9
|
+
static let otaManifestUrl = "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.2.0/mentra-live-ota-3.2.0-dev.259.json"
|
|
10
|
+
static let otaManifestSha256 = "b72673f29592ac9357d40b639d093bd50914c8f6f0f4bb02cf0f4fe03fbf0f38"
|
|
11
11
|
}
|
|
@@ -7,6 +7,8 @@ public struct StreamVideoConfig {
|
|
|
7
7
|
public let minBitrateBps: Int?
|
|
8
8
|
public let initialBitrateBps: Int?
|
|
9
9
|
public let fps: Int?
|
|
10
|
+
/// WHIP adaptation policy; nil preserves the glasses' MAINTAIN_FRAMERATE default.
|
|
11
|
+
public let degradationPreference: String?
|
|
10
12
|
|
|
11
13
|
public init(
|
|
12
14
|
width: Int? = nil,
|
|
@@ -14,7 +16,8 @@ public struct StreamVideoConfig {
|
|
|
14
16
|
bitrate: Int? = nil,
|
|
15
17
|
fps: Int? = nil,
|
|
16
18
|
minBitrateBps: Int? = nil,
|
|
17
|
-
initialBitrateBps: Int? = nil
|
|
19
|
+
initialBitrateBps: Int? = nil,
|
|
20
|
+
degradationPreference: String? = nil
|
|
18
21
|
) {
|
|
19
22
|
self.width = width
|
|
20
23
|
self.height = height
|
|
@@ -22,6 +25,7 @@ public struct StreamVideoConfig {
|
|
|
22
25
|
self.minBitrateBps = minBitrateBps
|
|
23
26
|
self.initialBitrateBps = initialBitrateBps
|
|
24
27
|
self.fps = fps
|
|
28
|
+
self.degradationPreference = degradationPreference
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
var dictionary: [String: Any] {
|
|
@@ -31,6 +35,7 @@ public struct StreamVideoConfig {
|
|
|
31
35
|
if let bitrate { values["bitrate"] = bitrate }
|
|
32
36
|
if let minBitrateBps { values["minBitrateBps"] = minBitrateBps }
|
|
33
37
|
if let initialBitrateBps { values["initialBitrateBps"] = initialBitrateBps }
|
|
38
|
+
if let degradationPreference { values["degradationPreference"] = degradationPreference }
|
|
34
39
|
// ASG stream parsers shipped with the BLE key named "frameRate".
|
|
35
40
|
if let fps { values["frameRate"] = fps }
|
|
36
41
|
return values
|
|
@@ -44,7 +49,8 @@ public struct StreamVideoConfig {
|
|
|
44
49
|
bitrate: intValue(values["bitrate"]),
|
|
45
50
|
fps: intValue(values["fps"]),
|
|
46
51
|
minBitrateBps: intValue(values["minBitrateBps"]),
|
|
47
|
-
initialBitrateBps: intValue(values["initialBitrateBps"])
|
|
52
|
+
initialBitrateBps: intValue(values["initialBitrateBps"]),
|
|
53
|
+
degradationPreference: stringValue(values, "degradationPreference", "dp")
|
|
48
54
|
)
|
|
49
55
|
}
|
|
50
56
|
}
|
|
@@ -129,6 +135,8 @@ public struct StreamResolvedVideoConfig: Equatable {
|
|
|
129
135
|
public let bitrate: Int
|
|
130
136
|
/// Resolved capture/encode frame rate.
|
|
131
137
|
public let fps: Double
|
|
138
|
+
/// Applied WHIP adaptation policy; absent on older firmware and other transports.
|
|
139
|
+
public let degradationPreference: String?
|
|
132
140
|
|
|
133
141
|
public init(
|
|
134
142
|
width: Int,
|
|
@@ -136,7 +144,8 @@ public struct StreamResolvedVideoConfig: Equatable {
|
|
|
136
144
|
captureWidth: Int? = nil,
|
|
137
145
|
captureHeight: Int? = nil,
|
|
138
146
|
bitrate: Int,
|
|
139
|
-
fps: Double
|
|
147
|
+
fps: Double,
|
|
148
|
+
degradationPreference: String? = nil
|
|
140
149
|
) {
|
|
141
150
|
self.width = width
|
|
142
151
|
self.height = height
|
|
@@ -144,6 +153,7 @@ public struct StreamResolvedVideoConfig: Equatable {
|
|
|
144
153
|
self.captureHeight = captureHeight
|
|
145
154
|
self.bitrate = bitrate
|
|
146
155
|
self.fps = fps
|
|
156
|
+
self.degradationPreference = degradationPreference
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
init?(values: [String: Any]?) {
|
|
@@ -161,7 +171,8 @@ public struct StreamResolvedVideoConfig: Equatable {
|
|
|
161
171
|
captureWidth: intValue(values["captureWidth"]),
|
|
162
172
|
captureHeight: intValue(values["captureHeight"]),
|
|
163
173
|
bitrate: bitrate,
|
|
164
|
-
fps: fps
|
|
174
|
+
fps: fps,
|
|
175
|
+
degradationPreference: stringValue(values, "degradationPreference", "dp")
|
|
165
176
|
)
|
|
166
177
|
}
|
|
167
178
|
|
|
@@ -174,6 +185,7 @@ public struct StreamResolvedVideoConfig: Equatable {
|
|
|
174
185
|
]
|
|
175
186
|
if let captureWidth { values["captureWidth"] = captureWidth }
|
|
176
187
|
if let captureHeight { values["captureHeight"] = captureHeight }
|
|
188
|
+
if let degradationPreference { values["degradationPreference"] = degradationPreference }
|
|
177
189
|
return values
|
|
178
190
|
}
|
|
179
191
|
}
|
|
@@ -318,6 +330,7 @@ public struct StreamRequest {
|
|
|
318
330
|
/// Correlation id the glasses echo in every SOFTAP_TRACE line, so phone and glasses logs can
|
|
319
331
|
/// be joined despite unsynchronised clocks.
|
|
320
332
|
public let traceId: String?
|
|
333
|
+
public let telemetry: Bool?
|
|
321
334
|
|
|
322
335
|
public init(
|
|
323
336
|
streamUrl: String,
|
|
@@ -328,7 +341,8 @@ public struct StreamRequest {
|
|
|
328
341
|
authToken: String? = nil,
|
|
329
342
|
captureAudio: Bool = true,
|
|
330
343
|
ice: StreamIceConfig? = nil,
|
|
331
|
-
traceId: String? = nil
|
|
344
|
+
traceId: String? = nil,
|
|
345
|
+
telemetry: Bool? = nil
|
|
332
346
|
) {
|
|
333
347
|
self.streamUrl = streamUrl
|
|
334
348
|
self.streamId = streamId
|
|
@@ -339,9 +353,19 @@ public struct StreamRequest {
|
|
|
339
353
|
self.captureAudio = captureAudio
|
|
340
354
|
self.ice = ice
|
|
341
355
|
self.traceId = traceId
|
|
356
|
+
self.telemetry = telemetry
|
|
342
357
|
}
|
|
343
358
|
|
|
344
359
|
init(values: [String: Any]) {
|
|
360
|
+
let telemetryValue: Bool?
|
|
361
|
+
if let telemetry = values["telemetry"] as? Bool {
|
|
362
|
+
telemetryValue = telemetry
|
|
363
|
+
} else if let tl = values["tl"] as? Bool {
|
|
364
|
+
telemetryValue = tl
|
|
365
|
+
} else {
|
|
366
|
+
telemetryValue = nil
|
|
367
|
+
}
|
|
368
|
+
|
|
345
369
|
self.init(
|
|
346
370
|
streamUrl: values["streamUrl"] as? String
|
|
347
371
|
?? values["rtmpUrl"] as? String
|
|
@@ -357,7 +381,8 @@ public struct StreamRequest {
|
|
|
357
381
|
ice: StreamIceConfig(
|
|
358
382
|
values: (values["ice"] as? [String: Any]) ?? (values["i"] as? [String: Any])
|
|
359
383
|
),
|
|
360
|
-
traceId: values["traceId"] as? String
|
|
384
|
+
traceId: values["traceId"] as? String,
|
|
385
|
+
telemetry: telemetryValue
|
|
361
386
|
)
|
|
362
387
|
}
|
|
363
388
|
|
|
@@ -385,6 +410,9 @@ public struct StreamRequest {
|
|
|
385
410
|
if let traceId, !traceId.isEmpty {
|
|
386
411
|
values["traceId"] = traceId
|
|
387
412
|
}
|
|
413
|
+
if let telemetry {
|
|
414
|
+
values["telemetry"] = telemetry
|
|
415
|
+
}
|
|
388
416
|
return values
|
|
389
417
|
}
|
|
390
418
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@testable import MentraBluetoothSDK
|
|
2
|
+
import XCTest
|
|
3
|
+
|
|
4
|
+
final class StreamDegradationPreferenceTests: XCTestCase {
|
|
5
|
+
func testPreferenceSurvivesRequestBridgeAndSerialization() throws {
|
|
6
|
+
for preference in ["MAINTAIN_FRAMERATE", "MAINTAIN_RESOLUTION", "BALANCED", "DISABLED"] {
|
|
7
|
+
let request = StreamRequest(values: [
|
|
8
|
+
"streamUrl": "https://example.com/whip",
|
|
9
|
+
"video": ["fps": 5, "degradationPreference": preference],
|
|
10
|
+
])
|
|
11
|
+
XCTAssertEqual(request.video?.degradationPreference, preference)
|
|
12
|
+
let wireVideo = try XCTUnwrap(request.values["video"] as? [String: Any])
|
|
13
|
+
XCTAssertEqual(wireVideo["degradationPreference"] as? String, preference)
|
|
14
|
+
XCTAssertEqual(wireVideo["frameRate"] as? Int, 5)
|
|
15
|
+
XCTAssertEqual(StreamVideoConfig(degradationPreference: preference).dictionary["degradationPreference"] as? String, preference)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
func testOmissionPreservesGlassesDefault() throws {
|
|
20
|
+
let request = StreamRequest(values: [
|
|
21
|
+
"streamUrl": "https://example.com/whip",
|
|
22
|
+
"video": ["fps": 5],
|
|
23
|
+
])
|
|
24
|
+
XCTAssertNil(request.video?.degradationPreference)
|
|
25
|
+
let wireVideo = try XCTUnwrap(request.values["video"] as? [String: Any])
|
|
26
|
+
XCTAssertNil(wireVideo["degradationPreference"])
|
|
27
|
+
XCTAssertNil(StreamVideoConfig().dictionary["degradationPreference"])
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func testCompactKeyIsAcceptedAndFullKeyWins() throws {
|
|
31
|
+
let compact = try XCTUnwrap(StreamVideoConfig(values: ["dp": "MAINTAIN_RESOLUTION"]))
|
|
32
|
+
XCTAssertEqual(compact.dictionary["degradationPreference"] as? String, "MAINTAIN_RESOLUTION")
|
|
33
|
+
let full = try XCTUnwrap(StreamVideoConfig(values: [
|
|
34
|
+
"degradationPreference": "BALANCED", "dp": "DISABLED",
|
|
35
|
+
]))
|
|
36
|
+
XCTAssertEqual(full.dictionary["degradationPreference"] as? String, "BALANCED")
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
func testStatusBridgePreservesAppliedPreferenceAndLegacyOmission() throws {
|
|
40
|
+
for preference: String? in [nil, "MAINTAIN_RESOLUTION"] {
|
|
41
|
+
var video: [String: Any] = [
|
|
42
|
+
"width": 1920, "height": 1080, "bitrate": 2_500_000, "fps": 5.0,
|
|
43
|
+
]
|
|
44
|
+
if let preference { video["degradationPreference"] = preference }
|
|
45
|
+
let event = StreamStatusEvent(values: [
|
|
46
|
+
"status": "streaming",
|
|
47
|
+
"resolvedConfig": ["transport": "whip", "video": video],
|
|
48
|
+
])
|
|
49
|
+
XCTAssertEqual(event.resolvedConfig?.video?.degradationPreference, preference)
|
|
50
|
+
let resolved = try XCTUnwrap(event.values["resolvedConfig"] as? [String: Any])
|
|
51
|
+
let wireVideo = try XCTUnwrap(resolved["video"] as? [String: Any])
|
|
52
|
+
XCTAssertEqual(wireVideo as NSDictionary, video as NSDictionary)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
@testable import MentraBluetoothSDK
|
|
2
|
+
import XCTest
|
|
3
|
+
|
|
4
|
+
final class StreamRequestTests: XCTestCase {
|
|
5
|
+
|
|
6
|
+
func testOmissionPreservesBuildDefaultInValues() {
|
|
7
|
+
let request = StreamRequest(
|
|
8
|
+
streamUrl: "https://example.com/whip",
|
|
9
|
+
streamId: "s-1"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
XCTAssertNil(request.telemetry)
|
|
13
|
+
XCTAssertNil(request.values["telemetry"])
|
|
14
|
+
XCTAssertNil(request.values["tl"])
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
func testInitFromValuesPreservesOmissionWhenKeyAbsent() {
|
|
18
|
+
let request = StreamRequest(values: [
|
|
19
|
+
"streamUrl": "https://example.com/whip",
|
|
20
|
+
"streamId": "s-1"
|
|
21
|
+
])
|
|
22
|
+
|
|
23
|
+
XCTAssertNil(request.telemetry)
|
|
24
|
+
XCTAssertNil(request.values["telemetry"])
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
func testForwardsExplicitTrueInValues() {
|
|
28
|
+
let request = StreamRequest(
|
|
29
|
+
streamUrl: "https://example.com/whip",
|
|
30
|
+
streamId: "s-1",
|
|
31
|
+
telemetry: true
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
XCTAssertEqual(request.telemetry, true)
|
|
35
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, true)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
func testInitFromValuesForwardsExplicitTrue() {
|
|
39
|
+
let request = StreamRequest(values: [
|
|
40
|
+
"streamUrl": "https://example.com/whip",
|
|
41
|
+
"streamId": "s-1",
|
|
42
|
+
"telemetry": true
|
|
43
|
+
])
|
|
44
|
+
|
|
45
|
+
XCTAssertEqual(request.telemetry, true)
|
|
46
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, true)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
func testForwardsExplicitFalseInValues() {
|
|
50
|
+
let request = StreamRequest(
|
|
51
|
+
streamUrl: "https://example.com/whip",
|
|
52
|
+
streamId: "s-1",
|
|
53
|
+
telemetry: false
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
XCTAssertEqual(request.telemetry, false)
|
|
57
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, false)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
func testInitFromValuesForwardsExplicitFalse() {
|
|
61
|
+
let request = StreamRequest(values: [
|
|
62
|
+
"streamUrl": "https://example.com/whip",
|
|
63
|
+
"streamId": "s-1",
|
|
64
|
+
"telemetry": false
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
XCTAssertEqual(request.telemetry, false)
|
|
68
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, false)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
func testInitFromValuesAcceptsCompactTlKeyWhenTelemetryAbsent() {
|
|
72
|
+
let request = StreamRequest(values: [
|
|
73
|
+
"streamUrl": "https://example.com/whip",
|
|
74
|
+
"tl": true
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
XCTAssertEqual(request.telemetry, true)
|
|
78
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, true)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
func testInitFromValuesGivesTelemetryPrecedenceOverCompactTl() {
|
|
82
|
+
let request = StreamRequest(values: [
|
|
83
|
+
"streamUrl": "https://example.com/whip",
|
|
84
|
+
"telemetry": false,
|
|
85
|
+
"tl": true
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
XCTAssertEqual(request.telemetry, false)
|
|
89
|
+
XCTAssertEqual(request.values["telemetry"] as? Bool, false)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
func testFullStreamRequestSerializesAllFields() {
|
|
93
|
+
let request = StreamRequest(
|
|
94
|
+
streamUrl: "https://example.com/whip",
|
|
95
|
+
streamId: "stream-123",
|
|
96
|
+
sound: false,
|
|
97
|
+
video: StreamVideoConfig(width: 1280, height: 720, bitrate: 2_000_000, fps: 15),
|
|
98
|
+
audio: StreamAudioConfig(bitrate: 64000, sampleRate: 48000, echoCancellation: true),
|
|
99
|
+
authToken: "bearer-token",
|
|
100
|
+
telemetry: true
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
let values = request.values
|
|
104
|
+
XCTAssertEqual(values["type"] as? String, "start_stream")
|
|
105
|
+
XCTAssertEqual(values["streamUrl"] as? String, "https://example.com/whip")
|
|
106
|
+
XCTAssertEqual(values["streamId"] as? String, "stream-123")
|
|
107
|
+
XCTAssertEqual(values["sound"] as? Bool, false)
|
|
108
|
+
XCTAssertEqual(values["authToken"] as? String, "bearer-token")
|
|
109
|
+
XCTAssertEqual(values["telemetry"] as? Bool, true)
|
|
110
|
+
XCTAssertNotNil(values["video"])
|
|
111
|
+
XCTAssertNotNil(values["audio"])
|
|
112
|
+
}
|
|
113
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/bluetooth-sdk",
|
|
3
|
-
"version": "3.2.0-dev.
|
|
3
|
+
"version": "3.2.0-dev.259",
|
|
4
4
|
"description": "SDK for communicating with smart glasses",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"registry": "https://registry.npmjs.org/"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@mentra/cloud-protocol": "3.2.0-dev.
|
|
117
|
+
"@mentra/cloud-protocol": "3.2.0-dev.259"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
120
|
"@types/node": "^25.9.3",
|
|
@@ -707,6 +707,8 @@ export type WarmUpCameraParams = {
|
|
|
707
707
|
mfnr?: boolean
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
+
export type StreamDegradationPreference = "MAINTAIN_FRAMERATE" | "MAINTAIN_RESOLUTION" | "BALANCED" | "DISABLED"
|
|
711
|
+
|
|
710
712
|
export type StreamVideoConfig = {
|
|
711
713
|
width?: number
|
|
712
714
|
height?: number
|
|
@@ -716,6 +718,8 @@ export type StreamVideoConfig = {
|
|
|
716
718
|
/** WHIP startup bitrate in bps, clamped to the requested bounds. */
|
|
717
719
|
initialBitrateBps?: number
|
|
718
720
|
fps?: number
|
|
721
|
+
/** WHIP adaptation policy. Omit to keep the glasses' MAINTAIN_FRAMERATE default. */
|
|
722
|
+
degradationPreference?: StreamDegradationPreference
|
|
719
723
|
}
|
|
720
724
|
|
|
721
725
|
export type StreamAudioConfig = {
|
|
@@ -756,6 +760,8 @@ export type StreamStartRequest = {
|
|
|
756
760
|
* TEMPORARY: part of the SoftAP diagnostic trace layer.
|
|
757
761
|
*/
|
|
758
762
|
traceId?: string
|
|
763
|
+
authToken?: string
|
|
764
|
+
telemetry?: boolean
|
|
759
765
|
}
|
|
760
766
|
|
|
761
767
|
export type StreamKeepAliveRequest = {
|
|
@@ -876,6 +882,8 @@ export type StreamResolvedConfig = {
|
|
|
876
882
|
bitrate: number
|
|
877
883
|
/** Resolved capture/encode frame rate. */
|
|
878
884
|
fps: number
|
|
885
|
+
/** Applied WHIP adaptation policy; absent on older firmware and other transports. */
|
|
886
|
+
degradationPreference?: StreamDegradationPreference
|
|
879
887
|
}
|
|
880
888
|
audio?: {
|
|
881
889
|
/** Encoded audio bitrate in bits per second. */
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
} from "../BluetoothSdk.types"
|
|
62
62
|
import {warmUpCameraParamsForNative} from "./cameraRequestPayload"
|
|
63
63
|
import {photoRequestParamsForNative} from "./photoRequestPayload"
|
|
64
|
+
import {streamRequestParamsForNative} from "./streamRequestPayload"
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
67
|
* Private React Native native-module facade.
|
|
@@ -669,5 +670,13 @@ NativeBluetoothSdkModule.warmUpCamera = function (params: WarmUpCameraParams) {
|
|
|
669
670
|
return nativeWarmUpCamera(warmUpCameraParamsForNative(params) as unknown as WarmUpCameraParams)
|
|
670
671
|
}
|
|
671
672
|
|
|
673
|
+
const nativeStartStream = bindNativeMethod<(params: StreamStartRequest) => Promise<StreamStatusEvent>>(
|
|
674
|
+
NativeBluetoothSdkModule as unknown as Record<string, unknown>,
|
|
675
|
+
"startStream",
|
|
676
|
+
)
|
|
677
|
+
NativeBluetoothSdkModule.startStream = function (params: StreamStartRequest) {
|
|
678
|
+
return nativeStartStream(streamRequestParamsForNative(params) as unknown as StreamStartRequest)
|
|
679
|
+
}
|
|
680
|
+
|
|
672
681
|
export default NativeBluetoothSdkModule
|
|
673
682
|
export const BluetoothSdk = NativeBluetoothSdkModule as BluetoothSdkInternalModule
|