{"version":3,"file":"SetMBI5252AutoResetTime.cjs","names":["Request"],"sources":["../../generated/api/SetMBI5252AutoResetTime.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetMBI5252AutoResetTime(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      mutiChipRamA: number[] | Buffer\n    ): Promise<void>;\n    trySetMBI5252AutoResetTime(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      mutiChipRamA: number[] | Buffer\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetMBI5252AutoResetTime<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  mutiChipRamA: number[] | Buffer\n): Request<Broadcast> {\n  if (mutiChipRamA.length !== 0) throw new TypeError(`Invalid buffer size: ${mutiChipRamA.length}`);\n  const req = new Request(mutiChipRamA, bBroadcast, 'SetMBI5252AutoResetTime');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.MBI5252SetAutoResetTimeAddr;\n  return req;\n}\nSession.prototype.SetMBI5252AutoResetTime = async function SetMBI5252AutoResetTime(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  mutiChipRamA: number[] | Buffer\n): Promise<void> {\n  const req = createSetMBI5252AutoResetTime(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    mutiChipRamA\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetMBI5252AutoResetTime = async function trySetMBI5252AutoResetTime(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  mutiChipRamA: number[] | Buffer\n): Promise<ErrorType | null> {\n  const req = createSetMBI5252AutoResetTime(addr, portAddr, scanBoardAddr, false, mutiChipRamA);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,8BACtB,MACA,UACA,eACA,YACA,cACoB;CACpB,IAAI,aAAa,WAAW,GAAG,MAAM,IAAI,UAAU,wBAAwB,aAAa,QAAQ;CAChG,MAAM,MAAM,IAAIA,wBAAQ,cAAc,YAAY,yBAAyB;CAC3E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,0BAA0B,eAAe,wBAEzD,MACA,UACA,eACA,YACA,cACe;CACf,MAAM,MAAM,8BACV,MACA,UACA,eACA,YACA,YACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACA,UACA,eACA,cAC2B;CAC3B,MAAM,MAAM,8BAA8B,MAAM,UAAU,eAAe,OAAO,YAAY;CAC5F,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}