Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onbright/bluetooth-sdk

Package Overview
Dependencies
Maintainers
0
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onbright/bluetooth-sdk - npm Package Compare versions

Comparing version 1.1.20 to 1.1.21

62

dist/index.d.ts

@@ -1,6 +0,53 @@

declare enum ServiceType {
WIFI_BLUE = 0,
THEME_BLUE = 1
interface Communication {
onMatchingService(services: WechatMiniprogram.BLEService[]): WechatMiniprogram.BLEService | null;
onMatchingServiceCharacteristic(): BLEDeviceCharacteristicsMap;
onMatchingConnectDevice(devices: WechatMiniprogram.BlueToothDevice[]): WechatMiniprogram.BlueToothDevice | null;
}
type BLEDeviceCharacteristicsMap = {
write: string;
notify: string;
};
declare class ConnectHandler {
private status;
private callback;
private currentDevice;
private disconnectTime;
private mtu;
private maxMTU;
private communicationService;
private communicationWriteCharacteristic;
private communication;
constructor(communication: Communication);
connect(device: WechatMiniprogram.BlueToothDevice, isOTA: boolean): boolean;
setMaxMTU(mtu: number): void;
disconnect(): void;
setCallback(callback: ConnectCallback | null): void;
getConnectedDevice(): WechatMiniprogram.BlueToothDevice | null;
getCommunicationService(): WechatMiniprogram.BLEService | null;
getCommunication(): Communication;
getCommunicationWriteCharacteristic(): WechatMiniprogram.BLECharacteristic | null;
getMTU(): number | undefined;
isConnectedOrConnecting(): boolean;
isConnecting(): boolean;
isConnected(): boolean;
private _registerConnStatusListener;
private _getBLEDeviceServices;
private _getBLEDeviceCharacteristics;
private _notifyBLECharacteristicValueChange;
private _disconnect;
private _connectFailed;
private _connectSuccsed;
}
interface ConnectCallback {
onDisconnect?: ConnectDisconnectCallback;
onFailed?: ConnectFailedCallback;
onSuccess?: ConnectSuccessCallback;
onMTUChange?: DeviceMTUChangeCallback;
}
type ConnectDisconnectCallback = (result: WechatMiniprogram.BlueToothDevice) => void;
type ConnectFailedCallback = (result: WechatMiniprogram.BlueToothDevice) => void;
type ConnectSuccessCallback = (result: WechatMiniprogram.BlueToothDevice) => void;
type DeviceMTUChangeCallback = (result: WechatMiniprogram.BlueToothDevice, mtu: number) => void;
declare class BluetoothManager {

@@ -12,12 +59,12 @@ private _ConnectHandler;

private init;
setConnectHandler(connectHandler: ConnectHandler): void;
addBluetoothEventCallback(callback: BluetoothEventCallback): void;
removeBluetoothEventCallback(callback: BluetoothEventCallback): void;
sanDevice(): void;
isConnected(): boolean;
isConnected(): boolean | null;
getConnectedDevice(): WechatMiniprogram.BlueToothDevice | null;
connectDevice(device: WechatMiniprogram.BlueToothDevice, isOTA: boolean): boolean;
connectDevice(device: WechatMiniprogram.BlueToothDevice, isOTA: boolean): boolean | null;
disconnectDevice(): void;
setScanTime(scanTime?: number): void;
setServices(services: Array<string>): void;
setConnectService(serviceType: ServiceType): void;
sendData(deviceId: string, data: Uint8Array): boolean;

@@ -52,5 +99,4 @@ private _SendData;

GenerationRule: typeof GenerationRule;
ServiceType: typeof ServiceType;
};
export { _default as default };
export { type BLEDeviceCharacteristicsMap, type Communication, _default as default };

2

package.json
{
"name": "@onbright/bluetooth-sdk",
"version": "1.1.20",
"version": "1.1.21",
"scripts": {

@@ -5,0 +5,0 @@ "build": "tsup",

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 too big to display

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