You are reading a single comment by @Gustav and its replies.
Click here to read the full conversation.
-
Thanks, that's great ! What do you mean by defining it as a number ? the reason has to not match that specific number right.
Isn't that constant already defined ?
define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION 0x13 /**< Remote User Terminated Connection. */
Do you mean that i should define it as 0x13 ?
What you're doing there looks ok, but BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION isn't defined, so you'd have to define it as a number somewhere.
To make debugging this easier, I'd suggest adding a USB-TTL converter if you have one handy: http://www.espruino.com/MDBT42Q#serial-console (and then do
Serial1.setConsole(1)
for force the console on serial even when Bluetooth is connected).You can then interact with the REPL at the same time as trying out Bluetooth stuff, which should help no end!