{"version":3,"file":"FuncCard_SetFuncCardMCULength_1.cjs","names":["Request"],"sources":["../../generated/api/FuncCard_SetFuncCardMCULength_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_SetFuncCardMCULength_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      bBroadcast: boolean,\n      mcuLength: number\n    ): Promise<void>;\n    tryFuncCard_SetFuncCardMCULength_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      mcuLength: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetFuncCardMCULength_1<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  bBroadcast: Broadcast,\n  mcuLength: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(mcuLength, AddressMapping.FuncCard_MCUProgramLengthOccupancy);\n  const req = new Request($data, bBroadcast, 'FuncCard_SetFuncCardMCULength_1');\n  req.destination = addr;\n  req.deviceType = 2;\n  req.port = portAddr;\n  req.rcvIndex = funcCardAddr;\n  req.address = AddressMapping.FuncCard_MCUProgramLengthAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetFuncCardMCULength_1 = async function FuncCard_SetFuncCardMCULength_1(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  bBroadcast: boolean,\n  mcuLength: number\n): Promise<void> {\n  const req = createFuncCard_SetFuncCardMCULength_1(\n    addr,\n    portAddr,\n    funcCardAddr,\n    bBroadcast,\n    mcuLength\n  );\n  await this.connection.send(req);\n};\nSession.prototype.tryFuncCard_SetFuncCardMCULength_1 =\n  async function tryFuncCard_SetFuncCardMCULength_1(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    funcCardAddr: number,\n    mcuLength: number\n  ): Promise<ErrorType | null> {\n    const req = createFuncCard_SetFuncCardMCULength_1(\n      addr,\n      portAddr,\n      funcCardAddr,\n      false,\n      mcuLength\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;;AAoBA,SAAwB,sCACtB,MACA,UACA,cACA,YACA,WACoB;CAEpB,MAAM,MAAM,IAAIA,0DADW,YACC,GAAG,YAAY,iCAAiC;CAC5E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,kCAAkC,eAAe,gCAEjE,MACA,UACA,cACA,YACA,WACe;CACf,MAAM,MAAM,sCACV,MACA,UACA,cACA,YACA,SACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,qCAChB,eAAe,mCAEb,MACA,UACA,cACA,WAC2B;CAC3B,MAAM,MAAM,sCACV,MACA,UACA,cACA,OACA,SACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}