このページの内容
機能を取得
非推奨。Protocol V1 のみ。 Protocol V1 と V2 には getDeviceState を使用してください。Classic / Mini / Touch / Pro は引き続きこのメソッドを呼び出せますが、Pro 2 と Neo は拒否します。
デバイスの機能を取得
従来の Protocol V1 の機能情報を読み取ります。新しいコードでは getDeviceState の payload.identity.deviceId を読み取ってください。
const response = await HardwareSDK.getFeatures(connectId);このメソッドは従来の機能情報を読み取ります。画面遷移やロック解除の API として使用せず、デバイスをホーム画面に戻す動作にも依存しないでください。
パラメーター
例
const response = await HardwareSDK.getFeatures(connectId);結果
{
success: true,
payload: {
major_version: number, // major version number
minor_version: number, // middle version number
patch_version: number, // patch version number
bootloader_mode: null,
device_id: string,
pin_protection: boolean,
passphrase_protection: boolean, // enable passphrase
language: string,
label: string, // device name
initialized: boolean, // device initialization status
model: string,
safety_checks: string,
ble_name: string, // bluetooth name
ble_ver: string, // bluetooth firmware version
ble_enable: string,
se_enable: boolean,
se_ver: string,
backup_only: boolean,
onekey_version: string, // firmware Version
onekey_serial: string, // device Serial Number
bootloader_version: string, // bootloader version
}
}エラー
{
success: false,
payload: {
error: string, // error message
code?: string | number // error code
}
}最終更新日