From bda5bab9646d3abc6e7209618d8e6f26208274a9 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 25 May 2017 13:12:15 +0200 Subject: Catch invalid CRC exception in C API To handle invalid response packets in C API Signed-off-by: Szczepan Zalega --- NK_C_API.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'NK_C_API.cc') diff --git a/NK_C_API.cc b/NK_C_API.cc index 0e3fa1f..209b378 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -76,6 +76,12 @@ uint8_t get_without_result(T func){ catch (LibraryException & libraryException){ NK_last_command_status = libraryException.exception_id(); } + catch (const InvalidCRCReceived &invalidCRCException){ + ;;; + } + catch (const DeviceCommunicationException &deviceException){ + NK_last_command_status = -1; + } return NK_last_command_status; } -- cgit v1.2.1