Skip to content

Instantly share code, notes, and snippets.

@jes
Created June 3, 2023 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jes/36b8ea811706ee1db4ceab6e37ab8af2 to your computer and use it in GitHub Desktop.
Save jes/36b8ea811706ee1db4ceab6e37ab8af2 to your computer and use it in GitHub Desktop.
NRF.connect("34:85:18:03:01:0A").then(function(gatt) {
console.log(gatt);
console.log("connected");
var t = getTime();
gatt.device.on('gattserverdisconnected', function(reason) {
console.log("disconnected (" + reason + ") after " + (getTime()-t) + " secs");
});
}).catch(function(e) {
console.log("error: " + e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment