@mentra/bluetooth-sdk 3.5.0-dev.1268 → 3.5.0-dev.1271
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/otaserver/MentraOtaServerModule.kt +0 -7
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/ota-server/MentraOtaServerModule.d.ts +0 -2
- package/build/ota-server/MentraOtaServerModule.d.ts.map +1 -1
- package/build/ota-server/MentraOtaServerModule.js.map +1 -1
- package/build/ota-server/MentraOtaServerModule.web.d.ts +0 -1
- package/build/ota-server/MentraOtaServerModule.web.d.ts.map +1 -1
- package/build/ota-server/MentraOtaServerModule.web.js +0 -3
- package/build/ota-server/MentraOtaServerModule.web.js.map +1 -1
- package/build/ota-transport/index.d.ts +0 -1
- package/build/ota-transport/index.d.ts.map +1 -1
- package/build/ota-transport/index.js +0 -1
- package/build/ota-transport/index.js.map +1 -1
- package/ios/LocalIPv4.swift +0 -61
- package/ios/MentraOtaServerModule.swift +0 -16
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
- package/package.json +2 -2
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/ota-server/MentraOtaServerModule.ts +0 -2
- package/src/ota-server/MentraOtaServerModule.web.ts +0 -4
- package/src/ota-transport/index.ts +0 -2
|
@@ -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.5.0"
|
|
6
|
-
const val RELEASE_IDENTITY: String = "3.5.0-dev.
|
|
7
|
-
const val RELEASE_SET_ID: String = "mentra-3.5.0-dev.
|
|
8
|
-
const val SOURCE_COMMIT: String = "
|
|
9
|
-
const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
10
|
-
const val OTA_MANIFEST_SHA256: String = "
|
|
6
|
+
const val RELEASE_IDENTITY: String = "3.5.0-dev.1271"
|
|
7
|
+
const val RELEASE_SET_ID: String = "mentra-3.5.0-dev.1271"
|
|
8
|
+
const val SOURCE_COMMIT: String = "014ea676e74ffe81e6cc88bcbe331cecb7d6cded"
|
|
9
|
+
const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1271.json"
|
|
10
|
+
const val OTA_MANIFEST_SHA256: String = "d223e87ef749ec7efc066d26535fc9eccfcbefc197d4068c47b9c7d0f1538df2"
|
|
11
11
|
}
|
|
@@ -28,13 +28,6 @@ class MentraOtaServerModule : Module() {
|
|
|
28
28
|
stopOtaServerInternal()
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// API parity with iOS. Android hotspot OTA obtains the authoritative address
|
|
32
|
-
// directly from the scoped Network and does not call this fallback.
|
|
33
|
-
AsyncFunction("waitForWifiAddress") { _: String, _: Int ->
|
|
34
|
-
LocalIpv4.bestLocalIpv4Address()
|
|
35
|
-
?: throw IllegalStateException("No Wi-Fi/LAN IPv4 address found for this phone.")
|
|
36
|
-
}
|
|
37
|
-
|
|
38
31
|
OnDestroy {
|
|
39
32
|
closeOtaServerInternal()
|
|
40
33
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"familyBaseVersion": "3.5.0",
|
|
4
|
-
"releaseIdentity": "3.5.0-dev.
|
|
5
|
-
"releaseSetId": "mentra-3.5.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
7
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
8
|
-
"otaManifestSha256": "
|
|
4
|
+
"releaseIdentity": "3.5.0-dev.1271",
|
|
5
|
+
"releaseSetId": "mentra-3.5.0-dev.1271",
|
|
6
|
+
"sourceCommit": "014ea676e74ffe81e6cc88bcbe331cecb7d6cded",
|
|
7
|
+
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1271.json",
|
|
8
|
+
"otaManifestSha256": "d223e87ef749ec7efc066d26535fc9eccfcbefc197d4068c47b9c7d0f1538df2"
|
|
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,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,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.5.0\",\n \"releaseIdentity\": \"3.5.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,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,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.5.0\",\n \"releaseIdentity\": \"3.5.0-dev.1271\",\n \"releaseSetId\": \"mentra-3.5.0-dev.1271\",\n \"sourceCommit\": \"014ea676e74ffe81e6cc88bcbe331cecb7d6cded\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1271.json\",\n \"otaManifestSha256\": \"d223e87ef749ec7efc066d26535fc9eccfcbefc197d4068c47b9c7d0f1538df2\"\n})\n"]}
|
|
@@ -9,8 +9,6 @@ declare class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEv
|
|
|
9
9
|
*/
|
|
10
10
|
startOtaServer(manifestJson: string, artifactPaths: Record<string, string>, host?: string | null): Promise<OtaServerResult>;
|
|
11
11
|
stopOtaServer(): Promise<void>;
|
|
12
|
-
/** Wait for iPhone Wi-Fi (`en0`) to acquire an address on the glasses gateway subnet. */
|
|
13
|
-
waitForWifiAddress(gateway: string, timeoutMs: number): Promise<string>;
|
|
14
12
|
downloadArtifact(source: string, destination: string): Promise<{
|
|
15
13
|
statusCode: number;
|
|
16
14
|
bytesWritten: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraOtaServerModule.d.ts","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAsB,MAAM,MAAM,CAAA;AAEtD,OAAO,KAAK,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEzF,OAAO,OAAO,qBAAsB,SAAQ,YAAY,CAAC,2BAA2B,CAAC;IACnF;;;;;OAKG;IACH,cAAc,CACZ,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GACnB,OAAO,CAAC,eAAe,CAAC;IAC3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAC9B,
|
|
1
|
+
{"version":3,"file":"MentraOtaServerModule.d.ts","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAsB,MAAM,MAAM,CAAA;AAEtD,OAAO,KAAK,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEzF,OAAO,OAAO,qBAAsB,SAAQ,YAAY,CAAC,2BAA2B,CAAC;IACnF;;;;;OAKG;IACH,cAAc,CACZ,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GACnB,OAAO,CAAC,eAAe,CAAC;IAC3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAC9B,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAC,CAAC;CAC3G;;AAED,wBAA4E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraOtaServerModule.js","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,mBAAmB,EAAC,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"MentraOtaServerModule.js","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,mBAAmB,EAAC,MAAM,MAAM,CAAA;AAoBtD,eAAe,mBAAmB,CAAwB,iBAAiB,CAAC,CAAA","sourcesContent":["import {NativeModule, requireNativeModule} from \"expo\"\n\nimport type {MentraOtaServerModuleEvents, OtaServerResult} from \"./MentraOtaServer.types\"\n\ndeclare class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEvents> {\n /**\n * Serve `manifestJson` at /version.json and `artifactPaths` (sha256 -> local file path)\n * at /artifacts/<sha256>. Pass `host` when the caller knows the authoritative local\n * address (e.g. from the scoped hotspot network); omit to fall back to interface\n * scanning. Returns the URLs to hand to the glasses via ota_start.\n */\n startOtaServer(\n manifestJson: string,\n artifactPaths: Record<string, string>,\n host?: string | null,\n ): Promise<OtaServerResult>\n stopOtaServer(): Promise<void>\n downloadArtifact(source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}>\n}\n\nexport default requireNativeModule<MentraOtaServerModule>(\"MentraOtaServer\")\n"]}
|
|
@@ -3,7 +3,6 @@ import type { MentraOtaServerModuleEvents, OtaServerResult } from "./MentraOtaSe
|
|
|
3
3
|
declare class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEvents> {
|
|
4
4
|
startOtaServer(): Promise<OtaServerResult>;
|
|
5
5
|
stopOtaServer(): Promise<void>;
|
|
6
|
-
waitForWifiAddress(): Promise<string>;
|
|
7
6
|
}
|
|
8
7
|
declare const _default: typeof MentraOtaServerModule;
|
|
9
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraOtaServerModule.web.d.ts","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAoB,MAAM,MAAM,CAAA;AAEpD,OAAO,KAAK,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEzF,cAAM,qBAAsB,SAAQ,YAAY,CAAC,2BAA2B,CAAC;IACrE,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC;IAI1C,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"MentraOtaServerModule.web.d.ts","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAoB,MAAM,MAAM,CAAA;AAEpD,OAAO,KAAK,EAAC,2BAA2B,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEzF,cAAM,qBAAsB,SAAQ,YAAY,CAAC,2BAA2B,CAAC;IACrE,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC;IAI1C,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CACrC;;AAED,wBAA0E"}
|
|
@@ -4,9 +4,6 @@ class MentraOtaServerModule extends NativeModule {
|
|
|
4
4
|
throw new Error("The OTA server is only available in native apps.");
|
|
5
5
|
}
|
|
6
6
|
async stopOtaServer() { }
|
|
7
|
-
async waitForWifiAddress() {
|
|
8
|
-
throw new Error("The OTA server is only available in native apps.");
|
|
9
|
-
}
|
|
10
7
|
}
|
|
11
8
|
export default registerWebModule(MentraOtaServerModule, "MentraOtaServer");
|
|
12
9
|
//# sourceMappingURL=MentraOtaServerModule.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraOtaServerModule.web.js","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAA;AAIpD,MAAM,qBAAsB,SAAQ,YAAyC;IAC3E,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,aAAa,KAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"MentraOtaServerModule.web.js","sourceRoot":"","sources":["../../src/ota-server/MentraOtaServerModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAA;AAIpD,MAAM,qBAAsB,SAAQ,YAAyC;IAC3E,KAAK,CAAC,cAAc;QAClB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,aAAa,KAAmB,CAAC;CACxC;AAED,eAAe,iBAAiB,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAA","sourcesContent":["import {NativeModule, registerWebModule} from \"expo\"\n\nimport type {MentraOtaServerModuleEvents, OtaServerResult} from \"./MentraOtaServer.types\"\n\nclass MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEvents> {\n async startOtaServer(): Promise<OtaServerResult> {\n throw new Error(\"The OTA server is only available in native apps.\")\n }\n\n async stopOtaServer(): Promise<void> {}\n}\n\nexport default registerWebModule(MentraOtaServerModule, \"MentraOtaServer\")\n"]}
|
|
@@ -61,7 +61,6 @@ export declare const otaLocalNetwork: Readonly<{
|
|
|
61
61
|
export declare const otaServer: Readonly<{
|
|
62
62
|
start: (manifestJson: string, artifactPaths: Record<string, string>, host?: string | null) => Promise<OtaServerResult>;
|
|
63
63
|
stop: () => Promise<void>;
|
|
64
|
-
waitForWifiAddress: (gateway: string, timeoutMs: number) => Promise<string>;
|
|
65
64
|
downloadArtifact: (source: string, destination: string) => Promise<{
|
|
66
65
|
statusCode: number;
|
|
67
66
|
bytesWritten: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ota-transport/index.ts"],"names":[],"mappings":"AAEA,OAA2B,EAAC,KAAK,kBAAkB,EAAC,MAAM,sCAAsC,CAAA;AAKhG,YAAY,EACV,6BAA6B,EAC7B,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sCAAsC,CAAA;AAE7C,MAAM,MAAM,wBAAwB,GAAG;IAAC,MAAM,IAAI,IAAI,CAAA;CAAC,CAAA;AAEvD,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAA;AAErD,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,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xB,0FAA0F;iCAC/D,kBAAkB,GAAG,IAAI;oBAC9B,MAAM,YAAY,MAAM,KAAG,OAAO,CAAC,yBAAyB,CAAC;yBAKtE,MAAM,OACZ,MAAM,UACH,MAAM,WACL,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QACzB,MAAM,GAAG,IAAI,aACR,MAAM,KAChB,OAAO,CAAC,uBAAuB,CAAC;0BAKtB,MAAM,OACZ,MAAM,eACE,MAAM,WACV,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,uBACV,MAAM,iBACZ,MAAM,KACpB,OAAO,CAAC,6BAA6B,CAAC;wBAIf,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;sBAI1B,OAAO,CAAC,IAAI,CAAC;mCAIJ,CAAC,KAAK,EAAE,+BAA+B,KAAK,IAAI,KAAG,wBAAwB;8BAIhF,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,KAAG,wBAAwB;EAI9F,CAAA;AAEF,qFAAqF;AACrF,eAAO,MAAM,SAAS;0BAEJ,MAAM,iBACL,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAC9B,MAAM,GAAG,IAAI,KACnB,OAAO,CAAC,eAAe,CAAC;gBACjB,OAAO,CAAC,IAAI,CAAC;+BACI,MAAM,eAAe,MAAM,KAAG,OAAO,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAC,CAAC;2CAErE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,KAAG,wBAAwB;EAE9G,CAAA"}
|
|
@@ -53,7 +53,6 @@ export const otaLocalNetwork = Object.freeze({
|
|
|
53
53
|
export const otaServer = Object.freeze({
|
|
54
54
|
start: (manifestJson, artifactPaths, host) => MentraOtaServer.startOtaServer(manifestJson, artifactPaths, host),
|
|
55
55
|
stop: () => MentraOtaServer.stopOtaServer(),
|
|
56
|
-
waitForWifiAddress: (gateway, timeoutMs) => MentraOtaServer.waitForWifiAddress(gateway, timeoutMs),
|
|
57
56
|
downloadArtifact: (source, destination) => MentraOtaServer.downloadArtifact(source, destination),
|
|
58
57
|
onArtifactDownloadProgress: (listener) => MentraOtaServer.addListener("artifactDownloadProgress", listener),
|
|
59
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ota-transport/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,iDAAiD;AACjD,OAAO,kBAA6C,MAAM,sCAAsC,CAAA;AAChG,iDAAiD;AACjD,OAAO,eAAe,MAAM,eAAe,CAAA;AAoD3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,IAAI,IAAI;IACtD,0FAA0F;IAC1F,qBAAqB,EAAE,GAA8B,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,IAAI,IAAI;IAC3G,OAAO,EAAE,KAAK,EAAE,IAAY,EAAE,QAAgB,EAAsC,EAAE;QACpF,IAAI,CAAC,kBAAkB;YAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;QACzG,OAAO,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,EAAE,KAAK,EACZ,SAAiB,EACjB,GAAW,EACX,MAAc,EACd,OAA+B,EAC/B,IAAmB,EACnB,SAAiB,EACiB,EAAE;QACpC,IAAI,CAAC,kBAAkB;YAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;QACzG,OAAO,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IACrF,CAAC;IACD,QAAQ,EAAE,KAAK,EACb,SAAiB,EACjB,GAAW,EACX,WAAmB,EACnB,OAA+B,EAC/B,mBAA2B,EAC3B,a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,CAAC,0BAA0B,EAAE,QAAQ,CAAC;CACpE,CAAC,CAAA","sourcesContent":["// This public adapter is the package-owned boundary over its native implementation.\n// eslint-disable-next-line no-restricted-imports\nimport MentraLocalNetwork, {type NetworkDiagnostics} from \"../_private/MentraLocalNetworkModule\"\n// eslint-disable-next-line no-restricted-imports\nimport MentraOtaServer from \"../ota-server\"\n\n// eslint-disable-next-line no-restricted-imports\nexport type {\n NetworkCapabilitiesDiagnostic,\n NetworkDiagnostics,\n NetworkObservation,\n} from \"../_private/MentraLocalNetworkModule\"\n\nexport type OtaTransportSubscription = {remove(): void}\n\nexport type OtaLocalNetworkConnection = {\n connected: boolean\n ssid: string\n localAddress?: string\n}\n\nexport type OtaLocalNetworkLostEvent = {ssid: string}\n\nexport type OtaLocalNetworkResponse = {\n status: number\n headers: Record<string, string>\n bodyBase64: string\n}\n\nexport type OtaLocalNetworkDownloadResult = {\n statusCode: number\n bytesWritten: number\n headers: Record<string, string>\n}\n\nexport type OtaLocalNetworkDownloadProgress = {\n requestId: string\n bytesWritten: number\n contentLength: number\n statusCode?: number\n headers?: Record<string, string>\n}\n\nexport type OtaArtifactDownloadProgress = {\n destination: string\n bytesWritten: number\n contentLength: number\n}\n\nexport type OtaServerResult = {\n baseUrl: string\n host: string\n manifestUrl: string\n port: number\n}\n\n/**\n * Scoped networking for traffic that must stay on a Mentra Live hotspot while\n * the phone's default route remains on cellular or another Wi-Fi network.\n *\n * The module is optional because iOS uses its system Wi-Fi join flow instead.\n */\nexport const otaLocalNetwork = Object.freeze({\n isAvailable: (): boolean => MentraLocalNetwork != null,\n /** Synchronous local observation; no network I/O, route changes or network identities. */\n getNetworkDiagnostics: (): NetworkDiagnostics | null => MentraLocalNetwork?.getNetworkDiagnostics() ?? null,\n connect: async (ssid: string, password: string): Promise<OtaLocalNetworkConnection> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.connect(ssid, password)\n },\n request: async (\n requestId: string,\n url: string,\n method: string,\n headers: Record<string, string>,\n body: string | null,\n timeoutMs: number,\n ): Promise<OtaLocalNetworkResponse> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.request(requestId, url, method, headers, body, timeoutMs)\n },\n download: async (\n requestId: string,\n url: string,\n destination: string,\n headers: Record<string, string>,\n connectionTimeoutMs: number,\n readTimeoutMs: number,\n ): Promise<OtaLocalNetworkDownloadResult> => {\n if (!MentraLocalNetwork) throw new Error(\"Scoped local networking is not available in this native build\")\n return MentraLocalNetwork.download(requestId, url, destination, headers, connectionTimeoutMs, readTimeoutMs)\n },\n cancel: async (requestId: string): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.cancel(requestId)\n },\n disconnect: async (): Promise<void> => {\n if (!MentraLocalNetwork) return\n await MentraLocalNetwork.disconnect()\n },\n onDownloadProgress: (listener: (event: OtaLocalNetworkDownloadProgress) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"downloadProgress\", listener)\n },\n onNetworkLost: (listener: (event: OtaLocalNetworkLostEvent) => void): OtaTransportSubscription => {\n if (!MentraLocalNetwork) return {remove() {}}\n return MentraLocalNetwork.addListener(\"networkLost\", listener)\n },\n})\n\n/** Native HTTP server and artifact downloader used by the Engine OTA coordinator. */\nexport const otaServer = Object.freeze({\n start: (\n manifestJson: string,\n artifactPaths: Record<string, string>,\n host?: string | null,\n ): Promise<OtaServerResult> => MentraOtaServer.startOtaServer(manifestJson, artifactPaths, host),\n stop: (): Promise<void> => MentraOtaServer.stopOtaServer(),\n downloadArtifact: (source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}> =>\n MentraOtaServer.downloadArtifact(source, destination),\n onArtifactDownloadProgress: (listener: (event: OtaArtifactDownloadProgress) => void): OtaTransportSubscription =>\n MentraOtaServer.addListener(\"artifactDownloadProgress\", listener),\n})\n"]}
|
package/ios/LocalIPv4.swift
CHANGED
|
@@ -5,54 +5,6 @@ import Foundation
|
|
|
5
5
|
/// (photo upload receiver, hotspot-served OTA). Prefers WiFi-ish interfaces carrying RFC1918
|
|
6
6
|
/// addresses — under a glasses-hotspot session en0 holds the 192.168.43.x client address.
|
|
7
7
|
enum LocalIPv4 {
|
|
8
|
-
/// Return the active Wi-Fi address only when it is on the glasses gateway's /24.
|
|
9
|
-
/// iPhone Wi-Fi is `en0`; accepting AWDL, VPN, cellular, or another private
|
|
10
|
-
/// interface can publish an endpoint that the glasses cannot reach.
|
|
11
|
-
static func wifiIPv4Address(matchingGateway gateway: String) -> String? {
|
|
12
|
-
guard let gatewayPrefix = subnet24Prefix(gateway) else {
|
|
13
|
-
return nil
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var interfaces: UnsafeMutablePointer<ifaddrs>?
|
|
17
|
-
guard getifaddrs(&interfaces) == 0, let first = interfaces else {
|
|
18
|
-
return nil
|
|
19
|
-
}
|
|
20
|
-
defer { freeifaddrs(interfaces) }
|
|
21
|
-
|
|
22
|
-
var cursor: UnsafeMutablePointer<ifaddrs>? = first
|
|
23
|
-
while let current = cursor {
|
|
24
|
-
defer { cursor = current.pointee.ifa_next }
|
|
25
|
-
let interface = current.pointee
|
|
26
|
-
guard String(cString: interface.ifa_name) == "en0",
|
|
27
|
-
let addressPointer = interface.ifa_addr,
|
|
28
|
-
addressPointer.pointee.sa_family == UInt8(AF_INET),
|
|
29
|
-
(interface.ifa_flags & UInt32(IFF_UP)) != 0
|
|
30
|
-
else {
|
|
31
|
-
continue
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var address = addressPointer.pointee
|
|
35
|
-
var hostname = [CChar](repeating: 0, count: Int(NI_MAXHOST))
|
|
36
|
-
guard getnameinfo(
|
|
37
|
-
&address,
|
|
38
|
-
socklen_t(address.sa_len),
|
|
39
|
-
&hostname,
|
|
40
|
-
socklen_t(hostname.count),
|
|
41
|
-
nil,
|
|
42
|
-
0,
|
|
43
|
-
NI_NUMERICHOST
|
|
44
|
-
) == 0 else {
|
|
45
|
-
continue
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let ip = String(cString: hostname)
|
|
49
|
-
if subnet24Prefix(ip) == gatewayPrefix {
|
|
50
|
-
return ip
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return nil
|
|
54
|
-
}
|
|
55
|
-
|
|
56
8
|
static func bestLocalIPv4Address() -> String? {
|
|
57
9
|
var interfaces: UnsafeMutablePointer<ifaddrs>?
|
|
58
10
|
guard getifaddrs(&interfaces) == 0, let first = interfaces else {
|
|
@@ -134,17 +86,4 @@ enum LocalIPv4 {
|
|
|
134
86
|
private static func isLinkLocalIPv4(_ ip: String) -> Bool {
|
|
135
87
|
ip.hasPrefix("169.254.")
|
|
136
88
|
}
|
|
137
|
-
|
|
138
|
-
private static func subnet24Prefix(_ ip: String) -> String? {
|
|
139
|
-
let parts = ip.split(separator: ".")
|
|
140
|
-
guard parts.count == 4,
|
|
141
|
-
parts.allSatisfy({ part in
|
|
142
|
-
guard let value = Int(part) else { return false }
|
|
143
|
-
return (0 ... 255).contains(value)
|
|
144
|
-
})
|
|
145
|
-
else {
|
|
146
|
-
return nil
|
|
147
|
-
}
|
|
148
|
-
return parts.prefix(3).joined(separator: ".")
|
|
149
|
-
}
|
|
150
89
|
}
|
|
@@ -31,10 +31,6 @@ public class MentraOtaServerModule: Module {
|
|
|
31
31
|
self.stopOtaServerInternal()
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
AsyncFunction("waitForWifiAddress") { (gateway: String, timeoutMs: Int) -> String in
|
|
35
|
-
try await self.waitForWifiAddress(gateway: gateway, timeoutMs: timeoutMs)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
34
|
AsyncFunction("downloadArtifact") { (source: String, destination: String) in
|
|
39
35
|
try await self.artifactDownloader.download(from: source, to: destination)
|
|
40
36
|
}
|
|
@@ -97,18 +93,6 @@ public class MentraOtaServerModule: Module {
|
|
|
97
93
|
)
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
private func waitForWifiAddress(gateway: String, timeoutMs: Int) async throws -> String {
|
|
101
|
-
let deadline = Date().addingTimeInterval(Double(max(timeoutMs, 0)) / 1000.0)
|
|
102
|
-
repeat {
|
|
103
|
-
if let address = LocalIPv4.wifiIPv4Address(matchingGateway: gateway) {
|
|
104
|
-
return address
|
|
105
|
-
}
|
|
106
|
-
try await Task.sleep(nanoseconds: 250_000_000)
|
|
107
|
-
} while Date() < deadline
|
|
108
|
-
|
|
109
|
-
throw OtaServerModuleError("The iPhone did not join the glasses hotspot subnet.")
|
|
110
|
-
}
|
|
111
|
-
|
|
112
96
|
private func stopOtaServerInternal() {
|
|
113
97
|
serverLock.lock()
|
|
114
98
|
defer { serverLock.unlock() }
|
|
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
|
|
|
16
16
|
/// silently disable it on every pair the app touches.
|
|
17
17
|
static let autoPowerOffEnabled = true
|
|
18
18
|
private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
|
|
19
|
-
private static let swiftPackageSdkVersion = "3.5.0-dev.
|
|
19
|
+
private static let swiftPackageSdkVersion = "3.5.0-dev.1271"
|
|
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.5.0"
|
|
6
|
-
static let releaseIdentity = "3.5.0-dev.
|
|
7
|
-
static let releaseSetId = "mentra-3.5.0-dev.
|
|
8
|
-
static let sourceCommit = "
|
|
9
|
-
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
10
|
-
static let otaManifestSha256 = "
|
|
6
|
+
static let releaseIdentity = "3.5.0-dev.1271"
|
|
7
|
+
static let releaseSetId = "mentra-3.5.0-dev.1271"
|
|
8
|
+
static let sourceCommit = "014ea676e74ffe81e6cc88bcbe331cecb7d6cded"
|
|
9
|
+
static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1271.json"
|
|
10
|
+
static let otaManifestSha256 = "d223e87ef749ec7efc066d26535fc9eccfcbefc197d4068c47b9c7d0f1538df2"
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/bluetooth-sdk",
|
|
3
|
-
"version": "3.5.0-dev.
|
|
3
|
+
"version": "3.5.0-dev.1271",
|
|
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.5.0-dev.
|
|
118
|
+
"@mentra/cloud-protocol": "3.5.0-dev.1271"
|
|
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.5.0",
|
|
15
|
-
"releaseIdentity": "3.5.0-dev.
|
|
16
|
-
"releaseSetId": "mentra-3.5.0-dev.
|
|
17
|
-
"sourceCommit": "
|
|
18
|
-
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.
|
|
19
|
-
"otaManifestSha256": "
|
|
15
|
+
"releaseIdentity": "3.5.0-dev.1271",
|
|
16
|
+
"releaseSetId": "mentra-3.5.0-dev.1271",
|
|
17
|
+
"sourceCommit": "014ea676e74ffe81e6cc88bcbe331cecb7d6cded",
|
|
18
|
+
"otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.5.0/mentra-live-ota-3.5.0-dev.1271.json",
|
|
19
|
+
"otaManifestSha256": "d223e87ef749ec7efc066d26535fc9eccfcbefc197d4068c47b9c7d0f1538df2"
|
|
20
20
|
})
|
|
@@ -15,8 +15,6 @@ declare class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEv
|
|
|
15
15
|
host?: string | null,
|
|
16
16
|
): Promise<OtaServerResult>
|
|
17
17
|
stopOtaServer(): Promise<void>
|
|
18
|
-
/** Wait for iPhone Wi-Fi (`en0`) to acquire an address on the glasses gateway subnet. */
|
|
19
|
-
waitForWifiAddress(gateway: string, timeoutMs: number): Promise<string>
|
|
20
18
|
downloadArtifact(source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}>
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -8,10 +8,6 @@ class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEvents> {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
async stopOtaServer(): Promise<void> {}
|
|
11
|
-
|
|
12
|
-
async waitForWifiAddress(): Promise<string> {
|
|
13
|
-
throw new Error("The OTA server is only available in native apps.")
|
|
14
|
-
}
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
export default registerWebModule(MentraOtaServerModule, "MentraOtaServer")
|
|
@@ -116,8 +116,6 @@ export const otaServer = Object.freeze({
|
|
|
116
116
|
host?: string | null,
|
|
117
117
|
): Promise<OtaServerResult> => MentraOtaServer.startOtaServer(manifestJson, artifactPaths, host),
|
|
118
118
|
stop: (): Promise<void> => MentraOtaServer.stopOtaServer(),
|
|
119
|
-
waitForWifiAddress: (gateway: string, timeoutMs: number): Promise<string> =>
|
|
120
|
-
MentraOtaServer.waitForWifiAddress(gateway, timeoutMs),
|
|
121
119
|
downloadArtifact: (source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}> =>
|
|
122
120
|
MentraOtaServer.downloadArtifact(source, destination),
|
|
123
121
|
onArtifactDownloadProgress: (listener: (event: OtaArtifactDownloadProgress) => void): OtaTransportSubscription =>
|