{"version":3,"file":"ReadNewPortEnable.cjs","names":["Request"],"sources":["../../generated/api/ReadNewPortEnable.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadNewPortEnable(addr: number, index: number): Promise<number>;\n    tryReadNewPortEnable(addr: number, index: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadNewPortEnable(addr: number, index: number): Request {\n  const req = new Request(AddressMapping.PortEnableOccupancy, 'ReadNewPortEnable');\n  req.destination = addr;\n  req.address =\n    AddressMapping.PortEnableNextAddr +\n    AddressMapping.PortOccupancy * (index - AddressMapping.NewPortOccupancy);\n  return req;\n}\nSession.prototype.ReadNewPortEnable = async function ReadNewPortEnable(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<number> {\n  const req = createReadNewPortEnable(addr, index);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryReadNewPortEnable = async function tryReadNewPortEnable(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<Packet | null> {\n  const req = createReadNewPortEnable(addr, index);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AASA,SAAwB,wBAAwB,MAAc,OAAwB;CACpF,MAAM,MAAM,IAAIA,2BAA4C,mBAAmB;CAC/E,IAAI,cAAc;CAClB,IAAI,0BAE8B;CAClC,OAAO;AACT;AACA,wBAAQ,UAAU,oBAAoB,eAAe,kBAEnD,MACA,OACiB;CACjB,MAAM,MAAM,wBAAwB,MAAM,KAAK;CAC/C,yCAAoB,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,wBAAQ,UAAU,uBAAuB,eAAe,qBAEtD,MACA,OACwB;CACxB,MAAM,MAAM,wBAAwB,MAAM,KAAK;CAC/C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}