From f035749438373fc37a9b05aa0349c55b1ca0d762 Mon Sep 17 00:00:00 2001 From: Tomasz Marciniak Date: Wed, 25 May 2016 09:01:22 +0200 Subject: [PATCH] [SecureElement] Added fixes for transmit function. [Verification] Code compiles. Related tests pass. Change-Id: I9bfe3acd7a94da866f7e8b928d1225ba3db1920f Signed-off-by: Tomasz Marciniak --- src/secureelement/secureelement_api.js | 3 +-- src/secureelement/secureelement_instance.cc | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/secureelement/secureelement_api.js b/src/secureelement/secureelement_api.js index 09b53b31..ccbcde28 100644 --- a/src/secureelement/secureelement_api.js +++ b/src/secureelement/secureelement_api.js @@ -267,8 +267,7 @@ Channel.prototype.transmit = function() { if ( native_.isFailure(result)) { native_.callIfPossible( args.errorCallback, native_.getErrorObject(result)); } else { - var result_obj = native_.getResultObject(result); - args.successCallback(result_obj.response); + args.successCallback(native_.getResultObject(result)); } } diff --git a/src/secureelement/secureelement_instance.cc b/src/secureelement/secureelement_instance.cc index acd45b5e..3b787161 100644 --- a/src/secureelement/secureelement_instance.cc +++ b/src/secureelement/secureelement_instance.cc @@ -372,15 +372,15 @@ void SecureElementInstance::Transmit( const picojson::value& args, picojson::obj } ReportSuccess( result, response->get()); } catch (const ErrorIO& err) { - LogAndReportError(PlatformResult(ErrorCode::IO_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::IO_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorIllegalState& err) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::INVALID_STATE_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorIllegalParameter& err) { - LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Failed to transmit command."), &response->get()); } catch (const ErrorSecurity& err) { - LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::SECURITY_ERR, "Failed to transmit command."), &response->get()); } catch (const ExceptionBase& err) { - LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR), &response->get()); + LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to transmit command."), &response->get()); } }; -- 2.34.1