You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • I'm currently working on a small app that allows to control a ... marital aid of the satisfyer variety via BLE. After learning that the connection needs to be bonded (I'm not really experienced in BLE yet) I also managed to control the device quite well. However, everytime I restart the app or go back to clock, the device is disconnected and I need to re-bond it, which takes alot of time. Is there a way to have a persistent connection in the background that stays active (and send a keepalive every ~100ms) or at least be able to skip the bonding procedure to save time?
    Thanks!

    Also, if I get the app to work more consistently, it shouldn't be that hard to change it to also work with sextoys from different brands and add features like control via accelerometer etc. I'd love to upload it once finished but due to the nature of the app I'm not sure if Gordon/the team would like something like this in the official store.

  • However, everytime I restart the app or go back to clock, the device is disconnected and I need to re-bond it

    oh, this may be caused by design decision of doing reset() when exiting each app to prevent memory leaks, only the console connection (from WebIDE or gadgdetbridge) survives.
    However bonding should have persistent storage (managed by PeerManager component of Nordic SDK) and Espruino uses it so it should not be needed to do it again when connection drops (or even after reset/reboot). After all connection drop can happen anytime.

    Can you test in your app that you can disconnect and reconnect without doing it all again while your app still runs? And perhaps create issue for this https://github.com/espruino/Espruino/iss­ues linking this thread.

    BTW some of those devices run nrf52, there was quite interesting (or funny, or scary) video on youtube from DEFCON talk about reflashing firmware remotely in those devices while chatting with person using it, check https://github.com/smealum/butthax
    So one could even run Espruino on both sides of the connection :-)

About

Avatar for fanoush @fanoush started