getBTDeviceInfo

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

const { getBTDeviceInfo } = device;

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

方法签名
getBTDeviceInfo(params: )
SDK 最低版本
iOSThingSmartDeviceKitBizBundle
≥ 5.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-devicekit
≥ 5.2.0

描述

获取设备BT信息

参数

属性类型必填说明SDK 最低版本
deviceIdstring是设备模型 deviceId 设备Id—
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)—
success(params: Object) => void否接口调用成功的回调函数—
fail(params: Object) => void否接口调用失败的回调函数—
success 回调参数
属性类型说明DeviceKit 最低版本SDK 最低版本
deviceNamestring设备名称v3.3.0—
isConnectedboolean是否连接v3.3.0—
isBondboolean是否配对v3.3.0—
macstringmacv3.3.0—
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

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

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