{"version":3,"file":"ReadExtendModuleConfigInfo.cjs","names":["Request"],"sources":["../../generated/api/ReadExtendModuleConfigInfo.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadExtendModuleConfigInfo(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      readLength: number\n    ): Promise<Buffer>;\n    tryReadExtendModuleConfigInfo(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      readLength: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createReadExtendModuleConfigInfo(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  readLength: number\n): Request {\n  const req = new Request(readLength, 'ReadExtendModuleConfigInfo');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.ModuleConfigInfoAddr;\n  return req;\n}\nSession.prototype.ReadExtendModuleConfigInfo = async function ReadExtendModuleConfigInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  readLength: number\n): Promise<Buffer> {\n  const req = createReadExtendModuleConfigInfo(addr, portAddr, scanBoardAddr, readLength);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadExtendModuleConfigInfo = async function tryReadExtendModuleConfigInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  readLength: number\n): Promise<Packet | null> {\n  const req = createReadExtendModuleConfigInfo(addr, portAddr, scanBoardAddr, readLength);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AAmBA,SAAwB,iCACtB,MACA,UACA,eACA,YACS;CACT,MAAM,MAAM,IAAIA,wBAAQ,YAAY,4BAA4B;CAChE,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACA,UACA,eACA,YACiB;CACjB,MAAM,MAAM,iCAAiC,MAAM,UAAU,eAAe,UAAU;CACtF,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,wBAAQ,UAAU,gCAAgC,eAAe,8BAE/D,MACA,UACA,eACA,YACwB;CACxB,MAAM,MAAM,iCAAiC,MAAM,UAAU,eAAe,UAAU;CACtF,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}