MentraOS / mobile /modules /bluetooth-sdk /src /ota-server /MentraOtaServerModule.ts
Anirudh1950's picture
Add files using upload-large-folder tool
b450976 verified
Raw History Blame Contribute Delete
1.13 kB
import {NativeModule, requireNativeModule} from "expo"
import type {MentraOtaServerModuleEvents, OtaServerResult} from "./MentraOtaServer.types"
declare class MentraOtaServerModule extends NativeModule<MentraOtaServerModuleEvents> {
/**
* Serve `manifestJson` at /version.json and `artifactPaths` (sha256 -> local file path)
* at /artifacts/<sha256>. Pass `host` when the caller knows the authoritative local
* address (e.g. from the scoped hotspot network); omit to fall back to interface
* scanning. Returns the URLs to hand to the glasses via ota_start.
*/
startOtaServer(
manifestJson: string,
artifactPaths: Record<string, string>,
host?: string | null,
): Promise<OtaServerResult>
stopOtaServer(): Promise<void>
/** Wait for iPhone Wi-Fi (`en0`) to acquire an address on the glasses gateway subnet. */
waitForWifiAddress(gateway: string, timeoutMs: number): Promise<string>
downloadArtifact(source: string, destination: string): Promise<{statusCode: number; bytesWritten: number}>
}
export default requireNativeModule<MentraOtaServerModule>("MentraOtaServer")