getDpDataByMesh(params: Object)

版本要求:
DeviceKit≥2.4.0@ray-js/ray≥0.6.23
支持平台:
iOSAndroid
import { device } from '@ray-js/ray';

const { getDpDataByMesh } = device;

// Promise 调用
try {
  const res = await getDpDataByMesh({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

描述

获取 Mesh 子设备的 DP 数据 成功时 success 回调无返回体(t.Null),仅表示 DP 读取请求已发起/完成

参数

属性类型必填说明
deviceIdstring是Mesh 子设备 ID(目标设备)
是待查询的 DP ID 列表
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)
success() => void否接口调用成功的回调函数
fail(params: Object) => void否接口调用失败的回调函数
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

import { device } from '@ray-js/ray'

device.getDpDataByMesh({
  deviceId: "xx",
  dpIds: [],
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});