{"version":3,"file":"SetDviOffsetY.mjs","names":[],"sources":["../../generated/api/SetDviOffsetY.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetDviOffsetY(\n      addr: number,\n      bBroadcast: boolean,\n      dviOffsetY: number,\n      index: number\n    ): Promise<void>;\n    trySetDviOffsetY(addr: number, dviOffsetY: number, index: number): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetDviOffsetY<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  dviOffsetY: number,\n  index: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(dviOffsetY, AddressMapping.DviOffsetYOccupancy);\n  const req = new Request($data, bBroadcast, 'SetDviOffsetY');\n  req.destination = addr;\n  req.address = AddressMapping.DviOffsetYAddr + AddressMapping.DviOccupancy * index;\n  return req;\n}\nSession.prototype.SetDviOffsetY = async function SetDviOffsetY(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  dviOffsetY: number,\n  index: number\n): Promise<void> {\n  const req = createSetDviOffsetY(addr, bBroadcast, dviOffsetY, index);\n  await this.connection.send(req);\n};\nSession.prototype.trySetDviOffsetY = async function trySetDviOffsetY(\n  this: Session,\n  addr: number,\n  dviOffsetY: number,\n  index: number\n): Promise<ErrorType | null> {\n  const req = createSetDviOffsetY(addr, false, dviOffsetY, index);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AAcA,SAAwB,oBACtB,MACA,YACA,YACA,OACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,aACC,GAAG,YAAY,eAAe;CAC1D,IAAI,cAAc;CAClB,IAAI,yBAAwE;CAC5E,OAAO;AACT;AACA,QAAQ,UAAU,gBAAgB,eAAe,cAE/C,MACA,YACA,YACA,OACe;CACf,MAAM,MAAM,oBAAoB,MAAM,YAAY,YAAY,KAAK;CACnE,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,mBAAmB,eAAe,iBAElD,MACA,YACA,OAC2B;CAC3B,MAAM,MAAM,oBAAoB,MAAM,OAAO,YAAY,KAAK;CAC9D,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}