我正在创建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);
}
}
}