码迷,mamicode.com
首页 > 系统相关 > 详细

I.MX6 linux eGalaxTouch 自动获取设备节点

时间:2015-11-20 17:18:51      阅读:363      评论:0      收藏:0      [点我收藏+]

标签:

                       I.MX6 linux eGalaxTouch 自动获取设备节点


                        \\\\\\\\\\\\\\-*- 目录 -*-/////////////
                        |  一. 需求:
                        |  二. /proc/bus/input/devices 内容:
                        |  三. 解决方法:
                        |  四. 实际应用:
                        --------------------------------------

一. 需求:
    获取eGalaxTouch的输入设备节点

二. /proc/bus/input/devices 内容:
    root@freescale /proc/bus/input$ cat /proc/bus/input/devices 
    I: Bus=0019 Vendor=0001 Product=0001 Version=0100
    N: Name="gpio-keys"
    P: Phys=gpio-keys/input0
    S: Sysfs=/devices/platform/gpio-keys/input/input0
    U: Uniq=
    H: Handlers=kbd event0 
    B: PROP=0
    B: EV=3
    B: KEY=100000 0 0 0
    
    I: Bus=0003 Vendor=0eef Product=7201 Version=0210
    N: Name="eGalax Inc. eGalaxTouch EXC7200-0031v1000"
    P: Phys=usb-fsl-ehci.1-1.3/input0
    S: Sysfs=/devices/platform/fsl-ehci.1/usb2/2-1/2-1.3/2-1.3:1.0/input/input1
    U: Uniq=
    H: Handlers=cpufreq_interactive 
    B: PROP=0
    B: EV=1b
    B: KEY=421 0 30001 0 0 0 0 0 0 0 0
    B: ABS=100 3f
    B: MSC=10
    
    I: Bus=0006 Vendor=0eef Product=0020 Version=0001
    N: Name="eGalaxTouch Virtual Device for Multi"
    P: Phys=
    S: Sysfs=/devices/virtual/input/input2
    U: Uniq=
    H: Handlers=cpufreq_interactive event1 
    B: PROP=2
    B: EV=b
    B: KEY=400 0 0 0 0 0 0 0 0 0 0
    B: ABS=6608000 1000003
    
    I: Bus=0006 Vendor=0eef Product=0010 Version=0001
    N: Name="eGalaxTouch Virtual Device for Single"
    P: Phys=
    S: Sysfs=/devices/virtual/input/input3
    U: Uniq=
    H: Handlers=event2 
    B: PROP=2
    B: EV=b
    B: KEY=30000 0 0 0 0 0 0 0 0
    B: ABS=3
    
    root@freescale /proc/bus/input$ 

三. 解决方法:
    1. 采用shell脚本的进行解决;
    2. shell脚本如下:
        inputCheckLine=`cat /proc/bus/input/devices | grep -n "Vendor=0eef" | grep "Product=0020 Version=0001"| awk -F: {print $1}`
        touchEvent=`sed -n "$((${inputCheckLine}+5))p" /proc/bus/input/devices | grep -o "event."`

四. 实际应用:
    ......
    while [ -z $touchEvent ]
    do
        inputCheckLine=`cat /proc/bus/input/devices | grep -n "Vendor=0eef" | grep "Product=0020 Version=0001"| awk -F: {print $1}`
        touchEvent=`sed -n "$((${inputCheckLine}+5))p" /proc/bus/input/devices | grep -o "event."`
        echo "please hang up USB TOUCH !"
        usleep 10
    done
    ......
    export TSLIB_TSDEVICE=/dev/input/${touchEvent}
    export QWS_MOUSE_PROTO=tslib:/dev/input/${touchEvent}
    ......

 

I.MX6 linux eGalaxTouch 自动获取设备节点

标签:

原文地址:http://www.cnblogs.com/zengjfgit/p/4981173.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!