{"version":3,"file":"Distribute_ReadDistributeMCUVersion.mjs","names":[],"sources":["../../generated/api/Distribute_ReadDistributeMCUVersion.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    Distribute_ReadDistributeMCUVersion(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<number>;\n    tryDistribute_ReadDistributeMCUVersion(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createDistribute_ReadDistributeMCUVersion(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number\n): Request {\n  const req = new Request(\n    AddressMapping.Distribute_MCUVersionOccupancy,\n    'Distribute_ReadDistributeMCUVersion'\n  );\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_ReadDistributeMCUVersion =\n  async function Distribute_ReadDistributeMCUVersion(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number\n  ): Promise<number> {\n    const req = createDistribute_ReadDistributeMCUVersion(addr, portAddr, distributeAddr);\n    return decodeUIntLE(await this.connection.send(req));\n  };\nSession.prototype.tryDistribute_ReadDistributeMCUVersion =\n  async function tryDistribute_ReadDistributeMCUVersion(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number\n  ): Promise<Packet | null> {\n    const req = createDistribute_ReadDistributeMCUVersion(addr, portAddr, distributeAddr);\n    return this.connection.trySend(req);\n  };\n"],"mappings":";;;;AAiBA,SAAwB,0CACtB,MACA,UACA,gBACS;CACT,MAAM,MAAM,IAAI,WAEd,qCACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,sCAChB,eAAe,oCAEb,MACA,UACA,gBACiB;CACjB,MAAM,MAAM,0CAA0C,MAAM,UAAU,cAAc;CACpF,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACF,QAAQ,UAAU,yCAChB,eAAe,uCAEb,MACA,UACA,gBACwB;CACxB,MAAM,MAAM,0CAA0C,MAAM,UAAU,cAAc;CACpF,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}