-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from Polidea/release/2.2.0
Release 2.2.0
- Loading branch information
Showing
90 changed files
with
2,014 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Example (debug)", | ||
"request": "launch", | ||
"type": "dart", | ||
"flutterMode": "debug" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
|
||
android.useAndroidX=false | ||
android.enableJetifier=false | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
android/src/main/java/com/polidea/flutter_ble_lib/converter/BleErrorJsonConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...main/java/com/polidea/flutter_ble_lib/converter/CharacteristicsResponseJsonConverter.java
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
...c/main/java/com/polidea/flutter_ble_lib/converter/ConnectionStateChangeJsonConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
android/src/main/java/com/polidea/flutter_ble_lib/converter/DescriptorJsonConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.polidea.flutter_ble_lib.converter; | ||
|
||
import com.polidea.multiplatformbleadapter.Descriptor; | ||
import com.polidea.multiplatformbleadapter.utils.Base64Converter; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
public class DescriptorJsonConverter implements JsonConverter<Descriptor> { | ||
|
||
|
||
private interface Metadata { | ||
String SERVICE_UUID = "serviceUuid"; | ||
String SERVICE_ID = "serviceId"; | ||
String CHARACTERISTIC_UUID = "characteristicUuid"; | ||
String CHARACTERISTIC_ID = "id"; | ||
String DESCRIPTOR_UUID = "descriptorUuid"; | ||
String DESCRIPTOR_ID = "descriptorId"; | ||
String DESCRIPTOR_VALUE = "value"; | ||
} | ||
|
||
@Override | ||
public String toJson(Descriptor descriptor) throws JSONException { | ||
JSONObject jsonObject = toJsonObject(descriptor); | ||
|
||
jsonObject.put(Metadata.SERVICE_ID, descriptor.getServiceId()); | ||
jsonObject.put(Metadata.SERVICE_UUID, descriptor.getServiceUuid()); | ||
jsonObject.put(Metadata.CHARACTERISTIC_ID, descriptor.getCharacteristicId()); | ||
jsonObject.put(Metadata.CHARACTERISTIC_UUID, descriptor.getCharacteristicUuid()); | ||
|
||
return jsonObject.toString(); | ||
} | ||
|
||
public JSONObject toJsonObject(Descriptor descriptor) throws JSONException { | ||
JSONObject jsonObject = new JSONObject(); | ||
|
||
|
||
jsonObject.put(Metadata.DESCRIPTOR_ID, descriptor.getId()); | ||
jsonObject.put(Metadata.DESCRIPTOR_UUID, descriptor.getUuid()); | ||
jsonObject.put(Metadata.DESCRIPTOR_VALUE, | ||
descriptor.getValue() != null ? | ||
Base64Converter.encode(descriptor.getValue()) | ||
: JSONObject.NULL); | ||
|
||
return jsonObject; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.