Verify Generic Attribute Profile client behavior when the Read Characteristic Value procedure fails due to read not permitted. --- unit/test-gatt.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/unit/test-gatt.c b/unit/test-gatt.c index d91fd41..6208192 100644 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -504,6 +504,12 @@ const struct test_step test_read_2 = { .expected_att_ecode = 0x01, }; +const struct test_step test_read_3 = { + .handle = 0x0003, + .func = test_read, + .expected_att_ecode = 0x02, +}; + static void test_client(gconstpointer data) { struct context *context = create_context(512, data); @@ -728,5 +734,38 @@ int main(int argc, char *argv[]) raw_pdu(0x0a, 0x00, 0x00), raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01)); + define_test_client("/TP/GAR/CL/BI-02-C", test_client, service_data_1, + &test_read_3, + raw_pdu(0x02, 0x00, 0x02), + raw_pdu(0x03, 0x00, 0x02), + 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), + raw_pdu(0x11, 0x06, 0x05, 0x00, 0x08, 0x00, 0x0d, 0x18), + raw_pdu(0x10, 0x09, 0x00, 0xff, 0xff, 0x00, 0x28), + raw_pdu(0x01, 0x10, 0x09, 0x00, 0x0a), + raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), + raw_pdu(0x01, 0x10, 0x01, 0x00, 0x0a), + raw_pdu(0x08, 0x01, 0x00, 0x04, 0x00, 0x02, 0x28), + raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a), + raw_pdu(0x08, 0x05, 0x00, 0x08, 0x00, 0x02, 0x28), + raw_pdu(0x01, 0x08, 0x05, 0x00, 0x0a), + raw_pdu(0x08, 0x01, 0x00, 0x04, 0x00, 0x03, 0x28), + raw_pdu(0x09, 0x07, 0x02, 0x00, 0x02, 0x03, 0x00, 0x00, + 0x2a), + raw_pdu(0x08, 0x03, 0x00, 0x04, 0x00, 0x03, 0x28), + raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a), + raw_pdu(0x04, 0x04, 0x00, 0x04, 0x00), + raw_pdu(0x05, 0x01, 0x04, 0x00, 0x01, 0x29), + raw_pdu(0x08, 0x05, 0x00, 0x08, 0x00, 0x03, 0x28), + raw_pdu(0x09, 0x07, 0x06, 0x00, 0x02, 0x07, 0x00, 0x29, + 0x2a), + raw_pdu(0x08, 0x07, 0x00, 0x08, 0x00, 0x03, 0x28), + raw_pdu(0x01, 0x08, 0x07, 0x00, 0x0a), + raw_pdu(0x04, 0x08, 0x00, 0x08, 0x00), + raw_pdu(0x05, 0x01, 0x08, 0x00, 0x01, 0x29), + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x02)); + return g_test_run(); } -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html