{"version":3,"file":"ReadDviWidth.mjs","names":[],"sources":["../../generated/api/ReadDviWidth.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadDviWidth(addr: number, index: number): Promise<number>;\n    tryReadDviWidth(addr: number, index: number): Promise<Packet | null>;\n  }\n}\nexport default function createReadDviWidth(addr: number, index: number): Request {\n  const req = new Request(AddressMapping.DviWidthOccupancy, 'ReadDviWidth');\n  req.destination = addr;\n  req.address = AddressMapping.DviWidthAddr + AddressMapping.DviOccupancy * index;\n  return req;\n}\nSession.prototype.ReadDviWidth = async function ReadDviWidth(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<number> {\n  const req = createReadDviWidth(addr, index);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryReadDviWidth = async function tryReadDviWidth(\n  this: Session,\n  addr: number,\n  index: number\n): Promise<Packet | null> {\n  const req = createReadDviWidth(addr, index);\n  return this.connection.trySend(req);\n};\n"],"mappings":";;;;AASA,SAAwB,mBAAmB,MAAc,OAAwB;CAC/E,MAAM,MAAM,IAAI,WAA0C,cAAc;CACxE,IAAI,cAAc;CAClB,IAAI,yBAAsE;CAC1E,OAAO;AACT;AACA,QAAQ,UAAU,eAAe,eAAe,aAE9C,MACA,OACiB;CACjB,MAAM,MAAM,mBAAmB,MAAM,KAAK;CAC1C,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,kBAAkB,eAAe,gBAEjD,MACA,OACwB;CACxB,MAAM,MAAM,mBAAmB,MAAM,KAAK;CAC1C,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}