{"version":3,"file":"SetMBI5252ManualReset.cjs","names":["Request"],"sources":["../../generated/api/SetMBI5252ManualReset.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetMBI5252ManualReset(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean\n    ): Promise<void>;\n    trySetMBI5252ManualReset(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetMBI5252ManualReset<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast\n): Request<Broadcast> {\n  const req = new Request([1], bBroadcast, 'SetMBI5252ManualReset');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.MBI5252SetManualResetAddr;\n  return req;\n}\nSession.prototype.SetMBI5252ManualReset = async function SetMBI5252ManualReset(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean\n): Promise<void> {\n  const req = createSetMBI5252ManualReset(addr, portAddr, scanBoardAddr, bBroadcast);\n  await this.connection.send(req);\n};\nSession.prototype.trySetMBI5252ManualReset = async function trySetMBI5252ManualReset(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number\n): Promise<ErrorType | null> {\n  const req = createSetMBI5252ManualReset(addr, portAddr, scanBoardAddr, false);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAkBA,SAAwB,4BACtB,MACA,UACA,eACA,YACoB;CACpB,MAAM,MAAM,IAAIA,wBAAQ,CAAC,CAAC,GAAG,YAAY,uBAAuB;CAChE,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,wBAAwB,eAAe,sBAEvD,MACA,UACA,eACA,YACe;CACf,MAAM,MAAM,4BAA4B,MAAM,UAAU,eAAe,UAAU;CACjF,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,2BAA2B,eAAe,yBAE1D,MACA,UACA,eAC2B;CAC3B,MAAM,MAAM,4BAA4B,MAAM,UAAU,eAAe,KAAK;CAC5E,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}