{"version":3,"file":"FuncCard_SetFuncCardFPGALength_1.mjs","names":[],"sources":["../../generated/api/FuncCard_SetFuncCardFPGALength_1.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_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      bBroadcast: boolean,\n      fpgaLength: number\n    ): Promise<void>;\n    tryFuncCard_SetFuncCardFPGALength_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      fpgaLength: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetFuncCardFPGALength_1<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  funcCardAddr: 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_1');\n  req.destination = addr;\n  req.deviceType = 2;\n  req.port = portAddr;\n  req.rcvIndex = funcCardAddr;\n  req.address = AddressMapping.FuncCard_FPGALengthAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetFuncCardFPGALength_1 =\n  async function FuncCard_SetFuncCardFPGALength_1(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    funcCardAddr: number,\n    bBroadcast: boolean,\n    fpgaLength: number\n  ): Promise<void> {\n    const req = createFuncCard_SetFuncCardFPGALength_1(\n      addr,\n      portAddr,\n      funcCardAddr,\n      bBroadcast,\n      fpgaLength\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.tryFuncCard_SetFuncCardFPGALength_1 =\n  async function tryFuncCard_SetFuncCardFPGALength_1(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    funcCardAddr: number,\n    fpgaLength: number\n  ): Promise<ErrorType | null> {\n    const req = createFuncCard_SetFuncCardFPGALength_1(\n      addr,\n      portAddr,\n      funcCardAddr,\n      false,\n      fpgaLength\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;AAoBA,SAAwB,uCACtB,MACA,UACA,cACA,YACA,YACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,aACC,GAAG,YAAY,kCAAkC;CAC7E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,mCAChB,eAAe,iCAEb,MACA,UACA,cACA,YACA,YACe;CACf,MAAM,MAAM,uCACV,MACA,UACA,cACA,YACA,UACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,QAAQ,UAAU,sCAChB,eAAe,oCAEb,MACA,UACA,cACA,YAC2B;CAC3B,MAAM,MAAM,uCACV,MACA,UACA,cACA,OACA,UACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}