{"version":3,"file":"SetRealDviWidth.mjs","names":[],"sources":["../../generated/api/SetRealDviWidth.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetRealDviWidth(addr: number, bBroadcast: boolean, dviWidth: number): Promise<void>;\n    trySetRealDviWidth(addr: number, dviWidth: number): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetRealDviWidth<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  dviWidth: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(dviWidth, AddressMapping.RealDviWidthOccupancy);\n  const req = new Request($data, bBroadcast, 'SetRealDviWidth');\n  req.destination = addr;\n  req.address = AddressMapping.RealDviWidthAddr;\n  return req;\n}\nSession.prototype.SetRealDviWidth = async function SetRealDviWidth(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  dviWidth: number\n): Promise<void> {\n  const req = createSetRealDviWidth(addr, bBroadcast, dviWidth);\n  await this.connection.send(req);\n};\nSession.prototype.trySetRealDviWidth = async function trySetRealDviWidth(\n  this: Session,\n  addr: number,\n  dviWidth: number\n): Promise<ErrorType | null> {\n  const req = createSetRealDviWidth(addr, false, dviWidth);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AASA,SAAwB,sBACtB,MACA,YACA,UACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,WACC,GAAG,YAAY,iBAAiB;CAC5D,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,kBAAkB,eAAe,gBAEjD,MACA,YACA,UACe;CACf,MAAM,MAAM,sBAAsB,MAAM,YAAY,QAAQ;CAC5D,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,qBAAqB,eAAe,mBAEpD,MACA,UAC2B;CAC3B,MAAM,MAAM,sBAAsB,MAAM,OAAO,QAAQ;CACvD,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}