Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Why I failed to read from my hid device, while I can write to it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why I failed to read from my hid device, while I can write to it?



 Hi,

 I have a Hid device. When I write a report it, it behave correctly(do what I want it to do), though the return value is NOT equal to kIOReturnSucess(the return value is -536854447). when I try to read from it, I can get nothing from it. All datas I preset in the buffer do not been changed. The return value is -536854449.

 What do the both return values mean?

 My system is Max OS 10.2.4. the following is my codes:

  bool HidObj_Mac::readResult(char* resultBuf, int &len)
 {
     IOReturn ioRet = kIOReturnSuccess;
     memset(resultBuf, 0 , len);
     ioReturn = (*m_hidDeviceInterface)->open(m_hidDeviceInterface,0);
     if (!kIOReturnSuccess != ioRet)
         return false;

     ioRet = (*m_hidDeviceInterface)->getReport(m_hidDeviceInterface,
                     kIOHIDReportTypeInput,
                     0,
                     resultBuf,
                     len,
                     10000,
                     NULL, NULL, NULL);
     //here  ioRet is allways equal to -536854449

     (*m_hidDevieInterface)->close(m_hidDeviceInterface);
     return (kIOReturnSuccess == ioRet);
 }

 Thanks for your attention.
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.