{"version":3,"file":"ReadLicenseInfo.mjs","names":[],"sources":["../../generated/api/ReadLicenseInfo.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadLicenseInfo(addr: number): Promise<Buffer>;\n    tryReadLicenseInfo(addr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadLicenseInfo(addr: number): Request {\n  const req = new Request(AddressMapping.LicenseInfoOccupancy, 'ReadLicenseInfo');\n  req.destination = addr;\n  req.address = AddressMapping.LicenseInfoAddr;\n  return req;\n}\nSession.prototype.ReadLicenseInfo = async function ReadLicenseInfo(\n  this: Session,\n  addr: number\n): Promise<Buffer> {\n  const req = createReadLicenseInfo(addr);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadLicenseInfo = async function tryReadLicenseInfo(\n  this: Session,\n  addr: number\n): Promise<Packet | null> {\n  const req = createReadLicenseInfo(addr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,sBAAsB,MAAuB;CACnE,MAAM,MAAM,IAAI,WAA6C,iBAAiB;CAC9E,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,kBAAkB,eAAe,gBAEjD,MACiB;CACjB,MAAM,MAAM,sBAAsB,IAAI;CACtC,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,QAAQ,UAAU,qBAAqB,eAAe,mBAEpD,MACwB;CACxB,MAAM,MAAM,sBAAsB,IAAI;CACtC,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}