Skip to Content
硬件接入基础 API获取设备特性(已废弃)
本页目录

获取设备特性

已废弃,仅 Protocol V1。 Protocol V1 / V2 请用 getDeviceState。Classic / Mini / Touch / Pro 仍可调用本方法;Pro 2 / Neo 会被拒绝。

获取设备特性

读取旧版 Protocol V1 的 features 投影。新代码请读 getDeviceState(payload.identity.deviceId)。

const response = await HardwareSDK.getFeatures(connectId);

此方法读取兼容的 features 投影,不是界面导航或解锁 API;不要依赖它让设备返回主屏幕。

参数

可选通用参数

示例

const response = await HardwareSDK.getFeatures(connectId);

返回结果

{ success: true, payload: { major_version: number, // 主版本号 minor_version: number, // 中间版本号 patch_version: number, // 补丁版本号 bootloader_mode: null, device_id: string, pin_protection: boolean, passphrase_protection: boolean, // 是否启用密码短语 language: string, label: string, // 设备名称 initialized: boolean, // 设备初始化状态 model: string, safety_checks: string, ble_name: string, // 蓝牙名称 ble_ver: string, // 蓝牙固件版本 ble_enable: string, se_enable: boolean, se_ver: string, backup_only: boolean, onekey_version: string, // 固件版本 onekey_serial: string, // 设备序列号 bootloader_version: string, // 引导加载程序版本 } }

错误

{ success: false, payload: { error: string, // 错误消息 code?: string | number // 错误码 } }
最后更新于