Hi (help !),
I am struggling to make the BangleJS automatically reconnect to my BLE browser (on my iPhone or on my Raspberry-Pi).
Initial connection is good but when I move the watch out of BLE range and then move it back again I would like it to reconnect automatically.
I have tried adding the following to my copy of UART.js:-
device.addEventListener('gattserverdisconnected', function disconnected() {
setTimeout(reconnect,180000);
function reconnect()
{device.gatt.connect();}});
The event fires and the browser displays a bluetooth icon as though it is connected but I seem to have lost the UART object because data transfers will not work afterwards.
If anyone has any ideas I would be very grateful !
Thanks very much :-)
Mark
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi (help !),
I am struggling to make the BangleJS automatically reconnect to my BLE browser (on my iPhone or on my Raspberry-Pi).
Initial connection is good but when I move the watch out of BLE range and then move it back again I would like it to reconnect automatically.
I have tried adding the following to my copy of UART.js:-
The event fires and the browser displays a bluetooth icon as though it is connected but I seem to have lost the UART object because data transfers will not work afterwards.
If anyone has any ideas I would be very grateful !
Thanks very much :-)
Mark