mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-09 20:00:40 +00:00
Getting mouse library to work with iOS BLE peripheral/controller
This commit is contained in:
parent
3a86c5975b
commit
2c10af666b
2 changed files with 4 additions and 3 deletions
|
@ -232,7 +232,7 @@ void sendACLsubscribe(unsigned int handle)
|
|||
bt_writeByte(lo(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;
|
||||
while (c++<data_length) bt_writeByte(command[c-1]);
|
||||
|
@ -353,6 +353,7 @@ void connect(unsigned char *addr)
|
|||
|
||||
command[0] = lo(p);
|
||||
command[2] = lo(q);
|
||||
command[5] = 1; // Necessary for iOS connection
|
||||
command[6] = *(addr+5);
|
||||
command[7] = *(addr+4);
|
||||
command[8] = *(addr+3);
|
||||
|
|
|
@ -138,9 +138,9 @@ void bt_conn()
|
|||
while ( (buf = hci_poll()) ) {
|
||||
if (!connected && data_len >= 2 && buf[0] == LE_CONNECT_CODE) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue