3 ## Tests whether the USB-CEC adapter can be accessed correctly
4 ## Copyright (C) 2011 Pulse-Eight Ltd.
8 echo -n " * searching USB device: "
9 adapters_found
=`lsusb | grep 2548:1001 | wc -l`
10 if [ "x${adapters_found}" = "x0" ]; then
21 echo -n " * checking for CDC-ACM support: "
22 acm_found
=`grep cdc_acm /proc/modules | wc -l`
23 if [ "x${acm_found}" = "x0" ]; then
34 echo -n " * checking for CDC-ACM node: "
35 acm_found
=`ls /dev/ttyACM* | wc -l`
36 if [ "x${acm_found}" = "x0" ]; then
45 check_cec_client_dev
()
47 echo -n " * checking cec-client: "
48 cec_client
=`cec-client -l | grep 'Found devices' | awk '{print \$3}'`
49 if [ -z "${cec_client}" ]; then
51 elif [ "x${cec_client}" = "xNONE" ]; then
52 echo "NO DEVICES FOUND"
60 echo -n " * trying to poll the TV: "
61 cec_client
=`echo 'poll 0' | cec-client -t p -p 1 -d 1 -s | tail -n1 | grep 'POLL'`
62 if [ -z "${cec_client}" ]; then
64 elif [ "x${cec_client}" = "xPOLL message sent" ]; then
67 echo "COULD NOT POLL THE TV"
73 echo -n " * vendor id of the TV: "
74 cec_client
=`echo 'ven 0' | cec-client -t p -p 1 -d 1 -s | tail -n1 | grep 'vendor' | awk '{print \$3}'`
75 if [ -z "${cec_client}" ]; then
84 echo -n " * power status of the TV: "
85 cec_client
=`echo 'pow 0' | cec-client -t p -p 1 -d 1 -s | tail -n1 | grep 'power' | awk '{print \$3}'`
86 if [ -z "${cec_client}" ]; then
95 echo -n " * language of the TV: "
96 cec_client
=`echo 'lang 0' | cec-client -t p -p 1 -d 1 -s | tail -n1 | grep 'language' | awk '{print \$3}'`
97 if [ -z "${cec_client}" ]; then
106 echo -n " * powering off the TV: "
107 cec_client
=`echo 'standby 0' | cec-client -t p -p 1 -d 1 -s | tail -n1`
111 echo "Pulse-Eight USB-CEC Adapter tester v0.1"