Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for descriptors #40

Merged
merged 8 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions android/library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,12 @@ dependencies {
implementation "com.polidea.rxandroidble:rxandroidble:1.7.0"
testImplementation 'junit:junit:4.12'
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives sourcesJar
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.polidea.multiplatformbleadapter.errors.BleError;

import java.util.List;

public interface BleAdapter {

void createClient(String restoreStateIdentifier,
Expand Down Expand Up @@ -84,13 +86,28 @@ void discoverAllServicesAndCharacteristicsForDevice(
OnSuccessCallback<Device> onSuccessCallback,
OnErrorCallback onErrorCallback);

Service[] getServicesForDevice(String deviceIdentifier) throws BleError;
List<Service> getServicesForDevice(
String deviceIdentifier) throws BleError;

Characteristic[] getCharacteristicsForDevice(
List<Characteristic> getCharacteristicsForDevice(
String deviceIdentifier,
String serviceUUID) throws BleError;

Characteristic[] getCharacteristicsForService(int serviceIdentifier) throws BleError;
List<Characteristic> getCharacteristicsForService(
int serviceIdentifier) throws BleError;

List<Descriptor> descriptorsForDevice(
String deviceIdentifier,
String serviceUUID,
String characteristicUUID) throws BleError;

List<Descriptor> descriptorsForService(
int serviceIdentifier,
String characteristicUUID) throws BleError;

List<Descriptor> descriptorsForCharacteristic(
int characteristicIdentifier) throws BleError;


void readCharacteristicForDevice(
String deviceIdentifier,
Expand Down Expand Up @@ -161,6 +178,70 @@ void monitorCharacteristic(
OnEventCallback<Characteristic> onEventCallback,
OnErrorCallback onErrorCallback);

void readDescriptorForDevice(
final String deviceId,
final String serviceUUID,
final String characteristicUUID,
final String descriptorUUID,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void readDescriptorForService(
final int serviceIdentifier,
final String characteristicUUID,
final String descriptorUUID,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void readDescriptorForCharacteristic(
final int characteristicIdentifier,
final String descriptorUUID,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void readDescriptor(
final int descriptorIdentifier,
final String transactionId,
OnSuccessCallback<Descriptor> onSuccessCallback,
OnErrorCallback onErrorCallback);

void writeDescriptorForDevice(
final String deviceId,
final String serviceUUID,
final String characteristicUUID,
final String descriptorUUID,
final String valueBase64,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void writeDescriptorForService(
final int serviceIdentifier,
final String characteristicUUID,
final String descriptorUUID,
final String valueBase64,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void writeDescriptorForCharacteristic(
final int characteristicIdentifier,
final String descriptorUUID,
final String valueBase64,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void writeDescriptor(
final int descriptorIdentifier,
final String valueBase64,
final String transactionId,
OnSuccessCallback<Descriptor> successCallback,
OnErrorCallback errorCallback);

void cancelTransaction(String transactionId);

void setLogLevel(String logLevel);
Expand Down
Loading