{"version":3,"file":"FuncCard_SetPowerPortCtrlTotal_1.cjs","names":["Request"],"sources":["../../generated/api/FuncCard_SetPowerPortCtrlTotal_1.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\nimport { PowerOperateTypeEnum } from '../PowerOperateType';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    FuncCard_SetPowerPortCtrlTotal_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      bBroadcast: boolean,\n      operType: PowerOperateTypeEnum\n    ): Promise<void>;\n    tryFuncCard_SetPowerPortCtrlTotal_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      operType: PowerOperateTypeEnum\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetPowerPortCtrlTotal_1<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  bBroadcast: Broadcast,\n  operType: PowerOperateTypeEnum\n): Request<Broadcast> {\n  const $data = encodeUIntLE(operType, AddressMapping.FuncCard_PowerPortCtrlTotalOccupancy);\n  const req = new Request($data, bBroadcast, 'FuncCard_SetPowerPortCtrlTotal_1');\n  req.destination = addr;\n  req.deviceType = 2;\n  req.port = portAddr;\n  req.rcvIndex = funcCardAddr;\n  req.address = AddressMapping.FuncCard_PowerPortCtrlTotalAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetPowerPortCtrlTotal_1 =\n  async function FuncCard_SetPowerPortCtrlTotal_1(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    funcCardAddr: number,\n    bBroadcast: boolean,\n    operType: PowerOperateTypeEnum\n  ): Promise<void> {\n    const req = createFuncCard_SetPowerPortCtrlTotal_1(\n      addr,\n      portAddr,\n      funcCardAddr,\n      bBroadcast,\n      operType\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.tryFuncCard_SetPowerPortCtrlTotal_1 =\n  async function tryFuncCard_SetPowerPortCtrlTotal_1(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    funcCardAddr: number,\n    operType: PowerOperateTypeEnum\n  ): Promise<ErrorType | null> {\n    const req = createFuncCard_SetPowerPortCtrlTotal_1(\n      addr,\n      portAddr,\n      funcCardAddr,\n      false,\n      operType\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;;AAqBA,SAAwB,uCACtB,MACA,UACA,cACA,YACA,UACoB;CAEpB,MAAM,MAAM,IAAIA,0DADW,WACC,GAAG,YAAY,kCAAkC;CAC7E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,mCAChB,eAAe,iCAEb,MACA,UACA,cACA,YACA,UACe;CACf,MAAM,MAAM,uCACV,MACA,UACA,cACA,YACA,QACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,wBAAQ,UAAU,sCAChB,eAAe,oCAEb,MACA,UACA,cACA,UAC2B;CAC3B,MAAM,MAAM,uCACV,MACA,UACA,cACA,OACA,QACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}