From 62ef2fd03af83b313f509c00a760d04a8043efe6 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Wed, 27 Sep 2017 09:58:46 -0700 Subject: [PATCH] Fix GATT Characteristic discovery (server side) The pointer was not properly incremented, which resulted in trashes being sent during GATT discovery. This issue was introduced in commit 819e2ecb84a22d6e03ec9ed67b3260c0dd7e8aba (Use one type for UUID) Bug: 66912853 Test: sl4a GATT read test Change-Id: Ib57ad050ff17852f9b2fec9c51cad246235e3e80 --- stack/gatt/gatt_db.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stack/gatt/gatt_db.cc b/stack/gatt/gatt_db.cc index 0ba408e09..6ae1a6190 100644 --- a/stack/gatt/gatt_db.cc +++ b/stack/gatt/gatt_db.cc @@ -186,6 +186,7 @@ static tGATT_STATUS read_attr_value(tGATT_ATTR& attr16, uint16_t offset, if (mtu < *p_len) return GATT_NO_RESOURCES; gatt_build_uuid_to_stream(&p, attr16.p_value->uuid); + *p_data = p; return GATT_SUCCESS; } @@ -205,6 +206,7 @@ static tGATT_STATUS read_attr_value(tGATT_ATTR& attr16, uint16_t offset, /* if 32 bit UUID, convert to 128 bit */ ARRAY_TO_STREAM(p, val_attr->uuid.To128BitLE(), (int)Uuid::kNumBytes128); } + *p_data = p; return GATT_SUCCESS; } @@ -223,6 +225,7 @@ static tGATT_STATUS read_attr_value(tGATT_ATTR& attr16, uint16_t offset, if (incl_handle.service_type.Is16Bit()) { UINT16_TO_STREAM(p, incl_handle.service_type.As16Bit()); } + *p_data = p; return GATT_SUCCESS; } -- 2.11.0