{"version":3,"file":"SetScanner_LowGrayCodeTable.cjs","names":["Request"],"sources":["../../generated/api/SetScanner_LowGrayCodeTable.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetScanner_LowGrayCodeTable(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      lowGrayCodeTable: number[] | Buffer\n    ): Promise<void>;\n    trySetScanner_LowGrayCodeTable(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      lowGrayCodeTable: number[] | Buffer\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetScanner_LowGrayCodeTable<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  lowGrayCodeTable: number[] | Buffer\n): Request<Broadcast> {\n  if (lowGrayCodeTable.length !== AddressMapping.LowGrayCodeTableOccupancy)\n    throw new TypeError(`Invalid buffer size: ${lowGrayCodeTable.length}`);\n  const req = new Request(lowGrayCodeTable, bBroadcast, 'SetScanner_LowGrayCodeTable');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.LowGrayCodeTableAddr;\n  return req;\n}\nSession.prototype.SetScanner_LowGrayCodeTable = async function SetScanner_LowGrayCodeTable(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: boolean,\n  lowGrayCodeTable: number[] | Buffer\n): Promise<void> {\n  const req = createSetScanner_LowGrayCodeTable(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    bBroadcast,\n    lowGrayCodeTable\n  );\n  await this.connection.send(req);\n};\nSession.prototype.trySetScanner_LowGrayCodeTable = async function trySetScanner_LowGrayCodeTable(\n  this: Session,\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  lowGrayCodeTable: number[] | Buffer\n): Promise<ErrorType | null> {\n  const req = createSetScanner_LowGrayCodeTable(\n    addr,\n    portAddr,\n    scanBoardAddr,\n    false,\n    lowGrayCodeTable\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;AAoBA,SAAwB,kCACtB,MACA,UACA,eACA,YACA,kBACoB;CACpB,IAAI,iBAAiB,iBACnB,MAAM,IAAI,UAAU,wBAAwB,iBAAiB,QAAQ;CACvE,MAAM,MAAM,IAAIA,wBAAQ,kBAAkB,YAAY,6BAA6B;CACnF,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,8BAA8B,eAAe,4BAE7D,MACA,UACA,eACA,YACA,kBACe;CACf,MAAM,MAAM,kCACV,MACA,UACA,eACA,YACA,gBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,iCAAiC,eAAe,+BAEhE,MACA,UACA,eACA,kBAC2B;CAC3B,MAAM,MAAM,kCACV,MACA,UACA,eACA,OACA,gBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}