{"version":3,"file":"ReadGroupSwapInfo.mjs","names":[],"sources":["../../generated/api/ReadGroupSwapInfo.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadGroupSwapInfo(addr: number, portAddr: number, scanBoardAddr: number): Promise<Buffer>;\n    tryReadGroupSwapInfo(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createReadGroupSwapInfo(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number\n): Request {\n  const req = new Request(AddressMapping.GroupSwapInfoOccupancy, 'ReadGroupSwapInfo');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.GroupSwapInfoAddr;\n  return req;\n}\nSession.prototype.ReadGroupSwapInfo = async function ReadGroupSwapInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number\n): Promise<Buffer> {\n  const req = createReadGroupSwapInfo(addr, portAddr, scanBoardAddr);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadGroupSwapInfo = async function tryReadGroupSwapInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number\n): Promise<Packet | null> {\n  const req = createReadGroupSwapInfo(addr, portAddr, scanBoardAddr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AAaA,SAAwB,wBACtB,MACA,UACA,eACS;CACT,MAAM,MAAM,IAAI,YAA+C,mBAAmB;CAClF,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,oBAAoB,eAAe,kBAEnD,MACA,UACA,eACiB;CACjB,MAAM,MAAM,wBAAwB,MAAM,UAAU,aAAa;CACjE,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,QAAQ,UAAU,uBAAuB,eAAe,qBAEtD,MACA,UACA,eACwB;CACxB,MAAM,MAAM,wBAAwB,MAAM,UAAU,aAAa;CACjE,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}