diff --git a/apps/manager_app/card_training.c b/apps/manager_app/card_training.c index 6e9fb493..1c2faed2 100644 --- a/apps/manager_app/card_training.c +++ b/apps/manager_app/card_training.c @@ -138,14 +138,14 @@ void manager_card_training(manager_query_t *query) { instruction_scr_init(UI_TEXT_TAP_CARD_TO_TEST, NULL); - check_pairing_result_t pair_result = {false, 0, {0}}; + check_pairing_result_t pair_result = {false, 0, {0}, 0}; manager_train_card_response_t result = MANAGER_TRAIN_CARD_RESPONSE_INIT_ZERO; result.which_response = MANAGER_TRAIN_CARD_RESPONSE_RESULT_TAG; card_error_type_e status = card_check_pairing(&pair_result); if (CARD_OPERATION_SUCCESS != status) { LOG_SWV("%s (%d)\n", __func__, __LINE__); manager_send_error(ERROR_COMMON_ERROR_CARD_ERROR_TAG, - get_card_error_from_nfc_status(status)); + get_card_error_from_nfc_status(pair_result.error_code)); return; } result.result.card_paired = pair_result.is_paired; diff --git a/src/card_operations/check_pairing.c b/src/card_operations/check_pairing.c index 928c3b06..b16cd645 100644 --- a/src/card_operations/check_pairing.c +++ b/src/card_operations/check_pairing.c @@ -141,5 +141,8 @@ card_error_type_e card_check_pairing(check_pairing_result_t *result) { result->is_paired = true; } } + + result->error_code = operation_data.nfc_data.status; + return status; } diff --git a/src/card_operations/check_pairing.h b/src/card_operations/check_pairing.h index b975e1a9..37d37afc 100644 --- a/src/card_operations/check_pairing.h +++ b/src/card_operations/check_pairing.h @@ -31,6 +31,7 @@ typedef struct check_pairing_result { bool is_paired; uint8_t card_number; uint8_t family_id[FAMILY_ID_SIZE]; + uint32_t error_code; } check_pairing_result_t; /*****************************************************************************