{"version":3,"file":"ReadDistributeReturnFactoryValues.cjs","names":["Request"],"sources":["../../generated/api/ReadDistributeReturnFactoryValues.ts"],"sourcesContent":["import { decodeUIntLE, Packet, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    ReadDistributeReturnFactoryValues(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<number>;\n    tryReadDistributeReturnFactoryValues(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number\n    ): Promise<Packet | null>;\n  }\n}\nexport default function createReadDistributeReturnFactoryValues(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number\n): Request {\n  const req = new Request(\n    AddressMapping.DistributeReturnFactoryOccupancy,\n    'ReadDistributeReturnFactoryValues'\n  );\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributeAddr;\n  req.address = AddressMapping.DistributeReturnFactoryValuesAddr;\n  return req;\n}\nSession.prototype.ReadDistributeReturnFactoryValues =\n  async function ReadDistributeReturnFactoryValues(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number\n  ): Promise<number> {\n    const req = createReadDistributeReturnFactoryValues(addr, portAddr, distributeAddr);\n    return decodeUIntLE(await this.connection.send(req));\n  };\nSession.prototype.tryReadDistributeReturnFactoryValues =\n  async function tryReadDistributeReturnFactoryValues(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number\n  ): Promise<Packet | null> {\n    const req = createReadDistributeReturnFactoryValues(addr, portAddr, distributeAddr);\n    return this.connection.trySend(req);\n  };\n"],"mappings":";;;;;AAiBA,SAAwB,wCACtB,MACA,UACA,gBACS;CACT,MAAM,MAAM,IAAIA,2BAEd,mCACF;CACA,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,UACA,gBACiB;CACjB,MAAM,MAAM,wCAAwC,MAAM,UAAU,cAAc;CAClF,yCAAoB,MAAM,KAAK,WAAW,KAAK,GAAG,CAAC;AACrD;AACF,wBAAQ,UAAU,uCAChB,eAAe,qCAEb,MACA,UACA,gBACwB;CACxB,MAAM,MAAM,wCAAwC,MAAM,UAAU,cAAc;CAClF,OAAO,KAAK,WAAW,QAAQ,GAAG;AACpC"}