mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-13 22:00:40 +00:00
Got mouse coords working with iOS peripheral
This commit is contained in:
parent
2c10af666b
commit
50a3b2fb7a
1 changed files with 4 additions and 4 deletions
|
@ -163,17 +163,17 @@ void acl_poll()
|
||||||
unsigned char d2 = bt_waitReadByte();
|
unsigned char d2 = bt_waitReadByte();
|
||||||
|
|
||||||
unsigned int dlen = d1 | (d2 << 8);
|
unsigned int dlen = d1 | (d2 << 8);
|
||||||
|
|
||||||
if (dlen > 7) {
|
|
||||||
unsigned char data[dlen];
|
unsigned char data[dlen];
|
||||||
|
|
||||||
for (int i=0;i<dlen;i++) data[i] = bt_waitReadByte();
|
for (int i=0;i<dlen;i++) data[i] = bt_waitReadByte();
|
||||||
|
|
||||||
|
if (dlen > 7) {
|
||||||
unsigned int length = data[0] | (data[1] << 8);
|
unsigned int length = data[0] | (data[1] << 8);
|
||||||
unsigned int channel = data[2] | (data[3] << 8);
|
unsigned int channel = data[2] | (data[3] << 8);
|
||||||
unsigned char opcode = data[4];
|
unsigned char opcode = data[4];
|
||||||
|
|
||||||
if (thandle == connection_handle && opcode == 0x1b) {
|
if (thandle == connection_handle && opcode == 0x1b) {
|
||||||
if (channel == 4 && data[5] == 0x2a && data[6] == 0x00) {
|
if (channel == 4 && data[5] == 0x3b && data[6] == 0x00) {
|
||||||
if (length == 7) msetxy(data[7] | (data[8] << 8), data[9] | (data[10] << 8));
|
if (length == 7) msetxy(data[7] | (data[8] << 8), data[9] | (data[10] << 8));
|
||||||
if (length == 5) msetbut(data[7], data[8]);
|
if (length == 5) msetbut(data[7], data[8]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue