{"version":3,"file":"FuncCard_SetFuncCardFPGALength.mjs","names":[],"sources":["../../generated/api/FuncCard_SetFuncCardFPGALength.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    FuncCard_SetFuncCardFPGALength(\n      addr: number,\n      bBroadcast: boolean,\n      fpgaLength: number\n    ): Promise<void>;\n    tryFuncCard_SetFuncCardFPGALength(addr: number, fpgaLength: number): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetFuncCardFPGALength<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  fpgaLength: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(fpgaLength, AddressMapping.FuncCard_FPGALengthOccupancy);\n  const req = new Request($data, bBroadcast, 'FuncCard_SetFuncCardFPGALength');\n  req.destination = addr;\n  req.address = AddressMapping.FuncCard_FPGALengthAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetFuncCardFPGALength = async function FuncCard_SetFuncCardFPGALength(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  fpgaLength: number\n): Promise<void> {\n  const req = createFuncCard_SetFuncCardFPGALength(addr, bBroadcast, fpgaLength);\n  await this.connection.send(req);\n};\nSession.prototype.tryFuncCard_SetFuncCardFPGALength =\n  async function tryFuncCard_SetFuncCardFPGALength(\n    this: Session,\n    addr: number,\n    fpgaLength: number\n  ): Promise<ErrorType | null> {\n    const req = createFuncCard_SetFuncCardFPGALength(addr, false, fpgaLength);\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;AAaA,SAAwB,qCACtB,MACA,YACA,YACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,aACC,GAAG,YAAY,gCAAgC;CAC3E,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,iCAAiC,eAAe,+BAEhE,MACA,YACA,YACe;CACf,MAAM,MAAM,qCAAqC,MAAM,YAAY,UAAU;CAC7E,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,YAC2B;CAC3B,MAAM,MAAM,qCAAqC,MAAM,OAAO,UAAU;CACxE,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}