From 81b4dc8d6316f0e7b9149dcfd0cbe192a4ae900f Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 1 Feb 2018 12:00:43 +0100 Subject: Expose enabling firmware update in C API Signed-off-by: Szczepan Zalega --- NK_C_API.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'NK_C_API.h') diff --git a/NK_C_API.h b/NK_C_API.h index aa89ece..ba6b7eb 100644 --- a/NK_C_API.h +++ b/NK_C_API.h @@ -474,6 +474,20 @@ extern "C" { NK_C_API int NK_change_update_password(const char* current_update_password, const char* new_update_password); + /** + * Enter update mode. Needs update password. + * When device is in update mode it no longer accepts any HID commands until + * firmware is launched (regardless of being updated or not). + * Smartcard (through CCID interface) and its all volumes are not visible as well. + * Its VID and PID are changed to factory-default to be detected by flashing software. + * Result of this command can be reversed by using 'launch' command. + * For dfu-programmer it would be: 'dfu-programmer at32uc3a3256s launch'. + * Storage only + * @param update_password 20 characters + * @return command processing error code + */ + NK_C_API int NK_enable_firmware_update(const char* update_password); + /** * Get Storage stick status as string. * Storage only -- cgit v1.2.1 From 2df8bb7f9da3231cb5a7153401d524feb7409642 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 1 Feb 2018 12:08:52 +0100 Subject: Add test for enabling firmware update Signed-off-by: Szczepan Zalega --- NK_C_API.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'NK_C_API.h') diff --git a/NK_C_API.h b/NK_C_API.h index ba6b7eb..01290d8 100644 --- a/NK_C_API.h +++ b/NK_C_API.h @@ -479,8 +479,9 @@ extern "C" { * When device is in update mode it no longer accepts any HID commands until * firmware is launched (regardless of being updated or not). * Smartcard (through CCID interface) and its all volumes are not visible as well. - * Its VID and PID are changed to factory-default to be detected by flashing software. - * Result of this command can be reversed by using 'launch' command. + * Its VID and PID are changed to factory-default (03eb:2ff1 Atmel Corp.) + * to be detected by flashing software. Result of this command can be reversed + * by using 'launch' command. * For dfu-programmer it would be: 'dfu-programmer at32uc3a3256s launch'. * Storage only * @param update_password 20 characters -- cgit v1.2.1