Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Snow Leopard compatible "sudden motion sensor" API available?

I have been using Unimotion in my application to read motion sensor values for Apple laptops, but have been unable to port the code to 10.6 64-bit. (I have also tried SMSLib and had the no luck either.)

  • Is there any simple 10.6 compatible SMS API?

If there is no alternative, I am also considering patching one of the libraries. Both Unimotion and SMSLib use the following call, which has been deprecated in 10.5 and removed from 10.6 64-bit:

result = IOConnectMethodStructureIStructureO(
    dataPort, kernFunc, structureInputSize,
    &structureOutputSize, &inputStructure, 
    outputStructure);
  • Is there any simple way to replace this with new IOKit calls?

(This post did not really get me much further)

like image 564
Gavin Brock Avatar asked Feb 01 '10 02:02

Gavin Brock


2 Answers

If there is no alternative, I am also considering patching one of the libraries. Both Unimotion and SMSLib use the following call, which has been deprecated in 10.5 and removed from 10.6 64-bit:

result = IOConnectMethodStructureIStructureO(
    dataPort, kernFunc, structureInputSize,
    &structureOutputSize, &inputStructure, 
    outputStructure);

Is there any simple way to replace this with new IOKit calls?

That very document suggests replacements. What about this one?

kern_return_t
IOConnectCallStructMethod(
    mach_port_t  connection,        // In
    uint32_t     selector,      // In
    const void  *inputStruct,       // In
    size_t       inputStructCnt,    // In
    void        *outputStruct,      // Out
    size_t      *outputStructCnt)   // In/Out

As far as I can tell, there should be no difference except for the order of the arguments. That said, I've never used I/O Kit, so I could be missing some critical conceptual difference that will make this call not work as the old one did.

like image 97
Peter Hosey Avatar answered Oct 30 '22 14:10

Peter Hosey


I haven't used this in 10.6, but does this work?

http://code.google.com/p/google-mac-qtz-patches/

like image 43
kubi Avatar answered Oct 30 '22 14:10

kubi