aboutsummaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorChristina Quast <chrysh.ng+git@gmail.com>2015-04-09 17:02:17 +0200
committerChristina Quast <chrysh.ng+git@gmail.com>2015-04-09 17:02:17 +0200
commitaab3d7c82b3c9da6eea30e323dc199e00c8eb735 (patch)
tree431b7519ee396c2305e23d55e685b152b9d69739 /firmware
parent6038eebaf7fced2cc8c666582485b1ab800845d6 (diff)
phone.c: Check status val in Callback func
Diffstat (limited to 'firmware')
-rw-r--r--firmware/simtrace_src/phone.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/simtrace_src/phone.c b/firmware/simtrace_src/phone.c
index a8bc896..06a3dec 100644
--- a/firmware/simtrace_src/phone.c
+++ b/firmware/simtrace_src/phone.c
@@ -293,6 +293,11 @@ void Phone_Master_Init( void ) {
void send_ATR(uint8_t *ATR, uint8_t status, uint32_t transferred, uint32_t remaining)
{
uint32_t i;
+
+ if (status != USBD_STATUS_SUCCESS) {
+ TRACE_ERROR("USB err status (%s): %d", __FUNCTION__, status);
+ return;
+ }
PR("Send %x %x .. %x (tr: %d, st: %x)", ATR[0], ATR[1], ATR[transferred-1], transferred, status);
for ( i = 0; i < transferred; i++ ) {
_ISO7816_SendChar(*(ATR++));
@@ -304,6 +309,11 @@ void send_ATR(uint8_t *ATR, uint8_t status, uint32_t transferred, uint32_t remai
void sendResponse( uint8_t *pArg, uint8_t status, uint32_t transferred, uint32_t remaining)
{
uint32_t i;
+
+ if (status != USBD_STATUS_SUCCESS) {
+ TRACE_ERROR("USB err status (%s): %d", __FUNCTION__, status);
+ return;
+ }
PR("sendResp, stat: %X, trnsf: %x, rem: %x\n\r", status, transferred, remaining);
PR("Resp: %x %x %x .. %x", pArg[0], pArg[1], pArg[2], pArg[transferred-1]);