getDpDataByMesh(params: Object)

Requires:
DeviceKit≥2.4.0@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
import { device } from '@ray-js/ray';

const { getDpDataByMesh } = device;

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

Description

Fetch DP data of a Mesh sub-device; on success, the success callback has no return body (t.Null), indicating only that the DP read request has been initiated/completed

Parameters

PropertyTypeRequiredDescription
deviceIdstringYesMesh sub-device ID (target device)
YesList of DP IDs to query
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

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

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