Changeset 430


Ignore:
Timestamp:
09/16/09 19:54:45 (12 years ago)
Author:
rorothetroll
Message:
  • csctapi/pps.c : for some unknown reason (for now) ATR_GetParameter(atr, ATR_PARAMETER_D, &(pps->parameters.d));

sets pps->parameters.d to 0 on viaccess and this totaly breaks on OS X (and may be other system)
so for now we're commenting the PPS_InitICC call as this sets a baudrate of 0 baud ..
here are the debugging output from my tests :

IO: Setting properties: device=/dev/cu.usbserial-FTE4RS78, 9600 bps; 8 bits/byte; None parity; 2 stopbits; dtr=1; rts=0
ICC: Detected inverse convention processor card T=0
PPS: Protocol T=0 selected
PPS: Baudrate = 0
PPS: T=0, F=372, D=0.000000, N=0
Protocol: T=0: WWT=1000
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=5, *cmd={}, *lr=14, rsp={3F 77 18 00 00 C2 47 40 00 68 90 00 90 01 })=0
2009/09/15 21:58:36 4985 r02 Reader: ATR = 3F 77 18 00 00 C2 47 40 00 68 90 00
2009/09/15 21:58:36 4985 r02 Reader: Using optimal bitrate of 9600 bit/s
2009/09/15 21:58:36 4985 r02 CAM: Viaccess detected
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x02, lc=5, *cmd={20 13 00 80 00 }, *lr=260, rsp=[])
IFD: device=/dev/cu.usbserial-FTE4RS78 Status = card / no change
CTAPI: CT_data(ctn=1, *dad=0x01, *sad=0x01, lc=5, *cmd={}, *lr=3, rsp={05 90 00 })=0
CTAPI: CT_data(ctn=1, *dad=0x00, *sad=0x02, lc=8, *cmd={87 02 00 00 03 00 00 28 }, *lr=260, rsp=[])
2009/09/15 21:58:36 4985 r02 CAM: Loading card ...
Protocol: T=0 Case 2 short
IFD: Setting baudrate to 0
IO: Optimal bitrate should be = 0
input_speed = 0
output_speed = 0

we can see that the PPS Baudrate is 0 .. not good.
I added some debug to see what was going on and it looks like the work_etu get a invalid value :

PPS: Protocol T=0 selected
PPS: Baudrate = 0
PPS: Protocol T=0 selected
pps->parameters.f = 372.000000
pps->parameters.d = 0.000000
ICC_Async_GetClockRate(pps->icc) = 3571200
PPS: Baudrate = 0

which is not good, specialy :
pps->parameters.d = 0.000000

as it's used in a division :

work_etu = (1000 * pps->parameters.f) / (pps->parameters.d * ICC_Async_GetClockRate(pps->icc));
So : work_etu = inf
And baudrate = (long unsigned int) (1000 / work_etu);
So 1000/infinit = 0

which is how the baudrate ends up being 0 baud.
this parameter get set by retrieving the values from the ATR using ATR_GetParameter
so I suspect a bug in these function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/merlin/csctapi/pps.c

    r375 r430  
    121121        ATR_GetParameter(atr, ATR_PARAMETER_D, &(pps->parameters.d));
    122122        ATR_GetParameter(atr, ATR_PARAMETER_F, &(pps->parameters.f));
    123 
    124         ret = PPS_InitICC(pps);
    125 
    126         if (ret != PPS_OK)
    127             return ret;
     123       
     124        // for some unknown reason (for now):
     125        // ATR_GetParameter(atr, ATR_PARAMETER_D, &(pps->parameters.d));
     126        // set pps->parameters.d to 0 on viaccess
     127        // this totaly breaks on OS X
     128        // so for now we're commenting the PPS_InitICC call.
     129       
     130        //ret = PPS_InitICC(pps);
     131
     132        //if (ret != PPS_OK)
     133        //  return ret;
    128134#endif
    129135    }
Note: See TracChangeset for help on using the changeset viewer.