New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ssb-mobile-bluetooth-manager

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-mobile-bluetooth-manager - npm Package Compare versions

Comparing version

to
2.0.12

50

index.js

@@ -263,2 +263,51 @@ const net = require('net');

function getValidAddresses(devices, cb) {
var results = [];
var count = 0;
devices.forEach( (device, num) => {
// Leave some grace seconds so it's not complete spam..
setTimeout( () => {
getMetadataForDevice(device.remoteAddress, (err, res) => {
count = count + 1;
console.log("getValidAddresses count: " + count)
if (!err) {
console.log(device.remoteAddress + " is available for scuttlebutt bluetooth connections");
device.id = res.id;
results.push(device);
}
if (count === devices.length) {
console.log("Calling back (get valid addresses)...");
console.log("Valid addresses:");
console.log(device);
cb(null, {
"discovered": results,
"lastUpdate": Date.now()
});
}
});
}, num * 2000);
})
}
function nearbyScuttlebuttDevices(refreshInterval) {
return pull(
nearbyDevices(refreshInterval),
pull.asyncMap( (result, cb) => {
console.log("Result is? ");
console.log(result);
getValidAddresses(result.discovered, cb)
})
)
}
function nearbyDevices(refreshInterval) {

@@ -382,2 +431,3 @@

nearbyDevices,
nearbyScuttlebuttDevices,
makeDeviceDiscoverable,

@@ -384,0 +434,0 @@ getMetadataForDevice,

2

package.json
{
"name": "ssb-mobile-bluetooth-manager",
"version": "2.0.11",
"version": "2.0.12",
"description": "A module for managing bluetooth connections over a react native bridge.",

@@ -5,0 +5,0 @@ "main": "index.js",