Read device
getFeatures Reads the current capabilities and status of the device, such as firmware version, device ID, Bluetooth information, language, name, security settings, etc. Many chain APIs require device_id, so this method is usually called once after BLE is connected.
const requestResult = await ukeySdk.getFeatures(connectId);
If the device screen stays on another page, calling this method can also return the device to the main interface state.
Inputs
Reference snippet
const requestResult = await ukeySdk.getFeatures(connectId);
Output
{
success: true,
payload: {
major_version: number, // Note: Major version
minor_version: number, // Note: Minor version
patch_version: number, // Note: Patch version
bootloader_mode: null,
device_id: string,
pin_protection: boolean,
passphrase_protection: boolean, // Note: Whether passphrase protection is enabled
language: string,
slot: string, // Note: Device name
initialized: boolean, // Note: Device initialized status
model: string,
safety_checks: string,
ble_name: string, // Note: Bluetooth name
ble_ver: string, // Note: Bluetooth firmware version
ble_enable: string,
se_enable: boolean,
se_ver: string,
backup_only: boolean,
ukey_version: string, // Note: Firmware version
ukey_serial: string, // Note: Device serial number
bootloader_version: string, // Note: Bootloader version
}
}
Issues
{
success: false,
payload: {
error: string, // Error message text
code: number // Error code value
}
}