{"version":3,"file":"FuncCard_SetPowerPortCtrlTotal.mjs","names":[],"sources":["../../generated/api/FuncCard_SetPowerPortCtrlTotal.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(\n      addr: number,\n      bBroadcast: boolean,\n      operType: PowerOperateTypeEnum\n    ): Promise<void>;\n    tryFuncCard_SetPowerPortCtrlTotal(\n      addr: number,\n      operType: PowerOperateTypeEnum\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetPowerPortCtrlTotal<Broadcast extends boolean>(\n  addr: 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');\n  req.destination = addr;\n  req.address = AddressMapping.FuncCard_PowerPortCtrlTotalAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetPowerPortCtrlTotal = async function FuncCard_SetPowerPortCtrlTotal(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  operType: PowerOperateTypeEnum\n): Promise<void> {\n  const req = createFuncCard_SetPowerPortCtrlTotal(addr, bBroadcast, operType);\n  await this.connection.send(req);\n};\nSession.prototype.tryFuncCard_SetPowerPortCtrlTotal =\n  async function tryFuncCard_SetPowerPortCtrlTotal(\n    this: Session,\n    addr: number,\n    operType: PowerOperateTypeEnum\n  ): Promise<ErrorType | null> {\n    const req = createFuncCard_SetPowerPortCtrlTotal(addr, false, operType);\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;AAiBA,SAAwB,qCACtB,MACA,YACA,UACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,WACC,GAAG,YAAY,gCAAgC;CAC3E,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,iCAAiC,eAAe,+BAEhE,MACA,YACA,UACe;CACf,MAAM,MAAM,qCAAqC,MAAM,YAAY,QAAQ;CAC3E,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,UAC2B;CAC3B,MAAM,MAAM,qCAAqC,MAAM,OAAO,QAAQ;CACtE,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}