• The module makes sending cmd's to a device very simple like explained here.

    Is someone using ble_uart to write cmd's to a device that has set a passkey?

    Afaik module ble_uart is not handling passkeyRequest, so maybe there is a different way the handle those requests.

  • I think since you pass the device into ble_uart, you could do something like:

    NRF.requestDevice({ filters: [{ namePrefix: 'Puck.js' }] }).then(function(device) {
      device.on('passkeyRequest', function() { 
        device.sendPasskey("123456");
       });
      return ble_uart.connect(device);
    }).then(function(uart) {
      uart.on('data', function(d) { print("Got:"+JSON.stringify(d)); });
      uart.eval('E.getTemperature()').then(fun­ction(data) {
        print("Got temperature "+data);
        uart.write("digitalPulse(LED,1,10);\n");­ // .then(...)
      }); 
      setTimeout(function() { 
        uart.disconnect(); 
        console.log("Disconnected"); 
      }, 2000);
    });
    

    Not tested though

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

How to use module "ble_uart" and handle passkeyRequest?

Posted by Avatar for MaBe @MaBe

Actions