如何使ConsumerIrManager传输更快?

时间:2017-03-05 19:07:18

标签: java android

我正在创建Android应用,需要每秒发送大量的红外信号。不幸的是,ConsumerIrManager.transmit阻止了进程,我无法发送超过5-6个请求/秒。

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        int keyCode = event.getKeyCode();
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_UP:
                irManager.transmit(frequency, volup);
                Log.v("LEFT", "UP");
                return true;
            case KeyEvent.KEYCODE_VOLUME_DOWN:
                irManager.transmit(frequency, voldown);
                Log.v("LEFT", "DOWN");
                return true;
            default:
                return super.dispatchKeyEvent(event);
        }
    }
}

0 个答案:

没有答案