summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmesh Vats <uvats@codeaurora.org>2015-02-19 13:27:47 -0800
committerSudhir Sharma <sudhshar@codeaurora.org>2015-03-17 12:56:12 -0700
commitefab39f703c1033e22fd5693666c397930765ccf (patch)
tree8c7619c771d3534a7b70dcac3923407280d5e132
parent37e8129f7fa0416f3c5e6ca02db73f5ad873fb15 (diff)
downloadandroid_packages_apps_BluetoothExt-efab39f703c1033e22fd5693666c397930765ccf.tar.gz
android_packages_apps_BluetoothExt-efab39f703c1033e22fd5693666c397930765ccf.tar.bz2
android_packages_apps_BluetoothExt-efab39f703c1033e22fd5693666c397930765ccf.zip
Bluetooth-WiPower: DUT disconects 10 seconds after connection to iPad.
Two problems identified in the WiPower app: 1. Same UUID is being reused for PRU Alert characteristic and PRU Alert character Descriptor. 2. The PRU Alert description is being registered by the app, but onDescriptorReadRequest is not implemented The fix is: 1. The UUID value for the PRU alert descriptor has been modified to a different UUID. 2. onDescriptorReadRequest() is implemented. Change-Id: I933476d614aebc637a6ebcd6f0459a1ed5093a7b CRs-Fixed: 795938
-rw-r--r--src/org/codeaurora/bluetooth/a4wp/A4wpService.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/org/codeaurora/bluetooth/a4wp/A4wpService.java b/src/org/codeaurora/bluetooth/a4wp/A4wpService.java
index ebd4cc4..52f388f 100644
--- a/src/org/codeaurora/bluetooth/a4wp/A4wpService.java
+++ b/src/org/codeaurora/bluetooth/a4wp/A4wpService.java
@@ -98,7 +98,7 @@ public class A4wpService extends Service
private static final UUID A4WP_PRU_STATIC_UUID = UUID.fromString("6455e673-a146-11e2-9e96-0800200c9a67");
private static final UUID A4WP_PRU_DYNAMIC_UUID = UUID.fromString("6455e674-a146-11e2-9e96-0800200c9a67");
- private static final UUID A4WP_PRU_ALERT_DESC_UUID = UUID.fromString("6455e672-a146-11e2-9e96-0800200c9a67");
+ private static final UUID A4WP_PRU_ALERT_DESC_UUID = UUID.fromString("6455e675-a146-11e2-9e96-0800200c9a67");
private static final Object mLock = new Object();
private int mState = BluetoothProfile.STATE_DISCONNECTED;
@@ -738,6 +738,29 @@ public class A4wpService extends Service
offset, value);
}
}
+
+ @Override
+ public void onDescriptorReadRequest(BluetoothDevice device, int requestId,
+ int offset, BluetoothGattDescriptor descriptor) {
+
+ UUID id = descriptor.getUuid();
+ byte[] value = {0};
+ int status = 0;
+
+ Log.v(LOGTAG, "onDescriptorReadRequest() - descriptor" + id);
+ if (id == A4WP_PRU_ALERT_DESC_UUID)
+ {
+ value = mPruAlert.getValue();
+ }
+
+
+ if (value != null)
+ {
+ Log.v(LOGTAG, "device=" + id + "requestId=" + requestId + "status=" + status + "offset=" + offset + "value=" + value[0]);
+ mBluetoothGattServer.sendResponse(device, requestId, status, offset, value);
+ }
+ }
+
/*a> Due to bad coupling irect value drops to zero and vrect remains
constant would render stark to reset the CHG_OK pin, So as to
set this pin on coupling being recovered host delivers the charge
@@ -967,6 +990,7 @@ public class A4wpService extends Service
//Initialize PRU Static param
mPruStaticParam = new PruStaticParam();
mPruDynamicParam = new WipowerDynamicParam();
+ mPruAlert = new PruAlert((byte)1);
mWipowerManager = WipowerManager.getWipowerManger(this, mWipowerCallback);
if (mWipowerManager != null)