From 2c10af666bdbf63eeeb370efa85f011b3aac3bd8 Mon Sep 17 00:00:00 2001 From: Adam Greenwood-Byrne Date: Fri, 26 Mar 2021 22:28:41 +0000 Subject: [PATCH] Getting mouse library to work with iOS BLE peripheral/controller --- part12-wgt/lib/bt.c | 3 ++- part12-wgt/wgt/mouse.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/part12-wgt/lib/bt.c b/part12-wgt/lib/bt.c index 9e987ce..912dd47 100644 --- a/part12-wgt/lib/bt.c +++ b/part12-wgt/lib/bt.c @@ -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++= 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); } } }