如何以编程方式使用手机的 IrDA 远程控制媒体播放器?
当需要编写代码以使用手机的 IrDA 来创建必要的脉冲来远程控制消费电子产品(例如 HDD 媒体播放器)时,应在哪个移动操作系统上使用哪个 API 或库?
也许某个移动操作系统比其他操作系统更适合此类应用程序?
which API or library on which mobile OS is to be used when one needs to write a code to use the phone's IrDA to create the necessary impulses to remote control consumer electronics e.g. a HDD media player?
Is maybe a certain mobile OS better suited for that kind of application than others?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先您需要知道 IrDA不是远程控制的最佳选择。 这是可以做到的,但 IrDA 设计为高速/低范围,您可以模拟低速,但范围 (IMO) 距离实际使用还很远(诺基亚 e50 能够控制 2-3m 的数码相机快门... ,非常仔细瞄准)。 此处显示了实现此目的所需的黑客攻击量,您基本上需要欺骗 IrDA 以正确的频率发送正确脉冲。
第二件事是 CIR 远程控制并不像您想象的那么简单。 有无数的标准在使用的频率、调制、波长、命令代码等方面有所不同。 您需要知道您想要支持什么。 LIRC 站点对于确定 http://lirc.sourceforge.net/remotes/ 非常有帮助。 这里提供了对其含义的平易近人的解释:http://www.sbprojects.com /knowledge/ir/ir.htm
至于现成的库和平台......我真的不知道。 我已经在 PocketPC(nevo 等)和 Symbian S60 上看到过这种情况(irRemote)。 还没有看到可用的 J2ME 应用程序。
上次我需要红外遥控器时,我使用红外二极管、AVR ATtiny 和令人惊讶的短组件将其组装在一起:)
First you need to know that IrDA is not the best choice for remote control. It can be done, but IrDA is by design high speed/low range, you can emulate low speeds but ranges (IMO) are far from practical usage (Nokia e50 is able to control digital camera shutter from 2-3m... with very, very careful aiming). The amount of hacking needed to achieve this is shown here, you basically need to trick IrDA to send correct impulses with correct frequency.
The second thing is that CIR remote control is not as simple as you might think. There are countless standards that differ in used frequency, modulation, wavelength, command codes and so on. You need to know what you want to support. LIRC site can be very helpful in determining that http://lirc.sourceforge.net/remotes/. Approachable explanation of what it all means is available here: http://www.sbprojects.com/knowledge/ir/ir.htm
As for ready made libraries and platforms... I honestly don't know. I've seen it done on PocketPC (nevo among others) and Symbian S60 (irRemote). Haven't seen working J2ME app yet.
Last time I needed the IR remote I hacked it together using IR diode, AVR ATTiny and surprisingly short piece of assembly :)