pamoja for TypeScript - v0.1.17
    Preparing search index...

    Class Updater

    A device slots, and the rules applied to what is offered for them.

    Index
    • Creates an updater for a device with slotCount slots of slotCapacity bytes each, trusting anchorPublicKey as the root of every decision about who may update it.

      Parameters

      • vendorId: Buffer
      • classId: Buffer
      • anchorPublicKey: Buffer
      • slotCount: number
      • slotCapacity: number

      Returns Updater

    • get delegation(): Delegation | null

      The delegation this updater currently honours, or null when releases must be signed by the anchor itself.

      Returns Delegation | null

    • get installedSequence(): number

      The highest sequence number the device already holds.

      Returns number

    • get slotCount(): number

      How many slots this device has.

      Returns number

    • Adopts a delegation, so releases signed by the key it names are accepted.

      Parameters

      • envelope: Buffer
      • Optionalnow: number | null

      Returns Delegation

    • Checks a manifest and opens the slot it names for a transfer in pieces.

      Every check that can be made without the image runs here, so a release that is not for this device, would roll it back, or does not fit is refused before a byte of it is accepted. The envelope is remembered until finish, and each call after this one reopens the transfer from what the slot records, which is the same path a device takes after a reset.

      Parameters

      • envelope: Buffer
      • Optionalnow: number | null

      Returns number

    • Confirms the pending image, so it will be run from now on.

      Returns number

    • Finishes an opened image and marks the slot bootable if it matched.

      Returns the slot now holding a staged image.

      Returns number

    • Decides what to run, and records that decision before returning it.

      Call this once per boot, before jumping to an image. A staged image becomes pending here, so a device that resets before confirming reverts on the next call rather than trying a broken image forever.

      Returns Boot

    • Records that a slot already holds a confirmed image at a sequence number.

      This is how a device that shipped with firmware says what it is running, so the rollback rule has something to compare against.

      Parameters

      • slot: number
      • sequence: number

      Returns void

    • Fails the pending image and goes back to the confirmed one.

      Returns number

    • Checks a manifest and stages an image that is already held whole.

      Returns the slot the image was staged into.

      Parameters

      • envelope: Buffer
      • image: Buffer
      • Optionalnow: number | null

      Returns number

    • Takes the next piece of an image opened with begin.

      Parameters

      • chunk: Buffer

      Returns void