summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2019-05-10 10:35:00 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-03-02 14:42:32 -0800
commit76d63c91b27ab27e28267b6e5ff252252efd537f (patch)
tree05a458bdabed77825eb34aa0b9ca0430d16aa98f /unit
parent0379b6c8761dbd1f3d36508c3e7eb611b84c5896 (diff)
downloadbluez-76d63c91b27ab27e28267b6e5ff252252efd537f.tar.gz
shared/gatt-client: Add support for EATT features
This enables EATT in the Client Features if the EATT characteristic is present in the database.
Diffstat (limited to 'unit')
-rw-r--r--unit/test-gatt.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index e35271b61..d94993b9c 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -124,8 +124,16 @@ struct context {
raw_pdu(0x02, 0x00, 0x02), \
raw_pdu(0x03, 0x00, 0x02)
-#define SERVICE_DATA_1_PDUS \
+#define READ_SERVER_FEAT_PDUS \
+ raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x3a, 0x2b), \
+ raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a)
+
+#define CLIENT_INIT_PDUS \
MTU_EXCHANGE_CLIENT_PDUS, \
+ READ_SERVER_FEAT_PDUS
+
+#define SERVICE_DATA_1_PDUS \
+ CLIENT_INIT_PDUS, \
raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
raw_pdu(0x11, 0x06, 0x01, 0x00, 0x04, 0x00, 0x01, 0x18),\
raw_pdu(0x10, 0x05, 0x00, 0xff, 0xff, 0x00, 0x28), \
@@ -150,7 +158,7 @@ struct context {
raw_pdu(0x05, 0x01, 0x08, 0x00, 0x01, 0x29)
#define SERVICE_DATA_2_PDUS \
- MTU_EXCHANGE_CLIENT_PDUS, \
+ CLIENT_INIT_PDUS, \
raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
raw_pdu(0x11, 0x06, 0x01, 0x00, 0x04, 0x00, 0x01, 0x18),\
raw_pdu(0x10, 0x05, 0x00, 0xff, 0xff, 0x00, 0x28), \
@@ -175,7 +183,7 @@ struct context {
raw_pdu(0x05, 0x01, 0x0a, 0x00, 0x01, 0x29)
#define SERVICE_DATA_3_PDUS \
- MTU_EXCHANGE_CLIENT_PDUS, \
+ CLIENT_INIT_PDUS, \
raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
raw_pdu(0x11, 0x06, 0x00, 0x01, 0x21, 0x01, 0x00, 0x18, \
0x00, 0x02, 0x00, 0x02, 0x01, 0x18), \
@@ -683,7 +691,7 @@ static struct context *create_context(uint16_t mtu, gconstpointer data)
g_assert(context->client_db);
context->client = bt_gatt_client_new(context->client_db,
- context->att, mtu);
+ context->att, mtu, 0);
g_assert(context->client);
bt_gatt_client_set_debug(context->client, print_debug,
@@ -2371,8 +2379,7 @@ int main(int argc, char *argv[])
* Discovery of Services and Service Characteristics.
*/
define_test_att("/TP/GAD/CL/BV-01-C", test_search_primary, NULL, NULL,
- raw_pdu(0x02, 0x00, 0x02),
- raw_pdu(0x03, 0x00, 0x02),
+ MTU_EXCHANGE_CLIENT_PDUS,
raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
raw_pdu(0x11, 0x06, 0x10, 0x00, 0x13, 0x00, 0x00, 0x18,
0x20, 0x00, 0x29, 0x00, 0xb0, 0x68,
@@ -3245,7 +3252,7 @@ int main(int argc, char *argv[])
define_test_client("/TP/GAN/CL/BV-01-C", test_client, ts_small_db,
&test_notification_1,
- MTU_EXCHANGE_CLIENT_PDUS,
+ CLIENT_INIT_PDUS,
SMALL_DB_DISCOVERY_PDUS,
raw_pdu(0x12, 0x04, 0x00, 0x03, 0x00),
raw_pdu(0x13),
@@ -3271,7 +3278,7 @@ int main(int argc, char *argv[])
define_test_client("/TP/GAI/CL/BV-01-C", test_client, ts_small_db,
&test_indication_1,
- MTU_EXCHANGE_CLIENT_PDUS,
+ CLIENT_INIT_PDUS,
SMALL_DB_DISCOVERY_PDUS,
raw_pdu(0x12, 0x04, 0x00, 0x03, 0x00),
raw_pdu(0x13),