Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
bluetooth-serial-port
Advanced tools
This node module lets you communicate over Bluetooth serial port with devices using Node.js. The goal is have an easy to use API. This module is great for communicating with Bluetooth enabled Arduino devices.
apt-get install libbluetooth-dev
npm install bluetooth-serial-port
var btSerial = new (require('bluetooth-serial-port')).BluetoothSerialPort();
btSerial.on('found', function(address, name) {
btSerial.findSerialPortChannel(address, function(channel) {
btSerial.connect(address, channel, function() {
console.log('connected');
btSerial.write('my data');
btSerial.on('data', function(data) {
console.log(data);
});
}, function () {
console.log('cannot connect');
});
// close the connection when you're ready
btSerial.close();
});
});
btSerial.inquire();
Emitted when data is read from the serial port connection.
Emitted when reading form the serial port connection results in an error. The connection is closed.
Emitted when a bluetooth device was found.
Emitted when the device inquiry execution did finish.
Starts searching for bluetooth devices. When a device is found a 'found' event will be emitted.
Checks if a device has a serial port service running and if it is found it passes the channel id to use for the RFCOMM connection.
Connects to a remote bluetooth device.
Closes the connection.
Writes a string to the serial port connection.
data - the data string to be written.
Throws an exception when is called before a connection has been established.
This module is available under a FreeBSD license, see the LICENSE file for details.
FAQs
Bluetooth serial port communication for Node.js
The npm package bluetooth-serial-port receives a total of 104 weekly downloads. As such, bluetooth-serial-port popularity was classified as not popular.
We found that bluetooth-serial-port demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.