Changeset 1134


Ignore:
Timestamp:
01/09/10 08:58:11 (12 years ago)
Author:
alno
Message:

WebIf:

  • Merging revisions 1132-1133 trunk
Location:
branches/monitor-improvement/csctapi
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/csctapi/icc_async.c

    r1126 r1134  
    7373   
    7474    /* Activate ICC */
     75#ifdef SCI_DEV
    7576    if (IFD_Towitoko_ActivateICC (ifd) != IFD_TOWITOKO_OK)
    7677        return ICC_ASYNC_IFD_ERROR;
     78#endif
    7779    /* Reset ICC */
    7880    if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK)
     
    210212}
    211213
     214#ifndef NO_PAR_SWITCH
    212215int ICC_Async_BeginTransmission (ICC_Async * icc)
    213216{
    214217    /* Setup parity for this ICC */
    215 #ifndef NO_PAR_SWITCH
    216218    if (icc->convention == ATR_CONVENTION_INVERSE)
    217219    {
     
    234236        return ICC_ASYNC_IFD_ERROR;
    235237*/ 
    236 #endif
    237     return ICC_ASYNC_OK;
    238 }
     238    return ICC_ASYNC_OK;
     239}
     240
     241int ICC_Async_EndTransmission (ICC_Async * icc)
     242{
     243    /* Restore parity */
     244    if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)
     245        return ICC_ASYNC_IFD_ERROR;     
     246   
     247    return ICC_ASYNC_OK;
     248}
     249#endif
    239250
    240251int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * data)
     
    283294}
    284295
    285 int ICC_Async_EndTransmission (ICC_Async * icc)
    286 {
    287 #ifndef NO_PAR_SWITCH
    288     /* Restore parity */
    289     if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)
    290         return ICC_ASYNC_IFD_ERROR;     
    291 #endif
    292    
    293     return ICC_ASYNC_OK;
    294 }
    295 
    296296ATR * ICC_Async_GetAtr (ICC_Async * icc)
    297297{
     
    307307{
    308308    /* Dectivate ICC */
     309#ifdef SCI_DEV
    309310    if (IFD_Towitoko_DeactivateICC (icc->ifd) != IFD_TOWITOKO_OK)
    310311        return ICC_ASYNC_IFD_ERROR;
     312#endif
    311313   
    312314    /* LED Off */
  • branches/monitor-improvement/csctapi/icc_async.h

    r8 r1134  
    8585
    8686/* Operations */
     87#ifndef NO_PAR_SWITCH
    8788extern int ICC_Async_BeginTransmission (ICC_Async * icc);
     89extern int ICC_Async_EndTransmission (ICC_Async * icc);
     90#endif
    8891extern int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * buffer);
    8992extern int ICC_Async_Receive (ICC_Async * icc, unsigned size, BYTE * buffer);
    90 extern int ICC_Async_EndTransmission (ICC_Async * icc);
    9193
    9294#endif /* _ICC_ASYNC_ */
  • branches/monitor-improvement/csctapi/ifd_towitoko.c

    r1126 r1134  
    455455}
    456456
     457#ifdef SCI_DEV
    457458int IFD_Towitoko_ActivateICC (IFD * ifd)
    458459{
     
    460461        printf ("IFD: Activating card\n");
    461462#endif
    462 #ifdef SCI_DEV
    463463    if(ifd->io->com==RTYP_SCI)
    464464    {
     
    486486    }
    487487    else
    488 #endif
    489488    {
    490489        return IFD_TOWITOKO_OK;
     
    498497#endif
    499498
    500 #ifdef SCI_DEV
    501499    if(ifd->io->com==RTYP_SCI)
    502500    {
     
    518516       
    519517    }
    520 #endif
    521518   
    522519    return IFD_TOWITOKO_OK;
    523520}
     521#endif
    524522
    525523//extern void print_hex_data(unsigned char *data, int len);
  • branches/monitor-improvement/csctapi/ifd_towitoko.h

    r1126 r1134  
    137137
    138138/* General handling of ICC inserted in this IFD */
     139#ifdef SCI_DEV
    139140extern int IFD_Towitoko_ActivateICC (IFD * ifd);
    140141extern int IFD_Towitoko_DeactivateICC (IFD * ifd);
     142#endif
    141143
    142144/* Asynchronous ICC handling functions */
  • branches/monitor-improvement/csctapi/protocol_t0.c

    r885 r1134  
    826826   
    827827    /* Initialise transmission */
     828#ifndef NO_PAR_SWITCH
    828829    if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK)
    829830    {
     
    831832        return PROTOCOL_T0_ICC_ERROR;
    832833    }
     834#endif
    833835   
    834836    /* Send header bytes */
    835837    if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK)
    836838    {
     839#ifndef NO_PAR_SWITCH
    837840        ICC_Async_EndTransmission (t0->icc);
     841#endif
    838842       
    839843        (*rsp) = NULL;
     
    984988   
    985989    /* End of transmission */
     990#ifndef NO_PAR_SWITCH
    986991    if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK)
    987992        return PROTOCOL_T0_ICC_ERROR;
     993#endif
    988994   
    989995    return (ret);
     
    10131019   
    10141020    /* Initialise transmission */
     1021#ifndef NO_PAR_SWITCH
    10151022    if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK)
    10161023    {
     
    10181025        return PROTOCOL_T14_ICC_ERROR;
    10191026    }
     1027#endif
    10201028   
    10211029    if(t14->icc->ifd->io->com!=RTYP_SCI)
     
    10241032        if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK)
    10251033        {
     1034#ifndef NO_PAR_SWITCH
    10261035            ICC_Async_EndTransmission (t14->icc);
     1036#endif
    10271037           
    10281038            (*rsp) = NULL;
     
    10331043        if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK)
    10341044        {
     1045#ifndef NO_PAR_SWITCH
    10351046            ICC_Async_EndTransmission (t14->icc);
     1047#endif
    10361048           
    10371049            (*rsp) = NULL;
     
    10421054        if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK)
    10431055        {
     1056#ifndef NO_PAR_SWITCH
    10441057            ICC_Async_EndTransmission (t14->icc);
     1058#endif
    10451059           
    10461060            (*rsp) = NULL;
     
    10571071        if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK)
    10581072        {
     1073#ifndef NO_PAR_SWITCH
    10591074            ICC_Async_EndTransmission (t14->icc);
     1075#endif
    10601076           
    10611077            (*rsp) = NULL;
     
    11461162   
    11471163    /* End of transmission */
     1164#ifndef NO_PAR_SWITCH
    11481165    if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK)
    11491166        return PROTOCOL_T14_ICC_ERROR;
     1167#endif
    11501168   
    11511169    return (ret);
  • branches/monitor-improvement/csctapi/protocol_t1.c

    r1126 r1134  
    419419
    420420  /* Setup transmission */
     421#ifndef NO_PAR_SWITCH
    421422  if (ICC_Async_BeginTransmission (t1->icc) != ICC_ASYNC_OK)
    422423    ret = PROTOCOL_T1_ICC_ERROR;
    423424
    424425  else
     426#endif
    425427    {
    426428      /* Send T=1 block */
     
    430432      if (ICC_Async_Transmit (t1->icc, length, buffer) != ICC_ASYNC_OK)
    431433        {
     434#ifndef NO_PAR_SWITCH
    432435          ICC_Async_EndTransmission (t1->icc);
     436#endif
    433437          ret = PROTOCOL_T1_ICC_ERROR;
    434438        }
     
    486490
    487491  /* End of transmission */
     492#ifndef NO_PAR_SWITCH
    488493  if (ICC_Async_EndTransmission (t1->icc) != ICC_ASYNC_OK)
    489494    ret = PROTOCOL_T1_ICC_ERROR;
     495#endif
    490496
    491497  return ret;
Note: See TracChangeset for help on using the changeset viewer.