• Send PROGRAM to program data to non-volatile memory at the current MTA.

    Parameters

    • handle: string

      Connection handle returned by XcpCreateConnection.

    • numberOfElements: number

      Total elements in this command or block.

    • data: XcpByteInput

      Payload bytes to program (number[], Uint8Array, or Buffer).

    Returns Promise<number[]>

    Raw positive response payload bytes (or empty array for an intermediate block packet).

    If numberOfElements is larger than the elements in data, this starts a master block-mode programming transfer (returns an empty array immediately; follow up with XcpProgramNext). Passing numberOfElements = 0 and empty data signals the end of programming.

    If data exceeds MAX_CTO or violates alignment, the slave replies with ERR, or the request times out.