Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whilu/LMBluetoothSdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.4
Choose a base ref
...
head repository: whilu/LMBluetoothSdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 5 commits
  • 4 files changed
  • 2 contributors

Commits on Feb 7, 2017

  1. Copy the full SHA
    b6c82f4 View commit details

Commits on Feb 13, 2017

  1. Merge pull request #14 from shahimclt/state_change_fix

    fix previous commit breaking bluetooth state change observer
    whilu authored Feb 13, 2017
    Copy the full SHA
    89331f9 View commit details

Commits on Feb 16, 2017

  1. Release 1.0.5

    whilu committed Feb 16, 2017
    Copy the full SHA
    b6ffb96 View commit details

Commits on Feb 26, 2018

  1. Update README.md

    whilu committed Feb 26, 2018
    Copy the full SHA
    1824121 View commit details
  2. Update README.md

    whilu committed Feb 26, 2018
    Copy the full SHA
    47b88b8 View commit details
Showing with 28 additions and 16 deletions.
  1. +10 −7 README.md
  2. +2 −2 lmbluetoothsdk/build.gradle
  3. +11 −0 lmbluetoothsdk/project.properties
  4. +5 −7 lmbluetoothsdk/src/main/java/co/lujun/lmbluetoothsdk/service/BluetoothService.java
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ A library to make classic bluetooth or BLE easier to use in Android.

```groovy
dependencies {
compile 'co.lujun:lmbluetoothsdk:1.0.4'
compile 'co.lujun:lmbluetoothsdk:1.0.5'
}
```

@@ -26,7 +26,7 @@ dependencies {
<dependency>
<groupId>co.lujun</groupId>
<artifactId>lmbluetoothsdk</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<packaging>aar</packaging>
</dependency>
```
@@ -155,7 +155,7 @@ Now the initialization step has been completed, you can use the following functi
| getConnectedDevice() | | connected remote device | get the connected remote device
| release() | | | release the instance resources, if you want to use again, use the instance's ```build(Context)``` method build again

** Note: In Android6.0+, you have to ask the user explicitly about `ACCESS_COARSE_LOCATION` permission, because `BluetoothDevice.ACTION_FOUND` require `ACCESS_COARSE_LOCATION` permission when search classic bluetooth devices.**
**Note: In Android6.0+, you have to ask the user explicitly about `ACCESS_COARSE_LOCATION` permission, because `BluetoothDevice.ACTION_FOUND` require `ACCESS_COARSE_LOCATION` permission when search classic bluetooth devices.**

## Public methods for BluetoothController

@@ -191,19 +191,22 @@ Manufacturing bluetooth connection status, there are 6 states in the class.
| STATE_GOT_CHARACTERISTICS | 6 | got all characteristics

## Change logs
###1.0.4(2017-2-6)
### 1.0.5(2017-2-16)
- bug fix

###1.0.2(2016-3-15)
### 1.0.4(2017-2-6)
- bug fix

### 1.0.2(2016-3-15)
- Add ```RSSI``` value for scan callback
- Add ```STATE_GOT_CHARACTERISTICS``` state for got all characteristics
- fixed issue [#3](https://github.com/whilu/LMBluetoothSdk/issues/3)

###1.0.1(2016-2-2)
### 1.0.1(2016-2-2)
- sync to Maven
- fixed issue [#2](https://github.com/whilu/LMBluetoothSdk/issues/2)

###1.0.0(2016-1-26)
### 1.0.0(2016-1-26)
- First release

## Sample App
4 changes: 2 additions & 2 deletions lmbluetoothsdk/build.gradle
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 104
versionName "1.0.4"
versionCode 105
versionName "1.0.5"
}
buildTypes {
release {
11 changes: 11 additions & 0 deletions lmbluetoothsdk/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#project
project.name=LMBluetoothSdk
project.description=A library to make classic bluetooth or BLE easier to use in Android
project.groupId=co.lujun
project.artifactId=lmbluetoothsdk
project.packaging=aar
project.siteUrl=https://github.com/whilu/LMBluetoothSdk
project.gitUrl=https://github.com/whilu/LMBluetoothSdk.git

#javadoc
javadoc.name=LMBluetoothSdk
Original file line number Diff line number Diff line change
@@ -356,13 +356,11 @@ public void run() {
int bytes;
while (true) {
try {
if (mmInStream.available()>0) {
bytes = mmInStream.read(buffer);
if (bytes>0) {
byte[] data = Arrays.copyOf(buffer,bytes);
if (mBluetoothListener != null) {
((BluetoothListener) mBluetoothListener).onReadData(mmSocket.getRemoteDevice(), data);
}
bytes = mmInStream.read(buffer);
if (bytes > 0) {
byte[] data = Arrays.copyOf(buffer, bytes);
if (mBluetoothListener != null) {
((BluetoothListener) mBluetoothListener).onReadData(mmSocket.getRemoteDevice(), data);
}
}
} catch (IOException e) {