-
• #2
From which side - central or peripheral?
If you're the central you are the one who initiates the connection, so you should be able to increment a counter when this happens.EDIT:
From peripheral side there are events for connect and disconnect:
https://www.espruino.com/Reference#l_NRF_connect
https://www.espruino.com/Reference#l_NRF_disconnectThis example will flash the green LED on connect and the red on disconnect:
NRF.on('connect',()=>{ digitalPulse(LED2,1,200); }); NRF.on('disconnect',()=>{ digitalPulse(LED1,1,200); });
It's easy to try with just the WebIDE as connecting central.
-
• #3
Thanks a lot. Will try that.
-
• #4
Thanks, that works perfect.
Hi,
I tried to find a way to count the number of connections made via BLE. Is there an easy way to accomplish that?
Thanks
Jens