{"version":3,"file":"ReadUseRecordInfo.cjs","names":["Request"],"sources":["../../generated/api/ReadUseRecordInfo.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadUseRecordInfo(addr: number, offaddr: number): Promise<Buffer>;\n    tryReadUseRecordInfo(addr: number, offaddr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadUseRecordInfo(addr: number, offaddr: number): Request {\n  const req = new Request(AddressMapping.UseRecordInfoOccupancy, 'ReadUseRecordInfo');\n  req.destination = addr;\n  req.address = AddressMapping.UseRecordInfoAddr + offaddr;\n  return req;\n}\nSession.prototype.ReadUseRecordInfo = async function ReadUseRecordInfo(\n  this: Session,\n  addr: number,\n  offaddr: number\n): Promise<Buffer> {\n  const req = createReadUseRecordInfo(addr, offaddr);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadUseRecordInfo = async function tryReadUseRecordInfo(\n  this: Session,\n  addr: number,\n  offaddr: number\n): Promise<Packet | null> {\n  const req = createReadUseRecordInfo(addr, offaddr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AASA,SAAwB,wBAAwB,MAAc,SAA0B;CACtF,MAAM,MAAM,IAAIA,6BAA+C,mBAAmB;CAClF,IAAI,cAAc;CAClB,IAAI,qBAA6C;CACjD,OAAO;AACT;AACA,wBAAQ,UAAU,oBAAoB,eAAe,kBAEnD,MACA,SACiB;CACjB,MAAM,MAAM,wBAAwB,MAAM,OAAO;CACjD,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,wBAAQ,UAAU,uBAAuB,eAAe,qBAEtD,MACA,SACwB;CACxB,MAAM,MAAM,wBAAwB,MAAM,OAAO;CACjD,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}