diff options
author | Umesh Vats <uvats@codeaurora.org> | 2015-02-19 13:27:47 -0800 |
---|---|---|
committer | Umesh Vats <uvats@codeaurora.org> | 2015-03-10 13:13:13 -0700 |
commit | 1c96af53b02453fa3d392b75fca574c90be2c70d (patch) | |
tree | 84ab366c86a5e3407670421a9b1753d7be14625a /src | |
parent | 460361bceb343b94e58d8e0ff3890eb417d97594 (diff) | |
download | android_packages_apps_BluetoothExt-1c96af53b02453fa3d392b75fca574c90be2c70d.tar.gz android_packages_apps_BluetoothExt-1c96af53b02453fa3d392b75fca574c90be2c70d.tar.bz2 android_packages_apps_BluetoothExt-1c96af53b02453fa3d392b75fca574c90be2c70d.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
Diffstat (limited to 'src')
-rw-r--r-- | src/org/codeaurora/bluetooth/a4wp/A4wpService.java | 26 |
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 978bb38..d23c7eb 100644 --- a/src/org/codeaurora/bluetooth/a4wp/A4wpService.java +++ b/src/org/codeaurora/bluetooth/a4wp/A4wpService.java @@ -96,7 +96,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; @@ -712,6 +712,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 @@ -951,6 +974,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) |