{"version":3,"file":"Distribute_SetDistributeMCUVersion.cjs","names":["Request"],"sources":["../../generated/api/Distribute_SetDistributeMCUVersion.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    Distribute_SetDistributeMCUVersion(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      bBroadcast: boolean,\n      mcuVersion: number\n    ): Promise<void>;\n    tryDistribute_SetDistributeMCUVersion(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      mcuVersion: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createDistribute_SetDistributeMCUVersion<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number,\n  bBroadcast: Broadcast,\n  mcuVersion: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(mcuVersion, AddressMapping.Distribute_MCUVersionOccupancy);\n  const req = new Request($data, bBroadcast, 'Distribute_SetDistributeMCUVersion');\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributeAddr;\n  req.address = AddressMapping.Distribute_MCUVersionAddr;\n  return req;\n}\nSession.prototype.Distribute_SetDistributeMCUVersion =\n  async function Distribute_SetDistributeMCUVersion(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    bBroadcast: boolean,\n    mcuVersion: number\n  ): Promise<void> {\n    const req = createDistribute_SetDistributeMCUVersion(\n      addr,\n      portAddr,\n      distributeAddr,\n      bBroadcast,\n      mcuVersion\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.tryDistribute_SetDistributeMCUVersion =\n  async function tryDistribute_SetDistributeMCUVersion(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    mcuVersion: number\n  ): Promise<ErrorType | null> {\n    const req = createDistribute_SetDistributeMCUVersion(\n      addr,\n      portAddr,\n      distributeAddr,\n      false,\n      mcuVersion\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;;AAoBA,SAAwB,yCACtB,MACA,UACA,gBACA,YACA,YACoB;CAEpB,MAAM,MAAM,IAAIA,0DADW,aACC,GAAG,YAAY,oCAAoC;CAC/E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,qCAChB,eAAe,mCAEb,MACA,UACA,gBACA,YACA,YACe;CACf,MAAM,MAAM,yCACV,MACA,UACA,gBACA,YACA,UACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,wBAAQ,UAAU,wCAChB,eAAe,sCAEb,MACA,UACA,gBACA,YAC2B;CAC3B,MAAM,MAAM,yCACV,MACA,UACA,gBACA,OACA,UACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}