onerom-wasm
    Preparing search index...

    Function parse_firmware

    • Parse a firmware image into a [DeviceSummary].

      Accepts a complete .bin, the first 64KB of a flash dump, or an entire flash dump. Handles both pre-v0.7.0 (original) and v0.7.0+ (schema) firmware via Parser::parse_device, and One ROM Lab via LabParser.

      The plugin/ROM list comes from flash. Whenever the parser follows a runtime pointer (into RAM), read_cb is invoked to fetch those bytes on demand — this is what lets the summary report running and mark the active ROM. On a stopped device the runtime magic will not match and the runtime is tolerantly dropped, so the list still parses.

      read_cb is a JS async (addr: number, len: number) => Uint8Array returning exactly len bytes at addr (see [CallbackReader]).

      otp_cb reads the board's OTP (see [JsOtp]). With it the summary has the board's size, from runtime info where One ROM records it and from OTP otherwise, as the CLI reads it. It also has the board type the board is commissioned as. undefined leaves both out.

      Parameters

      • flash: Uint8Array
      • read_cb: Function
      • Optionalotp_cb: Function | null

      Returns Promise<DeviceSummary>