{"version":3,"file":"SaveBrightDarkLineFixCoefsToFlash.mjs","names":[],"sources":["../../generated/api/SaveBrightDarkLineFixCoefsToFlash.ts"],"sourcesContent":["import { encodeUIntLE, ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SaveBrightDarkLineFixCoefsToFlash(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      bBroadcast: boolean,\n      coefficientStore2SpiFlash: number\n    ): Promise<void>;\n    trySaveBrightDarkLineFixCoefsToFlash(\n      addr: number,\n      portAddr: number,\n      scanBoardAddr: number,\n      coefficientStore2SpiFlash: number\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createSaveBrightDarkLineFixCoefsToFlash<Broadcast extends boolean>(\n  addr: number,\n  portAddr: number,\n  scanBoardAddr: number,\n  bBroadcast: Broadcast,\n  coefficientStore2SpiFlash: number\n): Request<Broadcast> {\n  const $data = encodeUIntLE(\n    coefficientStore2SpiFlash,\n    AddressMapping.CoefficientStore2SpiFlashOccupancy\n  );\n  const req = new Request($data, bBroadcast, 'SaveBrightDarkLineFixCoefsToFlash');\n  req.destination = addr;\n  req.deviceType = 1;\n  req.port = portAddr;\n  req.rcvIndex = scanBoardAddr;\n  req.address = AddressMapping.CoefficientStore2SpiFlashAddr;\n  return req;\n}\nSession.prototype.SaveBrightDarkLineFixCoefsToFlash =\n  async function SaveBrightDarkLineFixCoefsToFlash(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    scanBoardAddr: number,\n    bBroadcast: boolean,\n    coefficientStore2SpiFlash: number\n  ): Promise<void> {\n    const req = createSaveBrightDarkLineFixCoefsToFlash(\n      addr,\n      portAddr,\n      scanBoardAddr,\n      bBroadcast,\n      coefficientStore2SpiFlash\n    );\n    await this.connection.send(req);\n  };\nSession.prototype.trySaveBrightDarkLineFixCoefsToFlash =\n  async function trySaveBrightDarkLineFixCoefsToFlash(\n    this: Session,\n    addr: number,\n    portAddr: number,\n    scanBoardAddr: number,\n    coefficientStore2SpiFlash: number\n  ): Promise<ErrorType | null> {\n    const req = createSaveBrightDarkLineFixCoefsToFlash(\n      addr,\n      portAddr,\n      scanBoardAddr,\n      false,\n      coefficientStore2SpiFlash\n    );\n    return (await this.connection.trySend(req))?.ack ?? null;\n  };\n"],"mappings":";;;;AAoBA,SAAwB,wCACtB,MACA,UACA,eACA,YACA,2BACoB;CAKpB,MAAM,MAAM,IAAI,QAJF,aACZ,4BAG0B,GAAG,YAAY,mCAAmC;CAC9E,IAAI,cAAc;CAClB,IAAI,aAAa;CACjB,IAAI,OAAO;CACX,IAAI,WAAW;CACf,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,oCAChB,eAAe,kCAEb,MACA,UACA,eACA,YACA,2BACe;CACf,MAAM,MAAM,wCACV,MACA,UACA,eACA,YACA,yBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACF,QAAQ,UAAU,uCAChB,eAAe,qCAEb,MACA,UACA,eACA,2BAC2B;CAC3B,MAAM,MAAM,wCACV,MACA,UACA,eACA,OACA,yBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}