Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ficat committed Jan 22, 2025
1 parent 36cff52 commit c0beb42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EasyBle
EasyBle is a framework used for android BLE, this framework makes android Ble operation simpler and supports basic BLE operations, besides, it also support batch writing data and multi connection
>The version 1.0.x is no longer maintained , please use or update to the newest version(2.0.x)
EasyBle is a framework used for android BLE, it makes android Ble operation simpler and supports basic BLE operations
>On android12 or higher devices, BLE requires some permissions, please use or update it to the newest version(3.0.x)
[中文文档](doc/README_CN.md)

Expand All @@ -13,13 +13,13 @@ allprojects {
}
dependencies {
implementation 'com.github.Ficat:EasyBle:v2.0.2'
implementation 'com.github.Ficat:EasyBle:v3.0.0'
}
```

## Usage
The framework uses BleManager to manager BLE
### 1.Check if the device supports BLE, request BLE required permissions and turn on bluetooth. <br>
### 1.Check if the device supports BLE, request BLE required permissions and turn on bluetooth.<br>
[See BLE permission details](doc/README_MORE.md)
```java
// Check if the device supports BLE
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies {
```

### 3.Scan
On API23+ or higher devices, scan requires some permissions, so ensure all BLE permissions have been granted. <br>
On API23+ or higher devices, scan requires some permissions, so ensure all BLE permissions have been granted.
[How to use BleDevice to carry extra info](doc/README_MORE.md).
```java
bleManager.startScan(new BleScanCallback() {
Expand Down Expand Up @@ -108,8 +108,8 @@ Once target remote device has been discovered you can use stopScan() to stop sca
```

### 4.Connect
You can connect to remote device by device address or BleDevice object. Like scan, now connection also requires permissions.<br>
By default, all operation(like connect/notify/read/write/setMtu/readRssi and so on) callbacks run in UI-Thread, but you can select a thread to run them[How to select a thread to run all operation callbacks](doc/README_MORE.md).
You can connect to remote device by device address or BleDevice object. Like scan, now connection also requires permissions.
By default, all operation(like connect/notify/read/write/setMtu/readRssi and so on) callbacks run in UI-Thread, but you can select a thread to run them. [How to select a thread to run all operation callbacks](doc/README_MORE.md).
```java

BleConnectCallback bleConnectCallback = new BleConnectCallback() {
Expand Down
17 changes: 8 additions & 9 deletions doc/README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EasyBle
EasyBle主要用于简化安卓BLE操作流程,降低BLE开发繁琐程度。本库支持扫描(含自定义过滤条件扫描)、连接(包括设备多连接)、设备服务查询、读写数据(含分批写入)、读取设备信号、设置最大传输单元等BLE操作
>由于个人原因不再维护1.0.x,请使用或升级到最新版本(2.0.x)
>由于Android12起蓝牙权限等发生变化,故请使用或升级到最新版本(3.0.x)
## Gradle dependency
```gradle
allprojects {
Expand All @@ -11,15 +11,14 @@ allprojects {
dependencies {
implementation 'com.github.Ficat:EasyBle:v2.0.2'
implementation 'com.github.Ficat:EasyBle:v3.0.0'
}
```

## Usage
本库主要通过BleManager类来进行BLE操作
### 1.判断设备是否支持BLE并打开蓝牙.
<br>
[查看蓝牙所需权限详情](doc/README_MORE_CN.md)
### 1.判断设备是否支持BLE并打开蓝牙.<br>
[查看蓝牙所需权限详情](README_MORE_CN.md)
```java
// 是否支持BLE
BleManager.supportBle(context);
Expand Down Expand Up @@ -67,8 +66,8 @@ dependencies {
```

### 3.扫描
安卓版本不小于6.0的,扫描需要BLE权限,因此扫描前确保所有BLE权限已被授予.<br>
[如何使用BleDevice存储或携带额外信息](doc/README_MORE_CN.md).
安卓版本不小于6.0的,扫描需要BLE权限,因此扫描前确保所有BLE权限已被授予.
[如何使用BleDevice存储或携带额外信息](README_MORE_CN.md).
```java
bleManager.startScan(new BleScanCallback() {
@Override
Expand Down Expand Up @@ -102,8 +101,8 @@ dependencies {
```

### 4.连接
你可以使用BleDevice对象或mac地址连接设备<br>
默认情况下,所有操作回调(connect/notify/read/write/readRssi/setMtu等等)都将运行在主线程, 当然你可以选择其运行在子线程[如何选择一个线程来运行所有出扫描外的回调](doc/README_MORE_CN.md).
你可以使用BleDevice对象或mac地址连接设备.默认情况下,所有操作回调(connect/notify/read/write/readRssi/setMtu等等)都将运行在主线程,
当然你可以选择其运行在子线程[如何选择一个线程来运行所有出扫描外的回调](README_MORE_CN.md).
```java

BleConnectCallback bleConnectCallback = new BleConnectCallback() {
Expand Down

0 comments on commit c0beb42

Please sign in to comment.