Skip to content

Commit d2666f4

Browse files
committed
update call back function.
1 parent 6f99c19 commit d2666f4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcblekit",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "该微信小程序开源代码库用于管理微信小程序中的蓝牙功能。支持初始化蓝牙适配器、扫描和连接蓝牙设备、获取设备服务和特征、监听特征值变化、读写特征值以及断开连接等操作。通过设置不同的监听器,可灵活处理蓝牙连接状态变化、设备发现、服务和特征发现等事件,适用于需要与蓝牙设备进行数据交互的微信小程序开发场景。This WeChat mini program open-source code library is used to manage the Bluetooth function in WeChat mini programs. Support initialization of Bluetooth adapters, scanning and connecting Bluetooth devices, obtaining device services and features, monitoring feature value changes, reading and writing feature values, and disconnecting. By setting different listeners, it is possible to flexibly handle events such as changes in Bluetooth connection status, device discovery, service and feature discovery, which is suitable for WeChat mini program development scenarios that require data interaction with Bluetooth devices. ",
55
"main": "src/MCBleKit.js",
66
"scripts": {

src/MCBleKit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Object.defineProperty(MCBleKit.prototype, 'connected', {
102102
if (this._connected!== value) {
103103
this._connected = value;
104104
if (typeof this.connectedStatusChangeListener === 'function') {
105-
this.connectedStatusChangeListener();
105+
this.connectedStatusChangeListener(value);
106106
}
107107
}
108108
}
@@ -113,7 +113,7 @@ Object.defineProperty(MCBleKit.prototype, 'connecting', {
113113
if (this._connecting!== value) {
114114
this._connecting = value;
115115
if (typeof this.connectingStatusChangeListener === 'function') {
116-
this.connectingStatusChangeListener();
116+
this.connectingStatusChangeListener(value);
117117
}
118118
}
119119
}
@@ -227,7 +227,7 @@ MCBleKit.prototype.onBluetoothDeviceFound = function () {
227227
}
228228
});
229229
that.devices = bluetoothDataList;
230-
that.bluetoothDeviceFoundListener();
230+
that.bluetoothDeviceFoundListener(that.devices);
231231
});
232232
};
233233

0 commit comments

Comments
 (0)