So, thanks to @Guru_Evi I was able to compile cec-client to android. Thanks a lot for your instructions. As a note to the future, I had to add a flag -DANDROID_PLATFORM=android-16 in order to be able to execute the command on android >= 5.0, otherwise I was receiving the error " error: only position independent executables (PIE) are supported.".
I’ve added the flag -DHAVE_EXYNOS_API=1 and -DHAVE_AOCEC_API=1
Now I’m facing a problem of “command ‘PING’ was not acked by the controller”.
I’m running it on this android dongle.
The device /dev/cec is settled:
q8723bs:/ # ls -l /dev/cec
crw-rw-rw- 1 root root 218, 0 2017-12-19 16:33 /dev/cec
I also can find it on /sys/class/cec:
q8723bs:/ # ls -laht /sys/class/cec/
total 0
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 arc_port
lrwxrwxrwx 1 root root 0 2017-12-19 16:45 cec -> ../../devices/aocec/cec
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 cec_version
--w------- 1 root root 4.0K 2017-12-19 16:45 cmd
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 dbg_en
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 device_type
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 dump_reg
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 fun_cfg
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 menu_language
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 osd_name
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 physical_addr
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 pin_status
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 port_num
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 port_seq
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 port_status
-rw-rw-r-- 1 root root 4.0K 2017-12-19 16:45 vendor_id
-r--r--r-- 1 root root 4.0K 2017-12-19 16:45 wake_up
drwxr-xr-x 2 root root 0 2017-12-19 16:33 .
drwxr-xr-x 110 root root 0 2017-12-19 16:33 ..
But when I ran cec-client I receive this answer:
q8723bs:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:toolbox:s0
q8723bs:/ # cec-client -s /dev/cec
opening a connection to the CEC adapter...
DEBUG: [ 1] Broadcast (F): osd name set to 'Broadcast'
DEBUG: [ 2] connection opened, clearing any previous input and waiting for active transmissions to end before starting
DEBUG: [ 396] communication thread started
DEBUG: [ 1396] command 'PING' was not acked by the controller
As a note, I also have the device /dev/input/event2 that is a read only cec_input:
q8723bs:/ # ls -l /dev/input/event2
crw-rw---- 1 root input 13, 66 2017-12-19 16:33 /dev/input/event2
q8723bs:/ # ls /sys/devices/virtual/input/input2/
capabilities/ event2/ id/ modalias name phys power/ properties subsystem/ uevent uniq
q8723bs:/ # cat /sys/devices/virtual/input/input2/name
cec_input
I tried to run it on /dev/input/event2 but obviously it didn’t work because it could not open a connection:
q8723bs:/ # cec-client /dev/input/event2
No device type given. Using 'recording device'
CEC Parser created - libCEC version 4.0.2
opening a connection to the CEC adapter...
DEBUG: [ 1] Broadcast (F): osd name set to 'Broadcast'
ERROR: [ 3335] error opening serial port '/dev/input/event2': Couldn't lock the serial port
ERROR: [ 3335] could not open a connection (try 1)
Any thoughts to help me on this? Thanks in advance.