{"version":3,"file":"SetCustomGammaConfigInfo.mjs","names":[],"sources":["../../generated/api/SetCustomGammaConfigInfo.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetCustomGammaConfigInfo(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      customGammaConfigInfo: number\n    ): Promise<void>;\n    trySetCustomGammaConfigInfo(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      customGammaConfigInfo: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetCustomGammaConfigInfo<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  customGammaConfigInfo: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(customGammaConfigInfo, AddressMapping.GammaConfigInfoOccupancy);\n  const req = new Request($data, bBroadcast, 'SetCustomGammaConfigInfo');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.CustomGammaConfigInfoAddr;\n  return req;\n}\nSession.prototype.SetCustomGammaConfigInfo = async function SetCustomGammaConfigInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  customGammaConfigInfo: number\n): Promise<void> {\n  const req = createSetCustomGammaConfigInfo(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    customGammaConfigInfo\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetCustomGammaConfigInfo = async function trySetCustomGammaConfigInfo(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  customGammaConfigInfo: number\n): Promise<ErrorType | null> {\n  const req = createSetCustomGammaConfigInfo(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    false,\n    customGammaConfigInfo\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AAoBA,SAAwB,+BACtB,MACA,UACA,eACA,YACA,uBACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,wBACC,GAAG,YAAY,0BAA0B;CACrE,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,2BAA2B,eAAe,yBAE1D,MACA,UACA,eACA,YACA,uBACe;CACf,MAAM,MAAM,+BACV,MACA,UACA,eACA,YACA,qBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,8BAA8B,eAAe,4BAE7D,MACA,UACA,eACA,uBAC2B;CAC3B,MAAM,MAAM,+BACV,MACA,UACA,eACA,OACA,qBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}