{"version":3,"file":"ReadControllerPhysical.mjs","names":[],"sources":["../../generated/api/ReadControllerPhysical.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadControllerPhysical(addr: number): Promise<number>;\n    tryReadControllerPhysical(addr: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadControllerPhysical(addr: number): Request {\n  const req = new Request(AddressMapping.ControllerPhysicalOccupancy, 'ReadControllerPhysical');\n  req.destination = addr;\n  req.address = AddressMapping.ControllerPhysicalAddr;\n  return req;\n}\nSession.prototype.ReadControllerPhysical = async function ReadControllerPhysical(\n  this: Session,\n  addr: number\n): Promise<number> {\n  const req = createReadControllerPhysical(addr);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryReadControllerPhysical = async function tryReadControllerPhysical(\n  this: Session,\n  addr: number\n): Promise<Packet | null> {\n  const req = createReadControllerPhysical(addr);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,6BAA6B,MAAuB;CAC1E,MAAM,MAAM,IAAI,WAAoD,wBAAwB;CAC5F,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,yBAAyB,eAAe,uBAExD,MACiB;CACjB,MAAM,MAAM,6BAA6B,IAAI;CAC7C,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,4BAA4B,eAAe,0BAE3D,MACwB;CACxB,MAAM,MAAM,6BAA6B,IAAI;CAC7C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}