Hi,

I am writing a pcsc driver for a usb smartcard reader on Mac OS 10.1, which uses 
asynchronous reads from its interrupt pipes.
So what I did was to take the example driver that is distributed with the pcsc 
package, and in the OpenUSB() function I added the following code (after opening the 
interface):


        // Adding an async event source
    CFRunLoopSourceRef                  runLoopSource;
    kr = (*intFace)->CreateInterfaceAsyncEventSource(intFace, &runLoopSource);
    CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode);
        
    kr = (*intFace)->ReadPipeAsync(intFace, pipeNum, myBuffer, 
                                                BUFFER_SIZE, 
ReadCompletion,(void*)data);

The problem is that if I want the completion routine to be called at all I have to add 
the command CFRunLoopRun() following the above code, which means that the OpenUSB() 
function will never return... And not calling CFRunLoopRun() means that the async 
callback will never be reached.

Is there a way to solve this problem? 

Thanks in advance,
Amira.


***************************************************************
Unix Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/
To unsubscribe send an email to [EMAIL PROTECTED] with
unsubscribe sclinux
***************************************************************

Reply via email to