🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

bare-bluetooth-android

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-bluetooth-android - npm Package Compare versions

Comparing version
0.2.1
to
0.3.0
+22
lib/errors.js
module.exports = class BluetoothError extends Error {
constructor(msg, fn = BluetoothError, code = fn.name) {
super(`${code}: ${msg}`)
this.code = code
if (Error.captureStackTrace) {
Error.captureStackTrace(this, fn)
}
}
get name() {
return 'BluetoothError'
}
static ADVERTISE_FAILED(msg) {
return new BluetoothError(msg, BluetoothError.ADVERTISE_FAILED)
}
static SCAN_FAILED(msg) {
return new BluetoothError(msg, BluetoothError.SCAN_FAILED)
}
}
+2
-1

@@ -7,2 +7,3 @@ const EventEmitter = require('bare-events')

const ScanResult = require('./scan-result')
const errors = require('./errors')

@@ -128,3 +129,3 @@ const STATES = {

_onscanfail(errorCode) {
this.emit('scanFail', errorCode)
this.emit('error', errors.SCAN_FAILED('Scan failed with error code ' + errorCode))
}

@@ -131,0 +132,0 @@ }

const EventEmitter = require('bare-events')
const binding = require('../binding')
const L2CAPChannel = require('./channel')
const errors = require('./errors')

@@ -169,3 +170,3 @@ const STATES = {

_onadvertiseerror(errorCode, error) {
this.emit('advertiseError', errorCode, error)
this.emit('error', errors.ADVERTISE_FAILED(error))
}

@@ -172,0 +173,0 @@

{
"name": "bare-bluetooth-android",
"version": "0.2.1",
"version": "0.3.0",
"description": "Android Bluetooth bindings for Bare",

@@ -5,0 +5,0 @@ "addon": true,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet