{"version":3,"file":"SetIrregularScreenDrive.cjs","names":["Request"],"sources":["../../generated/api/SetIrregularScreenDrive.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetIrregularScreenDrive(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      isIrregularScreenDrive: boolean\n    ): Promise<void>;\n    trySetIrregularScreenDrive(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      isIrregularScreenDrive: boolean\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetIrregularScreenDrive<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  isIrregularScreenDrive: boolean\n): Request<Broadcast> {\n  const req = new Request(\n    isIrregularScreenDrive ? [1] : [0],\n    bBroadcast,\n    'SetIrregularScreenDrive'\n  );\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.IrregularScreenDriveAddr;\n  return req;\n}\nSession.prototype.SetIrregularScreenDrive = async function SetIrregularScreenDrive(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  isIrregularScreenDrive: boolean\n): Promise<void> {\n  const req = createSetIrregularScreenDrive(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    isIrregularScreenDrive\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetIrregularScreenDrive = async function trySetIrregularScreenDrive(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  isIrregularScreenDrive: boolean\n): Promise<ErrorType | null> {\n  const req = createSetIrregularScreenDrive(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    false,\n    isIrregularScreenDrive\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,8BACtB,MACA,UACA,eACA,YACA,wBACoB;CACpB,MAAM,MAAM,IAAIA,wBACd,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,GACjC,YACA,yBACF;CACA,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,wBACe;CACf,MAAM,MAAM,8BACV,MACA,UACA,eACA,YACA,sBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACA,UACA,eACA,wBAC2B;CAC3B,MAAM,MAAM,8BACV,MACA,UACA,eACA,OACA,sBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}