OSX- main thread is in wait how to get intrrupt pipe response

Discussion in 'Mac Programming' started by login4vinay, Mar 5, 2014.

  1. login4vinay macrumors newbie

    May 20, 2013
    I am developing a device driver on mac. my question is how can we make a device request asynchronous to synchronous. like i send a send encapsulated command to device and get it response using get encapsulated command after getting a notification on interrupt pipe. so how can i make my thread will wait until all above request is not completed (both send and get) . but the function from get encap is called is a virtual function and called by upper layer. so if i process a wait in that virtual function then i am not able to get response till my tread is in waiting process. please help me to resolve this problem.

    bool class::USBSetPacketFilter()
    IOReturn Value;
    .... .................
    value = send_Encasulated_command(* of structure, length);
    IOLockSleepDeadline(x, y, z, w);
    global variable which is updated when get_Encap is completed. if (Value == IOSuccess &&XVZ == true)
    return true;
    else r
    eturn false }
    in other function to readinterrupt pipe pipe->Read(mMemDes,&m_CommInfo,NULL);
    in call back function we check it is a device response or not then we call get_encapsulated function to complete the request

    thnks in advanc
  2. login4vinay thread starter macrumors newbie

    May 20, 2013

Share This Page