Comments (9)
Why is your scanStart
handler using this.log
rather than console
? this.log
doesn't appear to exist.
from noble.
@mrstegeman you're right. That was a bad case of copy and paste from the actual implementation where I encountered this. I've fixed the example now, thanks!
(Note that this does not affect anything as that line is never run because of the crash).
Scratch that, looks like the this.log
being undefined might be the cause of this anyway.
from noble.
So no crash anymore?
from noble.
No crash by using:
const noble = require("@abandonware/noble");
class Scanner {
constructor() {
noble.on("discover", this.onDiscover.bind(this));
noble.on("scanStart", this.onScanStart.bind(this));
noble.on("stateChange", () => {
noble.startScanning([], true);
});
}
onScanStart() {
console.debug("Started scanning.");
}
onDiscover(peripheral) {
console.log(peripheral);
}
}
const scanner = new Scanner();
from noble.
Great! Can you go ahead and close?
from noble.
Si please close the issue if no more relevant
Eventually you can try to submit your example to upstream ?
That could be useful to have some CLI BLE utilities as part of package.
Relate-to: #9
from noble.
@mrstegeman thanks for the feedback.
from noble.
@hannseman Yes any exception thrown in the event handler will abort the node process.
from noble.
@geovie good to know, found the cause now in my actual implementation. Thanks for the help. I got a bit thrown of by the hard crash and missed the actual error message Cannot read property 'find' of undefined
.
from noble.
Related Issues (20)
- v1.9.2-18 v1.9.2-17 are BREAKING! HOT 28
- Remove unneeded data copy HOT 1
- Characteristic write not working on MacOS Ventura HOT 2
- Peripheral.id value different on Mac OS versus Linux HOT 2
- DBUS support for Linux (instead of HCI) HOT 5
- Bindings for a different architecture HOT 1
- Question about write reliability / 'resend' mechanism if package was lost. HOT 1
- v1.9.2-19 not discovering all peripherals HOT 9
- support bluetooth 5
- @abandonware/noble does not discover any devices HOT 2
- TypeError: Cannot read properties of undefined (reading 'exchangeMtu') HOT 1
- Gets stuck in the function discoverSomeServicesAndCharacteristicsAsync without any errors HOT 1
- Uncaught SyntaxError
- Ubuntu 22.04 Behavior HOT 3
- Installation failing on Windows 11 Pro (error C2039 in winrt) HOT 2
- An error occurred in ubunto
- "No native build was found" for M2 running OSX? HOT 1
- New maintainer in town (bluetooth-hci-socket, noble, bleno) - new features HOT 10
- Link Node JS and Node "File exists" HOT 5
- not support build base python^3.12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noble.