Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-bluetooth-adapter

Package Overview
Dependencies
6
Maintainers
6
Versions
164
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.100

118

dist/cjs/base/BlueToothAdapter.js

@@ -227,4 +227,6 @@ "use strict";

}
// 当前不可用
throw { errCode: 10001 };
else {
// 当前不可用
throw { errCode: 10001 };
}
}

@@ -276,4 +278,3 @@ await Promise.all([

this._bluetoothApi.offBluetoothDeviceFound(handleBlueToothDeviceFound);
this._deviceAdapterStore.getAll()
.forEach((deviceAdapter) => {
this._deviceAdapterStore.getAll().forEach((deviceAdapter) => {
if (deviceAdapter.isConnected) {

@@ -612,20 +613,14 @@ this.onBleConnectionStateChange({

// 必须在这里挂载实例,因为连接设备时触发的一些回调是从 this._deviceMap 上去找 deviceAdapter 触发的
try {
deviceAdapter = new DeviceAdapter({
deviceId,
deviceName,
// 标准蓝牙协议在设备里面是有productId写入的
productId,
name,
actions: this._actions,
bluetoothApi: this._bluetoothApi,
h5Websocket: this._h5Websocket,
extendInfo,
bluetoothAdapter: this,
});
}
catch (e) {
console.log('是实例化错了吗', e);
throw e;
}
deviceAdapter = new DeviceAdapter({
deviceId,
deviceName,
// 标准蓝牙协议在设备里面是有productId写入的
productId,
name,
actions: this._actions,
bluetoothApi: this._bluetoothApi,
h5Websocket: this._h5Websocket,
extendInfo,
bluetoothAdapter: this,
});
this._deviceAdapterStore.set(deviceAdapter);

@@ -681,20 +676,13 @@ deviceAdapter

productId = productId || this._productIdMap[serviceId];
let deviceAdapter;
try {
deviceAdapter = this.instantiateDeviceAdapter({
deviceId,
serviceId,
deviceName,
name,
productId,
extendInfo,
}, {
DeviceAdapter: SpecificDeviceAdapter,
reuseAdapterInstance,
});
}
catch (e) {
console.log('猜测这里错了 instantiateDeviceAdapter', e);
throw e;
}
const deviceAdapter = this.instantiateDeviceAdapter({
deviceId,
serviceId,
deviceName,
name,
productId,
extendInfo,
}, {
DeviceAdapter: SpecificDeviceAdapter,
reuseAdapterInstance,
});
if (deviceAdapter === null || deviceAdapter === void 0 ? void 0 : deviceAdapter.isConnected) {

@@ -749,27 +737,29 @@ return deviceAdapter;

}
const deviceInfo = await this.searchDevice({
deviceId,
serviceId,
serviceIds,
deviceName,
productId,
ignoreDeviceIds,
timeout,
extendInfo,
ignoreWarning: true,
disableCache,
DeviceAdapter,
});
if (!deviceInfo) {
return Promise.reject({ code: 'DeviceNotFound', msg: `未搜索到设备 ${productId}/${deviceName}` });
else {
const deviceInfo = await this.searchDevice({
deviceId,
serviceId,
serviceIds,
deviceName,
productId,
ignoreDeviceIds,
timeout,
extendInfo,
ignoreWarning: true,
disableCache,
DeviceAdapter,
});
if (!deviceInfo) {
return Promise.reject({ code: 'DeviceNotFound', msg: `未搜索到设备 ${productId}/${deviceName}` });
}
if (!deviceInfo.productId && productId) {
deviceInfo.productId = productId;
}
deviceAdapter = await this.connectDevice(deviceInfo, {
autoNotify,
disableCache,
DeviceAdapter,
});
return deviceAdapter;
}
if (!deviceInfo.productId && productId) {
deviceInfo.productId = productId;
}
deviceAdapter = await this.connectDevice(deviceInfo, {
autoNotify,
disableCache,
DeviceAdapter,
});
return deviceAdapter;
}

@@ -776,0 +766,0 @@ async startScanAdvert() {

{
"name": "qcloud-iotexplorer-bluetooth-adapter",
"version": "3.0.0",
"version": "3.0.100",
"description": "",

@@ -21,7 +21,7 @@ "bugs": {

"dependencies": {
"event-emitter-for-miniprogram": "3.0.0",
"event-emitter-for-miniprogram": "3.0.100",
"lodash.uniqwith": "^4.5.0",
"qcloud-iotexplorer-appdev-sdk": "3.0.0",
"qcloud-iotexplorer-common-libs": "3.0.0",
"qcloud-iotexplorer-logger": "3.0.0",
"qcloud-iotexplorer-appdev-sdk": "3.0.100",
"qcloud-iotexplorer-common-libs": "3.0.100",
"qcloud-iotexplorer-logger": "3.0.100",
"tslib": "^2.1.0"

@@ -33,3 +33,3 @@ },

},
"gitHead": "fb4a4e7443c024ec8bfdf3429460e7e679736297"
"gitHead": "4e451f32fe10fea66b27c825bf082719eb419752"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc