@flux-control/modbus-schema
    Preparing search index...

    Function makeBitfieldParam

    • Bitfield parameter: maps a 16-bit wire word to/from a boolean-flag Schema.Class. Honors arbitrary bit positions (gaps allowed).

      For writable registers, the factory also generates a Patch schema (all-optional booleans over the same keys) and a merge function suitable for read-modify-write semantics — the device keeps the original Schema.Class so its intent constructors (CommandWordFlags.runForward, etc.) survive.

      Pass readOnly: true for monitor registers; the encode path then fails with readOnlyEncodeFailure and patch/merge remain available but unused.

      Type Parameters

      Parameters

      • register: number
      • flagsClass: F
      • bitLayout: Record<keyof InstanceType<F>, number>
      • meta: RegisterMeta
      • Optionalopts: { readOnly?: boolean }

      Returns BitfieldParamEntry<F>