{"version":3,"file":"Distribute_SetStoreFpgaAppProgram.mjs","names":[],"sources":["../../generated/api/Distribute_SetStoreFpgaAppProgram.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    Distribute_SetStoreFpgaAppProgram(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      bBroadcast: boolean,\n      distributeModle: number\n    ): Promise<void>;\n    tryDistribute_SetStoreFpgaAppProgram(\n      addr: number,\n      portAddr: number,\n      distributeAddr: number,\n      distributeModle: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createDistribute_SetStoreFpgaAppProgram<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  distributeAddr: number,\n  bBroadcast: Broadcast,\n  distributeModle: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(\n    distributeModle,\n    AddressMapping.Distribute_StoreFpgaAppProgramOccupancy\n  );\n  const req = new Request($data, bBroadcast, 'Distribute_SetStoreFpgaAppProgram');\n  req.destination = addr;\n  req.deviceType = 3;\n  req.port = portAddr;\n  req.rcvIndex = distributeAddr;\n  req.address = AddressMapping.Distribute_StoreFpgaAppProgramAddr;\n  return req;\n}\nSession.prototype.Distribute_SetStoreFpgaAppProgram =\n  async function Distribute_SetStoreFpgaAppProgram(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    bBroadcast: boolean,\n    distributeModle: number\n  ): Promise<void> {\n    const req = createDistribute_SetStoreFpgaAppProgram(\n      addr,\n      portAddr,\n      distributeAddr,\n      bBroadcast,\n      distributeModle\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.tryDistribute_SetStoreFpgaAppProgram =\n  async function tryDistribute_SetStoreFpgaAppProgram(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    distributeAddr: number,\n    distributeModle: number\n  ): Promise<ErrorType | null> {\n    const req = createDistribute_SetStoreFpgaAppProgram(\n      addr,\n      portAddr,\n      distributeAddr,\n      false,\n      distributeModle\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;AAoBA,SAAwB,wCACtB,MACA,UACA,gBACA,YACA,iBACoB;CAKpB,MAAM,MAAM,IAAI,QAJF,aACZ,kBAG0B,GAAG,YAAY,mCAAmC;CAC9E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,UACA,gBACA,YACA,iBACe;CACf,MAAM,MAAM,wCACV,MACA,UACA,gBACA,YACA,eACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,QAAQ,UAAU,uCAChB,eAAe,qCAEb,MACA,UACA,gBACA,iBAC2B;CAC3B,MAAM,MAAM,wCACV,MACA,UACA,gBACA,OACA,eACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}