{"version":3,"file":"Distribute_SetDistributeFPGALength.cjs","names":["Request"],"sources":["../../generated/api/Distribute_SetDistributeFPGALength.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    Distribute_SetDistributeFPGALength(\n      addr: number,\n      portAddr: number,\n      distributAddr: number,\n      bBroadcast: boolean,\n      fpgaLength: number\n    ): Promise<void>;\n    tryDistribute_SetDistributeFPGALength(\n      addr: number,\n      portAddr: number,\n      distributAddr: number,\n      fpgaLength: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createDistribute_SetDistributeFPGALength<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  distributAddr: number,\n  bBroadcast: Broadcast,\n  fpgaLength: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(fpgaLength, AddressMapping.Distribute_FPGALengthOccupancy);\n  const req = new Request($data, bBroadcast, 'Distribute_SetDistributeFPGALength');\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributAddr;\n  req.address = AddressMapping.Distribute_FPGALengthAddr;\n  return req;\n}\nSession.prototype.Distribute_SetDistributeFPGALength =\n  async function Distribute_SetDistributeFPGALength(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributAddr: number,\n    bBroadcast: boolean,\n    fpgaLength: number\n  ): Promise<void> {\n    const req = createDistribute_SetDistributeFPGALength(\n      addr,\n      portAddr,\n      distributAddr,\n      bBroadcast,\n      fpgaLength\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.tryDistribute_SetDistributeFPGALength =\n  async function tryDistribute_SetDistributeFPGALength(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributAddr: number,\n    fpgaLength: number\n  ): Promise<ErrorType | null> {\n    const req = createDistribute_SetDistributeFPGALength(\n      addr,\n      portAddr,\n      distributAddr,\n      false,\n      fpgaLength\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;;AAoBA,SAAwB,yCACtB,MACA,UACA,eACA,YACA,YACoB;CAEpB,MAAM,MAAM,IAAIA,0DADW,aACC,GAAG,YAAY,oCAAoC;CAC/E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,qCAChB,eAAe,mCAEb,MACA,UACA,eACA,YACA,YACe;CACf,MAAM,MAAM,yCACV,MACA,UACA,eACA,YACA,UACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,wBAAQ,UAAU,wCAChB,eAAe,sCAEb,MACA,UACA,eACA,YAC2B;CAC3B,MAAM,MAAM,yCACV,MACA,UACA,eACA,OACA,UACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}