{"version":3,"file":"SetDclkHigh.mjs","names":[],"sources":["../../generated/api/SetDclkHigh.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetDclkHigh(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      dclkHigh: number\n    ): Promise<void>;\n    trySetDclkHigh(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      dclkHigh: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetDclkHigh<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  dclkHigh: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(dclkHigh, AddressMapping.DclkHighOccupancy);\n  const req = new Request($data, bBroadcast, 'SetDclkHigh');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.DclkHighAddr;\n  return req;\n}\nSession.prototype.SetDclkHigh = async function SetDclkHigh(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  dclkHigh: number\n): Promise<void> {\n  const req = createSetDclkHigh(addr, portAddr, scanBoardAddr, bBroadcast, dclkHigh);\n  await this.connection.send(req);\n};\nSession.prototype.trySetDclkHigh = async function trySetDclkHigh(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  dclkHigh: number\n): Promise<ErrorType | null> {\n  const req = createSetDclkHigh(addr, portAddr, scanBoardAddr, false, dclkHigh);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AAoBA,SAAwB,kBACtB,MACA,UACA,eACA,YACA,UACoB;CAEpB,MAAM,MAAM,IAAI,QADF,aAAa,WACC,GAAG,YAAY,aAAa;CACxD,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,cAAc,eAAe,YAE7C,MACA,UACA,eACA,YACA,UACe;CACf,MAAM,MAAM,kBAAkB,MAAM,UAAU,eAAe,YAAY,QAAQ;CACjF,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,iBAAiB,eAAe,eAEhD,MACA,UACA,eACA,UAC2B;CAC3B,MAAM,MAAM,kBAAkB,MAAM,UAAU,eAAe,OAAO,QAAQ;CAC5E,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}