{"version":3,"file":"ReadSenderFunctionInfo.cjs","names":["Request"],"sources":["../../generated/api/ReadSenderFunctionInfo.ts"],"sourcesContent":["import { Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadSenderFunctionInfo(addr: number): Promise<Buffer>;\n    tryReadSenderFunctionInfo(addr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadSenderFunctionInfo(addr: number): Request {\n  const req = new Request(AddressMapping.SenderFunctionOccupancy, 'ReadSenderFunctionInfo');\n  req.destination = addr;\n  req.address = AddressMapping.SenderFunctionAddr;\n  return req;\n}\nSession.prototype.ReadSenderFunctionInfo = async function ReadSenderFunctionInfo(\n  this: Session,\n  addr: number\n): Promise<Buffer> {\n  const req = createReadSenderFunctionInfo(addr);\n  return (await this.connection.send(req)).data;\n};\nSession.prototype.tryReadSenderFunctionInfo = async function tryReadSenderFunctionInfo(\n  this: Session,\n  addr: number\n): Promise<Packet | null> {\n  const req = createReadSenderFunctionInfo(addr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;;AASA,SAAwB,6BAA6B,MAAuB;CAC1E,MAAM,MAAM,IAAIA,4BAAgD,wBAAwB;CACxF,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,yBAAyB,eAAe,uBAExD,MACiB;CACjB,MAAM,MAAM,6BAA6B,IAAI;CAC7C,QAAQ,MAAM,KAAK,WAAW,KAAK,GAAG,GAAG;AAC3C;AACA,wBAAQ,UAAU,4BAA4B,eAAe,0BAE3D,MACwB;CACxB,MAAM,MAAM,6BAA6B,IAAI;CAC7C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}