{"version":3,"file":"ReadDviHeight.mjs","names":[],"sources":["../../generated/api/ReadDviHeight.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadDviHeight(addr: number, index: number): Promise<number>;\n    tryReadDviHeight(addr: number, index: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadDviHeight(addr: number, index: number): Request {\n  const req = new Request(AddressMapping.DviHeightOccupancy, 'ReadDviHeight');\n  req.destination = addr;\n  req.address = AddressMapping.DviHeightAddr + AddressMapping.DviOccupancy * index;\n  return req;\n}\nSession.prototype.ReadDviHeight = async function ReadDviHeight(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<number> {\n  const req = createReadDviHeight(addr, index);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryReadDviHeight = async function tryReadDviHeight(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<Packet | null> {\n  const req = createReadDviHeight(addr, index);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,oBAAoB,MAAc,OAAwB;CAChF,MAAM,MAAM,IAAI,WAA2C,eAAe;CAC1E,IAAI,cAAc;CAClB,IAAI,yBAAuE;CAC3E,OAAO;AACT;AACA,QAAQ,UAAU,gBAAgB,eAAe,cAE/C,MACA,OACiB;CACjB,MAAM,MAAM,oBAAoB,MAAM,KAAK;CAC3C,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,mBAAmB,eAAe,iBAElD,MACA,OACwB;CACxB,MAAM,MAAM,oBAAoB,MAAM,KAAK;CAC3C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}