From 3a128bdcc55cebcf92d145654502167ff2df00e6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 24 Feb 2015 16:22:53 +0200 Subject: [PATCH] unit/test-gatt: Add TP/GAW/CL/BV-01-C test Verify that a Generic Attribute Profile client can issue a characteristic Write without response. --- unit/test-gatt.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/unit/test-gatt.c b/unit/test-gatt.c index 0d58dc19f..e54cf700a 100644 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -828,6 +828,24 @@ static const struct test_step test_write_6 = { .length = 0x03 }; +static void test_write_without_response(struct context *context) +{ + const struct test_step *step = context->data->step; + + g_assert(bt_gatt_client_write_without_response(context->client, + step->handle, + false, step->value, + step->length)); +} + +static const struct test_step test_write_without_response_1 = { + .handle = 0x0007, + .func = test_write_without_response, + .expected_att_ecode = 0, + .value = write_data_1, + .length = 0x03 +}; + static void att_write_cb(struct gatt_db_attribute *att, int err, void *user_data) { @@ -2915,6 +2933,11 @@ int main(int argc, char *argv[]) raw_pdu(0x0a, 0x03, 0x00), raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x80)); + define_test_client("/TP/GAW/CL/BV-01-C", test_client, service_db_1, + &test_write_without_response_1, + SERVICE_DATA_1_PDUS, + raw_pdu(0x52, 0x07, 0x00, 0x01, 0x02, 0x03)); + define_test_client("/TP/GAW/CL/BV-03-C", test_client, service_db_1, &test_write_1, SERVICE_DATA_1_PDUS, -- 2.47.3