目录

检测设备硬件一致性

场景介绍

企业应用通过集成设备硬件一致性检测能力,赋能回收场景的自动化检测。例如:在“以旧换新”活动中,门店人员利用检测类应用调用该能力,对旧机的屏幕、电池及主板等核心硬件进行检测。检测结果直接作为旧机估价与回收决策的关键依据。需注意的是,检测过程要求设备保持联网,以保障数据实时获取与结果准确性。

约束与限制

接口说明

具体API说明详见接口文档。

接口名 描述
getDeviceComponentVerificationDetails(): Promise<DeviceComponentVerificationResult> 获取设备硬件一致性校验结果。使用Promise异步回调。

开发步骤

  1. 导入相关模块。

    import { BusinessError } from "@kit.BasicServicesKit";
    import { deviceDetection } from "@kit.ServiceSupportKit";
  2. 调用DeviceComponentVerificationResult定义设备硬件信息。

    // 创建初始化结果对象
    let result: deviceDetection.DeviceComponentVerificationResult = {
        componentDetails: []
    }
  3. 调用getDeviceComponentVerificationDetails获取设备一致性校验结果。

    try {
        // 接收一致性检测结果
        result = await deviceDetection.getDeviceComponentVerificationDetails();
    } catch (error) {
        // 捕获异常
        const err: BusinessError = error as BusinessError;
        console.error('enter into getDeviceComponentVerificationDetails catch, code is: ' + err.code + ' message is: ' + err.message);
    }