• Have you updated your firmware to 1v90? The promise returning undefined rather than an error sounds like a 1v88 issue.

    If you're getting Uncaught Error: Unhandled promise rejection then you should be able to catch it with a .catch though.

    I guess it could be something strange with the promise implementation and your use of the second argument to then.

    Have you tried just:

    NRF.requestDevice({filters: [{namePrefix: 'Puck.js'}]}).then(dev=>{
      console.log("device found", dev);
      return dev.gatt.connect();
    }).then(conn=>{
      console.log("connected", conn);
      return conn.getPrimaryService(0x464F);
    }).then(s=>{
      console.log("service found", s);
    }).catch(e=>{
      console.log( "error:", e );
    });
    
About

Avatar for Gordon @Gordon started