Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-bluetooth-adapter

Package Overview
Dependencies
Maintainers
6
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcloud-iotexplorer-bluetooth-adapter - npm Package Compare versions

Comparing version 3.0.0-alpha.20230507b003 to 3.0.0-alpha.20240118b004

23

dist/cjs/base/DeviceAdapter.js

@@ -304,9 +304,9 @@ "use strict";

}
async write(data, { writeId = '', serviceId = '', } = {}) {
async write(data, { writeId = '', serviceId = '', writeType, } = {}) {
if (typeof data === 'string') {
data = hexToArrayBuffer(data);
}
return this._write(data, { writeId, serviceId });
return this._write(data, { writeId, serviceId, writeType });
}
async _write(value, { writeId = '', serviceId = '', } = {}) {
async _write(value, { writeId = '', serviceId = '', writeType, } = {}) {
try {

@@ -317,2 +317,3 @@ await this._bluetoothApi.writeBLECharacteristicValue({

serviceId: serviceId || this.serviceId,
writeType,
value,

@@ -342,2 +343,4 @@ });

readIds: [],
writeNoResponseIds: [],
writeDefaultIds: [],
};

@@ -349,15 +352,21 @@ const setCharacteristicsId = (idSet, uuid) => {

};
characteristics.forEach(({ uuid, properties: { notify, write, indicate, read, }, }) => {
characteristics.forEach(({ uuid, properties: { notify, write, indicate, read, writeNoResponse, writeDefault, }, }) => {
if (notify) {
setCharacteristicsId(map.notifyIds, uuid);
}
else if (write) {
if (write) {
setCharacteristicsId(map.writeIds, uuid);
}
else if (indicate) {
if (indicate) {
setCharacteristicsId(map.indicateIds, uuid);
}
else if (read) {
if (read) {
setCharacteristicsId(map.readIds, uuid);
}
if (writeNoResponse) {
setCharacteristicsId(map.writeNoResponseIds, uuid);
}
if (writeDefault) {
setCharacteristicsId(map.writeDefaultIds, uuid);
}
});

@@ -364,0 +373,0 @@ this.characteristicsMap[serviceId] = map;

@@ -301,9 +301,9 @@ import { __rest } from "tslib";

}
async write(data, { writeId = '', serviceId = '', } = {}) {
async write(data, { writeId = '', serviceId = '', writeType, } = {}) {
if (typeof data === 'string') {
data = hexToArrayBuffer(data);
}
return this._write(data, { writeId, serviceId });
return this._write(data, { writeId, serviceId, writeType });
}
async _write(value, { writeId = '', serviceId = '', } = {}) {
async _write(value, { writeId = '', serviceId = '', writeType, } = {}) {
try {

@@ -314,2 +314,3 @@ await this._bluetoothApi.writeBLECharacteristicValue({

serviceId: serviceId || this.serviceId,
writeType,
value,

@@ -339,2 +340,4 @@ });

readIds: [],
writeNoResponseIds: [],
writeDefaultIds: [],
};

@@ -346,15 +349,21 @@ const setCharacteristicsId = (idSet, uuid) => {

};
characteristics.forEach(({ uuid, properties: { notify, write, indicate, read, }, }) => {
characteristics.forEach(({ uuid, properties: { notify, write, indicate, read, writeNoResponse, writeDefault, }, }) => {
if (notify) {
setCharacteristicsId(map.notifyIds, uuid);
}
else if (write) {
if (write) {
setCharacteristicsId(map.writeIds, uuid);
}
else if (indicate) {
if (indicate) {
setCharacteristicsId(map.indicateIds, uuid);
}
else if (read) {
if (read) {
setCharacteristicsId(map.readIds, uuid);
}
if (writeNoResponse) {
setCharacteristicsId(map.writeNoResponseIds, uuid);
}
if (writeDefault) {
setCharacteristicsId(map.writeDefaultIds, uuid);
}
});

@@ -361,0 +370,0 @@ this.characteristicsMap[serviceId] = map;

@@ -123,9 +123,11 @@ /// <reference types="miniprogram-api-typings" />

autoNotifyCharacteristics(): Promise<void>;
write(data: any, { writeId, serviceId, }?: {
write(data: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: 'write' | 'writeNoResponse';
}): Promise<void>;
_write(value: any, { writeId, serviceId, }?: {
_write(value: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: 'write' | 'writeNoResponse';
}): Promise<void>;

@@ -132,0 +134,0 @@ getBLEDeviceServices(): Promise<any>;

@@ -72,5 +72,6 @@ import { DeviceAdapter } from '../base';

autoNotifyCharacteristics(): Promise<void>;
_write(value: any, { writeId, serviceId, }?: {
_write(value: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;

@@ -187,5 +188,6 @@ getBLEDeviceServices(): Promise<any>;

autoNotifyCharacteristics(): Promise<void>;
_write(value: any, { writeId, serviceId, }?: {
_write(value: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;

@@ -192,0 +194,0 @@ getBLEDeviceServices(): Promise<any>;

@@ -66,9 +66,11 @@ import { DeviceAdapter } from '../base';

autoNotifyCharacteristics(): Promise<void>;
write(data: any, { writeId, serviceId, }?: {
write(data: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;
_write(value: any, { writeId, serviceId, }?: {
_write(value: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;

@@ -183,9 +185,11 @@ getBLEDeviceServices(): Promise<any>;

autoNotifyCharacteristics(): Promise<void>;
write(data: any, { writeId, serviceId, }?: {
write(data: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;
_write(value: any, { writeId, serviceId, }?: {
_write(value: any, { writeId, serviceId, writeType, }?: {
writeId?: string;
serviceId?: string;
writeType?: "write" | "writeNoResponse";
}): Promise<void>;

@@ -192,0 +196,0 @@ getBLEDeviceServices(): Promise<any>;

{
"name": "qcloud-iotexplorer-bluetooth-adapter",
"version": "3.0.0-alpha.20230507b003",
"version": "3.0.0-alpha.20240118b004",
"description": "",

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

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

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

},
"gitHead": "b64540d610a6b02a5400cb1e6e404949d378e5eb"
"gitHead": "6beca018526e761fba4197634612bd6c71179181"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc