Warn on non-evdev devices

This commit is contained in:
Iwan Timmer
2014-10-25 17:07:18 +02:00
parent 597b4a48db
commit 8f27977374
6 changed files with 24 additions and 10 deletions

View File

@@ -12,8 +12,6 @@ public class EvdevAbsolute {
public final static int UP = 1, DOWN = -1, NONE = 0;
private final static int ABS_OFFSET = 0x40;
private final static int READ_ONLY = 2;
private final static char EVDEV_TYPE = 'E';
private int avg;
private int range;
@@ -25,7 +23,7 @@ public class EvdevAbsolute {
ByteBuffer buffer = ByteBuffer.allocate(6*4);
buffer.order(ByteOrder.nativeOrder());
byte[] data = buffer.array();
int request = getRequest(READ_ONLY, EVDEV_TYPE, ABS_OFFSET+axis, 6*4);
int request = IO.getRequest(IO.READ_ONLY, EvdevConstants.EVDEV_TYPE, ABS_OFFSET+axis, 6*4);
IO.ioctl(filename, data, request);
buffer.getInt(); //Skip current value
@@ -39,10 +37,6 @@ public class EvdevAbsolute {
this.reverse = reverse;
}
private int getRequest(int dir, int type, int nr, int size) {
return (dir << 30) | (size << 16) | (type << 8) | nr;
}
/**
* Convert input value to short range
* @param value received input