{"version":3,"file":"FuncCard_SetOutDevice_2.cjs","names":["Request","makeOutDeviceBytes"],"sources":["../../generated/api/FuncCard_SetOutDevice_2.ts"],"sourcesContent":["import { ErrorType, Request, Session } from '@novastar/codec';\nimport AddressMapping from '../AddressMapping';\nimport { BaudRateTypeEnum } from '../BaudRateType';\nimport makeOutDeviceBytes from '../../lib/common/makeOutDeviceBytes';\n\ndeclare module '@novastar/codec' {\n  interface API {\n    FuncCard_SetOutDevice_2(\n      addr: number,\n      bBroadcast: boolean,\n      outDeviceAddr: number,\n      baudType: BaudRateTypeEnum,\n      otherDeviceProtocol: number[] | Buffer\n    ): Promise<void>;\n    tryFuncCard_SetOutDevice_2(\n      addr: number,\n      outDeviceAddr: number,\n      baudType: BaudRateTypeEnum,\n      otherDeviceProtocol: number[] | Buffer\n    ): Promise<ErrorType | null>;\n  }\n}\nexport default function createFuncCard_SetOutDevice_2<Broadcast extends boolean>(\n  addr: number,\n  bBroadcast: Broadcast,\n  outDeviceAddr: number,\n  baudType: BaudRateTypeEnum,\n  otherDeviceProtocol: number[] | Buffer\n): Request<Broadcast> {\n  const $data = makeOutDeviceBytes(outDeviceAddr, baudType, otherDeviceProtocol);\n  const req = new Request($data, bBroadcast, 'FuncCard_SetOutDevice_2');\n  req.destination = addr;\n  req.address = AddressMapping.FuncCard_WriteOutDeviceAddr;\n  return req;\n}\nSession.prototype.FuncCard_SetOutDevice_2 = async function FuncCard_SetOutDevice_2(\n  this: Session,\n  addr: number,\n  bBroadcast: boolean,\n  outDeviceAddr: number,\n  baudType: BaudRateTypeEnum,\n  otherDeviceProtocol: number[] | Buffer\n): Promise<void> {\n  const req = createFuncCard_SetOutDevice_2(\n    addr,\n    bBroadcast,\n    outDeviceAddr,\n    baudType,\n    otherDeviceProtocol\n  );\n  await this.connection.send(req);\n};\nSession.prototype.tryFuncCard_SetOutDevice_2 = async function tryFuncCard_SetOutDevice_2(\n  this: Session,\n  addr: number,\n  outDeviceAddr: number,\n  baudType: BaudRateTypeEnum,\n  otherDeviceProtocol: number[] | Buffer\n): Promise<ErrorType | null> {\n  const req = createFuncCard_SetOutDevice_2(\n    addr,\n    false,\n    outDeviceAddr,\n    baudType,\n    otherDeviceProtocol\n  );\n  return (await this.connection.trySend(req))?.ack ?? null;\n};\n"],"mappings":";;;;;;AAsBA,SAAwB,8BACtB,MACA,YACA,eACA,UACA,qBACoB;CAEpB,MAAM,MAAM,IAAIA,wBADFC,8CAAmB,eAAe,UAAU,mBAC9B,GAAG,YAAY,yBAAyB;CACpE,IAAI,cAAc;CAClB,IAAI;CACJ,OAAO;AACT;AACA,wBAAQ,UAAU,0BAA0B,eAAe,wBAEzD,MACA,YACA,eACA,UACA,qBACe;CACf,MAAM,MAAM,8BACV,MACA,YACA,eACA,UACA,mBACF;CACA,MAAM,KAAK,WAAW,KAAK,GAAG;AAChC;AACA,wBAAQ,UAAU,6BAA6B,eAAe,2BAE5D,MACA,eACA,UACA,qBAC2B;CAC3B,MAAM,MAAM,8BACV,MACA,OACA,eACA,UACA,mBACF;CACA,QAAQ,MAAM,KAAK,WAAW,QAAQ,GAAG,IAAI,OAAO;AACtD"}