当前位置:操作系统 > 安卓/Android >>

2.4G无线遥控器调试问题

在kernel里enable HID和OHCI,将设备当作HID设备来处理。在kermel里打印信息:

  [   57.002651] input: 2.4G  Wireless Receiver  as /devices/platform/s5p-ohci/us1
[   57.007848] generic-usb 0003:1915:AF11.0001: input: USB HID v1.11 Keyboard [0
[   57.024394] input: 2.4G  Wireless Receiver  as /devices/platform/s5p-ohci/us2
[   57.028547] generic-usb 0003:1915:AF11.0002: input: USB HID v1.11 Mouse [2.41
[   57.045517] generic-usb 0003:1915:AF11.0003: claimed by neither input, hiddew
[   57.047445] usbcore: registered new inte易做图ce driver usbhid                 
[   57.052918] usbhid: USB HID core driver 

   进系统后, input设备报错:

    /EventHub( 78): New keyboard: device->id=0x10000 devname='2.4G Wireless Rece
iver ' propName='hw.keyboards.65536.devname' keylayout='/system/usr/keylayout/qw
erty.kl'
I/EventHub( 78): New device: path=/dev/input/event2 name=2.4G Wireless Receiv
er id=0x10000 (of 0x1) index=1 fd=93 classes=0x9
E/EventHub( 78): could not get driver version for /dev/input/mouse0, Not a typ
ewriter
I/EventHub( 78): New keyboard: device->id=0x10001 devname='2.4G Wireless Rece
iver ' propName='hw.keyboards.65537.devname' keylayout='/system/usr/keylayout/qw
erty.kl'
I/EventHub( 78): New device: path=/dev/input/event1 name=2.4G Wireless Receiv
er id=0x10001 (of 0x2) index=2 fd=99 classes=0x3
I/EventHub( 78): New keyboard: device->id=0x10002 devname='s3c-keypad' propNam
e='hw.keyboards.65538.devname' keylayout='/system/usr/keylayout/s3c-keypad.kl'
I/EventHub( 78): New device: path=/dev/input/event0 name=s3c-keypad id=0x10002
(of 0x3) index=3 fd=100 classes=0x21
E/EventHub( 78): could not get driver version for /dev/input/mice, Not a typew
riter
I/InputReader( 78): Device added: id=0x0, name=s3c-keypad, sources=00000301
I/InputReader( 78): Device added: id=0x10001, name=2.4G Wireless Receiver , s
ources=00000101
I/InputReader( 78): Device added: id=0x10000, name=2.4G Wireless Receiver , s
ources=00010105
I/InputManager-Callbacks( 78): No input device calibration properties found fo
r device s3c-keypad.
I/InputManager-Callbacks( 78): No input device calibration properties found fo
r device 2.4G Wireless Receiver .
I/InputManager-Callbacks( 78): No input device calibration properties found fo
r device 2.4G Wireless Receiver . 

    input校准出错了,搜索到InputManager.java里

    @SuppressWarnings("unused")
        public InputDeviceCalibration getInputDeviceCalibration(String deviceName) {
            // Calibration is specified as a sequence of colon-delimited key value pairs.
            Properties properties = new Properties();
            File calibrationFile = new File(Environment.getRootDirectory(),
                    CALIBRATION_DIR_PATH + deviceName + ".idc");
            if (calibrationFile.exists()) {
                try {
                    properties.load(new FileInputStream(calibrationFile));
                } catch (IOException ex) {
                    Slog.w(TAG, "Error reading input device calibration properties for device "
                            + deviceName + " from " + calibrationFile + ".", ex);
                }
            } else {
                Slog.i(TAG, "No input device calibration properties found for device "
                        + deviceName + ".");
                return null;
            }
           
            InputDeviceCalibration calibration = new InputDeviceCalibration();
            calibration.keys = properties.keySet().toArray(new String[properties.size()]);
            calibration.values = properties.values().toArray(new String[properties.size()]);
            return calibration;
        }

      CALIBRATION_DIR_PATH = "usr/idc/"   ;getRootDirectory = "system"

     将校准文件放在/usr/idc里。

 


摘自 zzobin的专栏

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,