Skip to content

Commit

Permalink
Merge branch 'rc/4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Activelook-dev committed Jan 27, 2023
2 parents 0ef56f2 + ddde456 commit 79d0501
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,21 @@ void reconnect(final BluetoothDevice device) {
this.gatt = this.gattDelegate;
}

private void optimizeMtu(final int optimalMtu) {
if (optimalMtu > this.mtu) {
if (!this.gatt.requestMtu(optimalMtu)) {
this.optimizeMtu(optimalMtu - 1);
private void optimizeMtu(int optimalMtu) {
while (optimalMtu > this.mtu) {
if (this.gatt.requestMtu(optimalMtu)) {
return;
}
optimalMtu = optimalMtu - 1;
}
int errorCount = 0;
while (!this.gatt.discoverServices()) {
errorCount = errorCount + 1;
if (errorCount > 10) {
this.unlockConnection();
this.disconnect();
return;
}
} else if (!this.gatt.discoverServices()) {
this.optimizeMtu(optimalMtu);
}
}

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## Version 4.4.1

### Fixes
- Remove recursive call to avoid stackoverflow

## Version 4.4.0

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ You can add the dependency in your application by modifying the application `bui
and add:
```
dependencies {
implementation 'com.github.activelook:android-sdk:v4.4.0'
implementation 'com.github.activelook:android-sdk:v4.4.1'
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.sdkGroupId = "com.activelook"
ext.sdkVersionCode = 440
ext.sdkVersionName = '4.4.0'
ext.sdkVersionCode = 441
ext.sdkVersionName = '4.4.1'
ext.kotlin_version = '1.6.21'
repositories {
google()
Expand Down

0 comments on commit 79d0501

Please sign in to comment.