node-ble icon indicating copy to clipboard operation
node-ble copied to clipboard

Listen for Beacons

Open pacmac opened this issue 4 years ago • 3 comments

Hi;

Very frustrated with noble so testing out your libraries.

I am able to discover my devices, but how would I use this to listen for beacon transmissions and read the device manufacturer's data ?

I don't see any method or property related to the manufacturer's data.

Id not want to connect to the device, but to simply read the raw data and decode it ?

Thanks

pacmac avatar May 03 '20 04:05 pacmac

I know, I wrote this library because I was frustrated too by noble. :) This project is quite new, It will allow you to get advertised data, but today I can't provide you an official release date. I hope to start working on it soon.

chrvadala avatar May 03 '20 21:05 chrvadala

@chrvadala hey, any update on your progress? because project seems to be dead currently :(

i was looking for alternative to noble too, still no stable library for node

dzek69 avatar Nov 29 '20 18:11 dzek69

For anyone interested, I added the function below to node-ble/src/Device.js to receive manufacturing data (useful for reading data from Beacons):

async getManfData() { return this.helper.prop('ManufacturerData') }

which you can call like so:

const mdata = await device.getManfData()

This returns an object whose keys are the 16-bit Manufacturer ID. You may get the raw data by doing (for example):

const mdataRaw = m[Object.keys(m)[0]].value

Hope this helps!

trobstFairway avatar Aug 10 '21 21:08 trobstFairway