@onbright/bluetooth-sdk
Advanced tools
Comparing version 1.1.23 to 1.1.24
@@ -9,7 +9,18 @@ interface Communication { | ||
notify: string; | ||
read: string; | ||
}; | ||
interface ProtocolComponent { | ||
onProcessingSentData: onProcessingSentData; | ||
onProcessNotifyData: onProcessNotifyData; | ||
onProcessReadData: onProcessReadData; | ||
} | ||
type onProcessingSentData = (sentData: Uint8Array) => Promise<Uint8Array>; | ||
type onProcessNotifyData = (receivedData: WechatMiniprogram.OnBLECharacteristicValueChangeListenerResult) => Promise<any>; | ||
type onProcessReadData = (receivedData: WechatMiniprogram.OnBLECharacteristicValueChangeListenerResult) => Promise<any>; | ||
declare class BluetoothManager { | ||
private _ConnectHandler; | ||
private _ScanHandler; | ||
private _DataHandler; | ||
private _BluetoothCallbackManager; | ||
@@ -19,5 +30,7 @@ constructor(); | ||
setConnectHandler(communication: Communication): void; | ||
setDataHandler(protocolComponent: ProtocolComponent): void; | ||
addBluetoothEventCallback(callback: BluetoothEventCallback): void; | ||
removeBluetoothEventCallback(callback: BluetoothEventCallback): void; | ||
sanDevice(): void; | ||
startDeviceScan(): void; | ||
stopDeviceScan(): void; | ||
isConnected(): boolean | null; | ||
@@ -30,2 +43,3 @@ getConnectedDevice(): WechatMiniprogram.BlueToothDevice | null; | ||
sendData(deviceId: string, data: Uint8Array): boolean; | ||
readData(deviceId: string): void; | ||
private _SendData; | ||
@@ -43,2 +57,3 @@ private _onScanFound; | ||
declare class BluetoothEventCallback { | ||
onPermissionDenied(): void; | ||
onAdapter(res: WechatMiniprogram.OnBluetoothAdapterStateChangeListenerResult): void; | ||
@@ -52,3 +67,3 @@ onFoundDev(devices: WechatMiniprogram.BlueToothDevice[]): void; | ||
onDevStatusMTUChange(dev: WechatMiniprogram.BlueToothDevice, mtu: number): void; | ||
onTransmitDeviceData(res: WechatMiniprogram.OnBLECharacteristicValueChangeListenerResult): BluetoothProtocol.ResponseBase<BluetoothProtocol.DoorViewer.BasePayloadResponse> | null; | ||
onTransmitDeviceData(res: any): void; | ||
} | ||
@@ -63,2 +78,2 @@ | ||
export { type BLEDeviceCharacteristicsMap, type Communication, _default as default }; | ||
export { type BLEDeviceCharacteristicsMap, type Communication, type ProtocolComponent, _default as default }; |
{ | ||
"name": "@onbright/bluetooth-sdk", | ||
"version": "1.1.23", | ||
"version": "1.1.24", | ||
"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
368152
4839