Verify Generic Attribute Profile client behavior when the Read Characteristic Value procedure fails due to insufficient authorization. --- unit/test-gatt.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/unit/test-gatt.c b/unit/test-gatt.c index 6208192..39cdda3 100644 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -510,6 +510,12 @@ const struct test_step test_read_3 = { .expected_att_ecode = 0x02, }; +const struct test_step test_read_4 = { + .handle = 0x0003, + .func = test_read, + .expected_att_ecode = 0x08, +}; + static void test_client(gconstpointer data) { struct context *context = create_context(512, data); @@ -767,5 +773,38 @@ int main(int argc, char *argv[]) raw_pdu(0x0a, 0x03, 0x00), raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x02)); + define_test_client("/TP/GAR/CL/BI-03-C", test_client, service_data_1, + &test_read_4, + 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, 0x08)); + 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