gpt4 book ai didi

cocoa - 是否有兼容 Snow Leopard 的 "sudden motion sensor"API 可用?

转载 作者:行者123 更新时间:2023-12-03 16:06:32 27 4
gpt4 key购买 nike

我一直在使用Unimotion在我的application读取 Apple 笔记本电脑的运动传感器值,但无法将代码移植到 10.6 64 位。 (我也尝试过 SMSLib 但也没有运气。)

  • 有没有简单的10.6兼容的短信API?

如果没有其他选择,我也在考虑修补其中一个库。 Unimotion 和 SMSLib 都使用以下调用,该调用已在 10.5 和 removed from 10.6 64-bit 中弃用。 :

result = IOConnectMethodStructureIStructureO(
dataPort, kernFunc, structureInputSize,
&structureOutputSize, &inputStructure,
outputStructure);
  • 有没有简单的方法可以替换这与新的 IOKit 调用有关吗?

(This post并没有真正让我走得更远)

最佳答案

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?

该文件建议进行替换。这个怎么样?

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

据我所知,除了参数的顺序之外,应该没有什么区别。也就是说,我从未使用过 I/O Kit,因此我可能会错过一些关键的概念差异,这些差异将使此调用无法像旧的那样工作。

关于cocoa - 是否有兼容 Snow Leopard 的 "sudden motion sensor"API 可用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2174333/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com