Getting mouse library to work with iOS BLE peripheral/controller

This commit is contained in:
Adam Greenwood-Byrne 2021-03-26 22:28:41 +00:00
parent 3a86c5975b
commit 2c10af666b
2 changed files with 4 additions and 3 deletions

View file

@ -232,7 +232,7 @@ void sendACLsubscribe(unsigned int handle)
bt_writeByte(lo(channel)); bt_writeByte(lo(channel));
bt_writeByte(hi(channel)); bt_writeByte(hi(channel));
volatile unsigned char command[5] = { 0x12, 0x2b, 0x00, 0x01, 0x00 }; volatile unsigned char command[5] = { 0x12, 0x3d, 0x00, 0x01, 0x00 };
unsigned int c=0; unsigned int c=0;
while (c++<data_length) bt_writeByte(command[c-1]); while (c++<data_length) bt_writeByte(command[c-1]);
@ -353,6 +353,7 @@ void connect(unsigned char *addr)
command[0] = lo(p); command[0] = lo(p);
command[2] = lo(q); command[2] = lo(q);
command[5] = 1; // Necessary for iOS connection
command[6] = *(addr+5); command[6] = *(addr+5);
command[7] = *(addr+4); command[7] = *(addr+4);
command[8] = *(addr+3); command[8] = *(addr+3);

View file

@ -140,7 +140,7 @@ void bt_conn()
connected = !*(buf+1); connected = !*(buf+1);
connection_handle = *(buf+2) | (*(buf+3) << 8); connection_handle = *(buf+2) | (*(buf+3) << 8);
if (connection_handle == 0) delay(1); if (connected == 0) wait_msec(0x186A);
} }
} }
} }