{"version":3,"file":"ReadEthernetPortScannerXY.cjs","names":["Request"],"sources":["../../generated/api/ReadEthernetPortScannerXY.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadEthernetPortScannerXY(\n      addr: number,\n      portIndex: number,\n      scannerIndex: number\n    ): Promise<Buffer>;\n    tryReadEthernetPortScannerXY(\n      addr: number,\n      portIndex: number,\n      scannerIndex: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createReadEthernetPortScannerXY(\n  addr: number,\n  portIndex: number,\n  scannerIndex: number\n): Request {\n  const req = new Request(\n    AddressMapping.EthernetPortScannerXOccupancy + AddressMapping.EthernetPortScannerYOccupancy,\n    'ReadEthernetPortScannerXY'\n  );\n  req.destination = addr;\n  req.address =\n    AddressMapping.EthernetPortOccupancy * portIndex +\n    AddressMapping.EthernetPortScannerXAddr +\n    (AddressMapping.EthernetPortScannerXOccupancy + AddressMapping.EthernetPortScannerYOccupancy) *\n      scannerIndex;\n  return req;\n}\nSession.prototype.ReadEthernetPortScannerXY = async function ReadEthernetPortScannerXY(\n  this: Session,\n  addr: number,\n  portIndex: number,\n  scannerIndex: number\n): Promise<Buffer> {\n  const req = createReadEthernetPortScannerXY(addr, portIndex, scannerIndex);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadEthernetPortScannerXY = async function tryReadEthernetPortScannerXY(\n  this: Session,\n  addr: number,\n  portIndex: number,\n  scannerIndex: number\n): Promise<Packet | null> {\n  const req = createReadEthernetPortScannerXY(addr, portIndex, scannerIndex);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AAiBA,SAAwB,gCACtB,MACA,WACA,cACS;CACT,MAAM,MAAM,IAAIA,+BAEd,2BACF;CACA,IAAI,cAAc;CAClB,IAAI,iBACqC,iCAGrC;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,4BAA4B,eAAe,0BAE3D,MACA,WACA,cACiB;CACjB,MAAM,MAAM,gCAAgC,MAAM,WAAW,YAAY;CACzE,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,wBAAQ,UAAU,+BAA+B,eAAe,6BAE9D,MACA,WACA,cACwB;CACxB,MAAM,MAAM,gCAAgC,MAAM,WAAW,YAAY;CACzE,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}