{"version":3,"file":"ReadDistributeEthernetPortScannerX.cjs","names":["Request"],"sources":["../../generated/api/ReadDistributeEthernetPortScannerX.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadDistributeEthernetPortScannerX(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      portIndex: number,\n      scannerIndex: number\n    ): Promise<number>;\n    tryReadDistributeEthernetPortScannerX(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      portIndex: number,\n      scannerIndex: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createReadDistributeEthernetPortScannerX(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number,\n  portIndex: number,\n  scannerIndex: number\n): Request {\n  const req = new Request(\n    AddressMapping.DistributeEthernetPortScannerXOccupancy,\n    'ReadDistributeEthernetPortScannerX'\n  );\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributeAddr;\n  req.address =\n    AddressMapping.DistributeEthernetPortOccupancy * portIndex +\n    AddressMapping.DistributeEthernetPortScannerXAddr +\n    (AddressMapping.DistributeEthernetPortScannerXOccupancy +\n      AddressMapping.DistributeEthernetPortScannerYOccupancy) *\n      scannerIndex +\n    AddressMapping.DistributeEthernetPortScannerXOccupancy;\n  return req;\n}\nSession.prototype.ReadDistributeEthernetPortScannerX =\n  async function ReadDistributeEthernetPortScannerX(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    portIndex: number,\n    scannerIndex: number\n  ): Promise<number> {\n    const req = createReadDistributeEthernetPortScannerX(\n      addr,\n      portAddr,\n      distributeAddr,\n      portIndex,\n      scannerIndex\n    );\n    return decodeUIntLE(await this.connection.send(req));\n  };\nSession.prototype.tryReadDistributeEthernetPortScannerX =\n  async function tryReadDistributeEthernetPortScannerX(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    portIndex: number,\n    scannerIndex: number\n  ): Promise<Packet | null> {\n    const req = createReadDistributeEthernetPortScannerX(\n      addr,\n      portAddr,\n      distributeAddr,\n      portIndex,\n      scannerIndex\n    );\n    return this.connection.trySend(req);\n  };\n"],"mappings":";;;;;AAqBA,SAAwB,yCACtB,MACA,UACA,gBACA,WACA,cACS;CACT,MAAM,MAAM,IAAIA,2BAEd,oCACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI,iBAC+C,iCAI/C;CAEJ,OAAO;AACT;AACA,wBAAQ,UAAU,qCAChB,eAAe,mCAEb,MACA,UACA,gBACA,WACA,cACiB;CACjB,MAAM,MAAM,yCACV,MACA,UACA,gBACA,WACA,YACF;CACA,yCAAoB,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACF,wBAAQ,UAAU,wCAChB,eAAe,sCAEb,MACA,UACA,gBACA,WACA,cACwB;CACxB,MAAM,MAAM,yCACV,MACA,UACA,gBACA,WACA,YACF;CACA,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}