Skip to content

List of characteristics are empty in service #59

@bitabs

Description

@bitabs

I am trying to connect to my Arduino via BLE using this library. But for some reason the services array are always empty:

Here's my code

    noble.on('stateChange', function(state) {
      if (state === 'poweredOn') {
        //
        // Once the BLE radio has been powered on, it is possible
        // to begin scanning for services. Pass an empty array to
        // scan for all services (uses more time and power).
        //
        console.log('scanning...');
        noble.startScanning(['0000222000001000800000805f9b34fb'], false);
      }
      else {
        noble.stopScanning();
      }
    })

    noble.on('discover', function(peripheral) {
      console.log(peripheral);
      // we found a peripheral, stop scanning
      noble.stopScanning();

      console.log("scanning stopped")


      peripheral.connect(err => {
        peripheral.discoverServices(['0000222000001000800000805f9b34fb'], function(err, services) {
          console.log({error: err, service: services});
        });
      })

    });

And this is the output:
capture

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions