@mentra/bluetooth-sdk 3.3.0-dev.421 → 3.3.0-dev.423
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/BluetoothSdkModule.kt +0 -7
- package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +3 -17
- package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +0 -11
- package/android/src/main/java/com/mentra/bluetoothsdk/services/Foreground.kt +0 -21
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.kt +31 -213
- package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SerializedGattCallback.kt +2 -13
- package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunkReassembler.java +6 -41
- package/build/BluetoothSdk.types.d.ts +0 -10
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +0 -9
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js +0 -2
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/package.json +2 -2
- package/src/BluetoothSdk.types.ts +0 -10
- package/src/_private/BluetoothSdkModule.ts +0 -13
- package/src/generated/releaseMetadata.ts +5 -5
- package/android/src/main/java/com/mentra/bluetoothsdk/debug/BleEvidenceLog.kt +0 -454
- package/android/src/test/java/com/mentra/bluetoothsdk/WifiScanEvidenceTest.kt +0 -117
- package/android/src/test/java/com/mentra/bluetoothsdk/debug/BleEvidenceLogTest.kt +0 -282
- package/android/src/test/java/com/mentra/bluetoothsdk/sgcs/MentraLiveEvidenceTest.kt +0 -603
- package/android/src/test/java/com/mentra/bluetoothsdk/utils/MessageChunkReassemblerOriginTest.kt +0 -51
- package/build/_private/diagnosticRender.d.ts +0 -12
- package/build/_private/diagnosticRender.d.ts.map +0 -1
- package/build/_private/diagnosticRender.js +0 -27
- package/build/_private/diagnosticRender.js.map +0 -1
- package/src/_private/diagnosticRender.ts +0 -35
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosticRender.d.ts","sourceRoot":"","sources":["../../src/_private/diagnosticRender.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,WAAW,CAAA;AAErE,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,KAClB,OAAO,CAAA;AAKZ;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,UAAU,EAAE,MAAM,GACjB,sBAAsB,CAYxB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** Largest value each surface's evidence can represent (native enforces the same bounds). */
|
|
2
|
-
const MAX_VALUE = { glasses_battery: 100, wifi_scan: 500 };
|
|
3
|
-
/**
|
|
4
|
-
* Wraps the Android-only native render marker. An empty id list is forwarded because it is
|
|
5
|
-
* meaningful: it invalidates the surface's earlier marker. A displayed value the evidence
|
|
6
|
-
* cannot represent (not an integer, or outside the surface's range) is sent as a withdrawal
|
|
7
|
-
* (no ids, null value) rather than dropped or passed through, so an earlier marker never stays
|
|
8
|
-
* attributed to it. Returns false (and does nothing) on other platforms, on native builds
|
|
9
|
-
* without the function, or when the native call throws.
|
|
10
|
-
*/
|
|
11
|
-
export function createReportDiagnosticRender(native, platformOs) {
|
|
12
|
-
const nativeReport = native.reportDiagnosticRender;
|
|
13
|
-
return (surface, eventIds, value) => {
|
|
14
|
-
if (platformOs !== "android" || typeof nativeReport !== "function")
|
|
15
|
-
return false;
|
|
16
|
-
const representable = value == null || (Number.isInteger(value) && value >= 0 && value <= MAX_VALUE[surface]);
|
|
17
|
-
try {
|
|
18
|
-
if (!representable)
|
|
19
|
-
return Boolean(nativeReport.call(native, surface, [], null));
|
|
20
|
-
return Boolean(nativeReport.call(native, surface, eventIds, value ?? null));
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=diagnosticRender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosticRender.js","sourceRoot":"","sources":["../../src/_private/diagnosticRender.ts"],"names":[],"mappings":"AAQA,6FAA6F;AAC7F,MAAM,SAAS,GAA4C,EAAC,eAAe,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAC,CAAA;AAEjG;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAA+B,EAC/B,UAAkB;IAElB,MAAM,YAAY,GAAG,MAAM,CAAC,sBAAsB,CAAA;IAClD,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;QAClC,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,YAAY,KAAK,UAAU;YAAE,OAAO,KAAK,CAAA;QAChF,MAAM,aAAa,GAAG,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAC7G,IAAI,CAAC;YACH,IAAI,CAAC,aAAa;gBAAE,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAA;YAChF,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA;QAC7E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC,CAAA;AACH,CAAC","sourcesContent":["export type DiagnosticRenderSurface = \"glasses_battery\" | \"wifi_scan\"\n\nexport type ReportDiagnosticRender = (\n surface: DiagnosticRenderSurface,\n eventIds: string[],\n value?: number | null,\n) => boolean\n\n/** Largest value each surface's evidence can represent (native enforces the same bounds). */\nconst MAX_VALUE: Record<DiagnosticRenderSurface, number> = {glasses_battery: 100, wifi_scan: 500}\n\n/**\n * Wraps the Android-only native render marker. An empty id list is forwarded because it is\n * meaningful: it invalidates the surface's earlier marker. A displayed value the evidence\n * cannot represent (not an integer, or outside the surface's range) is sent as a withdrawal\n * (no ids, null value) rather than dropped or passed through, so an earlier marker never stays\n * attributed to it. Returns false (and does nothing) on other platforms, on native builds\n * without the function, or when the native call throws.\n */\nexport function createReportDiagnosticRender(\n native: Record<string, unknown>,\n platformOs: string,\n): ReportDiagnosticRender {\n const nativeReport = native.reportDiagnosticRender\n return (surface, eventIds, value) => {\n if (platformOs !== \"android\" || typeof nativeReport !== \"function\") return false\n const representable = value == null || (Number.isInteger(value) && value >= 0 && value <= MAX_VALUE[surface])\n try {\n if (!representable) return Boolean(nativeReport.call(native, surface, [], null))\n return Boolean(nativeReport.call(native, surface, eventIds, value ?? null))\n } catch {\n return false\n }\n }\n}\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type DiagnosticRenderSurface = "glasses_battery" | "wifi_scan"
|
|
2
|
-
|
|
3
|
-
export type ReportDiagnosticRender = (
|
|
4
|
-
surface: DiagnosticRenderSurface,
|
|
5
|
-
eventIds: string[],
|
|
6
|
-
value?: number | null,
|
|
7
|
-
) => boolean
|
|
8
|
-
|
|
9
|
-
/** Largest value each surface's evidence can represent (native enforces the same bounds). */
|
|
10
|
-
const MAX_VALUE: Record<DiagnosticRenderSurface, number> = {glasses_battery: 100, wifi_scan: 500}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Wraps the Android-only native render marker. An empty id list is forwarded because it is
|
|
14
|
-
* meaningful: it invalidates the surface's earlier marker. A displayed value the evidence
|
|
15
|
-
* cannot represent (not an integer, or outside the surface's range) is sent as a withdrawal
|
|
16
|
-
* (no ids, null value) rather than dropped or passed through, so an earlier marker never stays
|
|
17
|
-
* attributed to it. Returns false (and does nothing) on other platforms, on native builds
|
|
18
|
-
* without the function, or when the native call throws.
|
|
19
|
-
*/
|
|
20
|
-
export function createReportDiagnosticRender(
|
|
21
|
-
native: Record<string, unknown>,
|
|
22
|
-
platformOs: string,
|
|
23
|
-
): ReportDiagnosticRender {
|
|
24
|
-
const nativeReport = native.reportDiagnosticRender
|
|
25
|
-
return (surface, eventIds, value) => {
|
|
26
|
-
if (platformOs !== "android" || typeof nativeReport !== "function") return false
|
|
27
|
-
const representable = value == null || (Number.isInteger(value) && value >= 0 && value <= MAX_VALUE[surface])
|
|
28
|
-
try {
|
|
29
|
-
if (!representable) return Boolean(nativeReport.call(native, surface, [], null))
|
|
30
|
-
return Boolean(nativeReport.call(native, surface, eventIds, value ?? null))
|
|
31
|
-
} catch {
|
|
32
|
-
return false
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|