{"version":3,"file":"SetHDEnableEx.mjs","names":[],"sources":["../../generated/api/SetHDEnableEx.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    SetHDEnableEx(addr: number, bBroadcast: boolean, hdEnable: number): Promise<void>;\n    trySetHDEnableEx(addr: number, hdEnable: number): Promise<ErrorType | null>;\n  }\n}\nexport default function createSetHDEnableEx<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  hdEnable: number\n): Request<Broadcast> {\n  const req = new Request([hdEnable], bBroadcast, 'SetHDEnableEx');\n  req.destination = addr;\n  req.address = AddressMapping.HDEnableAddr;\n  return req;\n}\nSession.prototype.SetHDEnableEx = async function SetHDEnableEx(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  hdEnable: number\n): Promise<void> {\n  const req = createSetHDEnableEx(addr, bBroadcast, hdEnable);\n  await this.connection.send(req);\n};\nSession.prototype.trySetHDEnableEx = async function trySetHDEnableEx(\n  this: Session,\n  addr: number,\n  hdEnable: number\n): Promise<ErrorType | null> {\n  const req = createSetHDEnableEx(addr, false, hdEnable);\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;AASA,SAAwB,oBACtB,MACA,YACA,UACoB;CACpB,MAAM,MAAM,IAAI,QAAQ,CAAC,QAAQ,GAAG,YAAY,eAAe;CAC/D,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,QAAQ,UAAU,gBAAgB,eAAe,cAE/C,MACA,YACA,UACe;CACf,MAAM,MAAM,oBAAoB,MAAM,YAAY,QAAQ;CAC1D,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,QAAQ,UAAU,mBAAmB,eAAe,iBAElD,MACA,UAC2B;CAC3B,MAAM,MAAM,oBAAoB,MAAM,OAAO,QAAQ;CACrD,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}