{"version":3,"file":"ReadRtco.cjs","names":["Request"],"sources":["../../generated/api/ReadRtco.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadRtco(addr: number): Promise<Buffer>;\n    tryReadRtco(addr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadRtco(addr: number): Request {\n  const req = new Request(AddressMapping.RtcoOccupancy, 'ReadRtco');\n  req.destination = addr;\n  req.address = AddressMapping.RtcoAddr;\n  return req;\n}\nSession.prototype.ReadRtco = async function ReadRtco(this: Session, addr: number): Promise<Buffer> {\n  const req = createReadRtco(addr);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadRtco = async function tryReadRtco(\n  this: Session,\n  addr: number\n): Promise<Packet | null> {\n  const req = createReadRtco(addr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AASA,SAAwB,eAAe,MAAuB;CAC5D,MAAM,MAAM,IAAIA,2BAAsC,UAAU;CAChE,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,WAAW,eAAe,SAAwB,MAA+B;CACjG,MAAM,MAAM,eAAe,IAAI;CAC/B,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,wBAAQ,UAAU,cAAc,eAAe,YAE7C,MACwB;CACxB,MAAM,MAAM,eAAe,IAAI;CAC/B,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}