You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got something working with node's noble library, though it's a bit more involved to use. You need to call the writeHandle method, but need to go through power, scanning, and connecting to get a peripheral you can call this method on. Roughly:
mac_addr = "xx:xx:xx:xx:xx:xx"
data = [0x12, 0xef, ... ]
noble.on('discover', function handler(peripheral) {
if (peripheral.address.toUpperCase() === mac_addr.toUpperCase()) {
noble.stopScanning()
noble.removeListener('discover', handler)
peripheral.connect(function(err) {
peripheral.writeHandle(0x0012,
Buffer.from(data),
false, // wait for response
function (err) { process.exit(0) })
})
}
})
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning()
}
})
The text was updated successfully, but these errors were encountered:
Most of the scripts no longer work directly because gatttool has been removed from bluez-utils. Potential replacements for
are (the somewhat hacky):
or the python gattlib library, which has a nice interface via the write_by_handle method, but unfortunately segfaults on my machine.
I got something working with node's noble library, though it's a bit more involved to use. You need to call the writeHandle method, but need to go through power, scanning, and connecting to get a peripheral you can call this method on. Roughly:
The text was updated successfully, but these errors were encountered: