Changeset 1268 for branches/monitor-improvement/csctapi/ct_slot.c
- Timestamp:
- 01/17/10 18:02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/csctapi/ct_slot.c
r1257 r1268 25 25 #include "defines.h" 26 26 #include "ct_slot.h" 27 #include "ifd_towitoko.h"28 27 #include "icc_async.h" 29 28 #include "protocol_t0.h" … … 38 37 #endif 39 38 39 /* Card status *///FIXME simplify this + duplicate in icc_async.h 40 #define IFD_TOWITOKO_CARD(status) (((status) & 0x40) == 0x40) 41 #define IFD_TOWITOKO_CHANGE(status) (((status) & 0x80) == 0x80) 42 40 43 /* Try first asynchronous init and if it fails try synchronous */ 41 44 //#undef ICC_PROBE_ASYNC_FIRST … … 66 69 char CT_Slot_Init (CT_Slot * slot, int sn) 67 70 { 68 slot->ifd = IFD_Towitoko_New(); 69 70 if (slot->ifd == NULL) 71 return ERR_MEMORY; 72 73 if (IFD_Towitoko_Init (slot->ifd, sn) != IFD_TOWITOKO_OK) 74 { 75 IFD_Towitoko_Delete (slot->ifd); 76 slot->ifd = NULL; 71 if (!Phoenix_Init()) 77 72 return ERR_TRANS; 78 }79 73 80 74 return OK; … … 133 127 return ERR_MEMORY; 134 128 135 if (ICC_Async_Init (slot->icc , slot->ifd) != ICC_ASYNC_OK)129 if (ICC_Async_Init (slot->icc) != ICC_ASYNC_OK) 136 130 { 137 131 ICC_Async_Delete (slot->icc); … … 303 297 bool CT_Slot_IsLast (CT_Slot * slot) 304 298 { 305 return (IFD_Towitoko_GetSlot(slot->ifd) >= IFD_Towitoko_GetNumSlots()-1); 299 //return (IFD_Towitoko_GetSlot(slot->ifd) >= IFD_Towitoko_GetNumSlots()-1); 300 return 1; //GetSlot always returns 0, and GetNumSlots returns always 1 306 301 } 307 302 308 303 void CT_Slot_GetType (CT_Slot * slot, BYTE * buffer, int len) 309 304 { 310 IFD_Towitoko_GetDescription (slot->ifd, buffer, len); 305 //IFD_Towitoko_GetDescription (slot->ifd, buffer, len) 306 buffer="dummy"; 307 len=5; 311 308 } 312 309 … … 347 344 } 348 345 349 if (slot->ifd != NULL) 350 { 351 if (IFD_Towitoko_Close (slot->ifd) != IFD_TOWITOKO_OK) 352 ret = ERR_TRANS; 353 354 IFD_Towitoko_Delete (slot->ifd); 355 } 346 if (!Phoenix_Close ()) 347 ret = ERR_TRANS; 356 348 357 349 CT_Slot_Clear (slot); … … 371 363 static void CT_Slot_Clear (CT_Slot * slot) 372 364 { 373 slot->ifd = NULL;374 365 slot->icc = NULL; 375 366 slot->protocol = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.