Skip to content

Is there a way to Advertise Services and a URL? #36

@hardillb

Description

@hardillb

I'm trying to build a Eddystone beacon that hosts it's own Web Bluetooth based control interface.

The Web Bluetooth API lets me filter BLE devices either by name prefix or advertised services. At the moment I'm having to use the name prefix as the services I've attached are not getting advertised along with the URL. I'd like to be able to let users set arbitrary names for beacons so I would like to move away from using the name prefix.

My code currently looks like this

  var toggle = new ToggleCharacteristic(toggleCallback);
  var dim = new RangeCharacteristic(dimCallback);

  var characteristics = [toggle, dim];

  bleno.once('advertisingStart', function(err) {
    if (err) {
      throw err;
    }

    bleno.setServices([
      new BlenoPrimarySerivce({
        uuid: 'ba42561bb1d2440a8d040cefb43faece',
        characteristics: characteristics
      })
    ]);
  });

  eddystone.advertiseUrl(config.shortURL, {name: config.name});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions