{"version":3,"file":"Distribute_ReadDistributeModle.mjs","names":[],"sources":["../../generated/api/Distribute_ReadDistributeModle.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    Distribute_ReadDistributeModle(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<number>;\n    tryDistribute_ReadDistributeModle(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createDistribute_ReadDistributeModle(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number\n): Request {\n  const req = new Request(\n    AddressMapping.Distribute_ModleOccupancy,\n    'Distribute_ReadDistributeModle'\n  );\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributeAddr;\n  req.address = AddressMapping.Distribute_ModleAddr;\n  return req;\n}\nSession.prototype.Distribute_ReadDistributeModle = async function Distribute_ReadDistributeModle(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  distributeAddr: number\n): Promise<number> {\n  const req = createDistribute_ReadDistributeModle(addr, portAddr, distributeAddr);\n  return decodeUIntLE(await this.connection.send(req));\n};\nSession.prototype.tryDistribute_ReadDistributeModle =\n  async function tryDistribute_ReadDistributeModle(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number\n  ): Promise<Packet | null> {\n    const req = createDistribute_ReadDistributeModle(addr, portAddr, distributeAddr);\n    return this.connection.trySend(req);\n  };\n"],"mappings":";;;;AAiBA,SAAwB,qCACtB,MACA,UACA,gBACS;CACT,MAAM,MAAM,IAAI,WAEd,gCACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,iCAAiC,eAAe,+BAEhE,MACA,UACA,gBACiB;CACjB,MAAM,MAAM,qCAAqC,MAAM,UAAU,cAAc;CAC/E,OAAO,aAAa,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACA,QAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,UACA,gBACwB;CACxB,MAAM,MAAM,qCAAqC,MAAM,UAAU,cAAc;CAC/E,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}