{"version":3,"file":"FuncCard_ReadPowerPortCtrl_1.cjs","names":["Request"],"sources":["../../generated/api/FuncCard_ReadPowerPortCtrl_1.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    FuncCard_ReadPowerPortCtrl_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      powerIndex: number\n    ): Promise<number>;\n    tryFuncCard_ReadPowerPortCtrl_1(\n      addr: number,\n      portAddr: number,\n      funcCardAddr: number,\n      powerIndex: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createFuncCard_ReadPowerPortCtrl_1(\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  powerIndex: number\n): Request {\n  const req = new Request(\n    AddressMapping.FuncCard_PowerPortCtrlOccupancy,\n    'FuncCard_ReadPowerPortCtrl_1'\n  );\n  req.destination = addr;\n  req.deviceType = 2;\n  req.port = portAddr;\n  req.rcvIndex = funcCardAddr;\n  req.address =\n    AddressMapping.FuncCard_PowerPortCtrlAddr +\n    powerIndex * AddressMapping.FuncCard_PowerPortCtrlOccupancy;\n  return req;\n}\nSession.prototype.FuncCard_ReadPowerPortCtrl_1 = async function FuncCard_ReadPowerPortCtrl_1(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  powerIndex: number\n): Promise<number> {\n  const req = createFuncCard_ReadPowerPortCtrl_1(addr, portAddr, funcCardAddr, powerIndex);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryFuncCard_ReadPowerPortCtrl_1 = async function tryFuncCard_ReadPowerPortCtrl_1(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  funcCardAddr: number,\n  powerIndex: number\n): Promise<Packet | null> {\n  const req = createFuncCard_ReadPowerPortCtrl_1(addr, portAddr, funcCardAddr, powerIndex);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AAmBA,SAAwB,mCACtB,MACA,UACA,cACA,YACS;CACT,MAAM,MAAM,IAAIA,2BAEd,8BACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI,qBAEF;CACF,OAAO;AACT;AACA,wBAAQ,UAAU,+BAA+B,eAAe,6BAE9D,MACA,UACA,cACA,YACiB;CACjB,MAAM,MAAM,mCAAmC,MAAM,UAAU,cAAc,UAAU;CACvF,yCAAoB,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,wBAAQ,UAAU,kCAAkC,eAAe,gCAEjE,MACA,UACA,cACA,YACwB;CACxB,MAAM,MAAM,mCAAmC,MAAM,UAAU,cAAc,UAAU;CACvF,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}