Skip to content

Commit

Permalink
V2.0.3版本发布
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyaoyou1212 committed Nov 14, 2017
1 parent e002054 commit 929c9c0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- **项目地址:**[https://github.com/xiaoyaoyou1212/BLE](https://github.com/xiaoyaoyou1212/BLE)

- **项目依赖:**`compile 'com.vise.xiaoyaoyou:baseble:2.0.2'`
- **项目依赖:**`compile 'com.vise.xiaoyaoyou:baseble:2.0.3'`

## 功能
- **支持多设备连接管理;**
Expand Down Expand Up @@ -43,10 +43,10 @@
打造该库的目的是为了简化蓝牙设备接入的流程。该库是 BLE 操作的基础框架,只处理 BLE 设备通信逻辑,不包含具体的数据处理,如数据的分包与组包等。该库提供了多设备连接管理,可配置最大连接数量,并在超过最大连接数时会依据 Lru 算法自动断开最近最久未使用设备。该库还定制了常用的扫描设备过滤规则,也支持自定义过滤规则。该库所有操作都采用回调机制告知上层调用的结果,操作简单,接入方便。

## 版本说明
[![LatestVersion](https://img.shields.io/badge/LatestVersion-2.0.2-orange.svg)](https://github.com/xiaoyaoyou1212/BLE/blob/master/VERSION.md)
[![LatestVersion](https://img.shields.io/badge/LatestVersion-2.0.3-orange.svg)](https://github.com/xiaoyaoyou1212/BLE/blob/master/VERSION.md)

## 代码托管
[![JCenter](https://img.shields.io/badge/JCenter-2.0.2-orange.svg)](https://jcenter.bintray.com/com/vise/xiaoyaoyou/baseble/2.0.2/)
[![JCenter](https://img.shields.io/badge/JCenter-2.0.3-orange.svg)](https://jcenter.bintray.com/com/vise/xiaoyaoyou/baseble/2.0.3/)

## 常见问题
[![FAQ](https://img.shields.io/badge/FAQ-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98-red.svg)](https://github.com/xiaoyaoyou1212/BLE/blob/master/FAQ.md)
Expand All @@ -71,7 +71,7 @@
### 引入 SDK
在工程 module 的 build.gradle 文件中的 dependencies 中添加如下依赖:
```
compile 'com.vise.xiaoyaoyou:baseble:2.0.2'
compile 'com.vise.xiaoyaoyou:baseble:2.0.3'
```
构建完后就可以直接使用该库的功能了。

Expand Down
3 changes: 3 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## 版本说明
- V2.0.3(2017-11-14)
- 增加解绑通道的 API。

- V2.0.2(2017-11-10)
- 修复操作数据回调异常;
- 增加获取设备连接失败正在重试次数的 API;
Expand Down
4 changes: 2 additions & 2 deletions baseble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 18
targetSdkVersion 23
versionCode 22
versionName "2.0.2"
versionCode 23
versionName "2.0.3"
}
buildTypes {
release {
Expand Down
21 changes: 21 additions & 0 deletions baseble/src/main/java/com/vise/baseble/core/DeviceMirror.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,27 @@ public synchronized void bindChannel(IBleCallback bleCallback, BluetoothGattChan
}
}

/**
* 解绑通道
*
* @param bluetoothGattChannel
*/
public synchronized void unbindChannel(BluetoothGattChannel bluetoothGattChannel) {
if (bluetoothGattChannel != null) {
String key = bluetoothGattChannel.getGattInfoKey();
if (bleCallbackMap.containsKey(key)) {
bleCallbackMap.remove(key);
}
if (readInfoMap.containsKey(key)) {
readInfoMap.remove(key);
} else if (writeInfoMap.containsKey(key)) {
writeInfoMap.remove(key);
} else if (enableInfoMap.containsKey(key)) {
enableInfoMap.remove(key);
}
}
}

/**
* 写入数据
*
Expand Down

0 comments on commit 929c9c0

Please sign in to comment.