{"version":3,"file":"SetMbi5042GrayEnhanced.cjs","names":["Request"],"sources":["../../generated/api/SetMbi5042GrayEnhanced.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetMbi5042GrayEnhanced(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      isEnable: boolean\n    ): Promise<void>;\n    trySetMbi5042GrayEnhanced(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      isEnable: boolean\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetMbi5042GrayEnhanced<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  isEnable: boolean\n): Request<Broadcast> {\n  const req = new Request(isEnable ? [5] : [255], bBroadcast, 'SetMbi5042GrayEnhanced');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.Mbi5042GrayEnhancedAddr;\n  return req;\n}\nSession.prototype.SetMbi5042GrayEnhanced = async function SetMbi5042GrayEnhanced(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  isEnable: boolean\n): Promise<void> {\n  const req = createSetMbi5042GrayEnhanced(addr, portAddr, scanBoardAddr, bBroadcast, isEnable);\n  await this.connection.send(req);\n};\nSession.prototype.trySetMbi5042GrayEnhanced = async function trySetMbi5042GrayEnhanced(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  isEnable: boolean\n): Promise<ErrorType | null> {\n  const req = createSetMbi5042GrayEnhanced(addr, portAddr, scanBoardAddr, false, isEnable);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,6BACtB,MACA,UACA,eACA,YACA,UACoB;CACpB,MAAM,MAAM,IAAIA,wBAAQ,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,wBAAwB;CACpF,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,yBAAyB,eAAe,uBAExD,MACA,UACA,eACA,YACA,UACe;CACf,MAAM,MAAM,6BAA6B,MAAM,UAAU,eAAe,YAAY,QAAQ;CAC5F,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,4BAA4B,eAAe,0BAE3D,MACA,UACA,eACA,UAC2B;CAC3B,MAAM,MAAM,6BAA6B,MAAM,UAAU,eAAe,OAAO,QAAQ;CACvF,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}