You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • the value gatt.connected should represent the status of the connection in such a way that if a disconnection event is seen, the gatt.connectedshould be set to false

    Yes - however the disconnected event executes in the main thread, while connected is set to false in the Interrupt, so the two can be out of sync.

    But actually the problem in this case is my advice. What you actually want is:

      gatt.device.on('gattserverdisconnected',­ function(reason) {
        console.log("Disconnected ",reason);
      });
    

    The event you hooked into is for when the PC disconnects from the Puck, not when the Puck disconnects from some other device

About

Avatar for Gordon @Gordon started