{"version":3,"file":"FuncCard_ReadPowerPortCtrl.mjs","names":[],"sources":["../../generated/api/FuncCard_ReadPowerPortCtrl.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(addr: number, powerIndex: number): Promise<number>;\n    tryFuncCard_ReadPowerPortCtrl(addr: number, powerIndex: number): Promise<Packet | null>;\n  }\n}\nexport default function createFuncCard_ReadPowerPortCtrl(\n  addr: number,\n  powerIndex: number\n): Request {\n  const req = new Request(\n    AddressMapping.FuncCard_PowerPortCtrlOccupancy,\n    'FuncCard_ReadPowerPortCtrl'\n  );\n  req.destination = addr;\n  req.address =\n    AddressMapping.FuncCard_PowerPortCtrlAddr +\n    powerIndex * AddressMapping.FuncCard_PowerPortCtrlOccupancy;\n  return req;\n}\nSession.prototype.FuncCard_ReadPowerPortCtrl = async function FuncCard_ReadPowerPortCtrl(\n  this: Session,\n  addr: number,\n  powerIndex: number\n): Promise<number> {\n  const req = createFuncCard_ReadPowerPortCtrl(addr, powerIndex);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryFuncCard_ReadPowerPortCtrl = async function tryFuncCard_ReadPowerPortCtrl(\n  this: Session,\n  addr: number,\n  powerIndex: number\n): Promise<Packet | null> {\n  const req = createFuncCard_ReadPowerPortCtrl(addr, powerIndex);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,iCACtB,MACA,YACS;CACT,MAAM,MAAM,IAAI,WAEd,4BACF;CACA,IAAI,cAAc;CAClB,IAAI,qBAEF;CACF,OAAO;AACT;AACA,QAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACA,YACiB;CACjB,MAAM,MAAM,iCAAiC,MAAM,UAAU;CAC7D,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,gCAAgC,eAAe,8BAE/D,MACA,YACwB;CACxB,MAAM,MAAM,iCAAiC,MAAM,UAAU;CAC7D,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}