Android cec设备,Android and HDMI CEC

Yes it is entirely possible to do, however it is incredibly fickle. HDMI CEC works like a bus. Usually, in both directions.

Your questions:

Yes. Though I use JNI to access native code that does the actual work. You might be able to do it purely in Java.

Probably not. The issue is that each vendor implements the code to send CEC signals. There is no common functionality at all, except for the CEC commands themselves. The device file accessed is likely unique in most devices, especially from vendor to vendor. Therefore, any libraries that are created most support a wide range of different vendors and their quirks, and it would not be future proofed against the next vendor changes.

Unfortunately I cannot provide my working code. I provide a link below to an Amlogic source file on github that does a lot of the work. My code looks similar.

Some of my own points:

Not all devices support all commands. Many less used commands will not be implemented, because it costs more.

Interacting with CEC is often vendor dependant. They will likely have their own library or device file to work with.

CEC will not always work in both directions, it depends whether the vendor implemented that functionality. It is not always implemented, because it costs more to do.

To do it properly you will likely need to implement your code using JNI to form the proper packets. You might find this useful, at least for Amlogic.

The device access point that I use in my devices is /dev/amhdmitx0. You can send your well formed packets to that location.

Here is a useful website that can tell you how how to form a CEC command: http://www.cec-o-matic.com/.

Unfortunately, I cannot share much more than this of what I have written. For various legal reasons.

The best thing that you can do is to seek help from the vendor you are programming for. If you are coding for a specific platform. They might be willing to help you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值