From 810c9b1885b5ca1dcea53ffe79dde1f08b8dceaf Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 2 Oct 2015 15:00:10 +0200 Subject: [PATCH] all gatt read tests pass --- test/pts/ble_central_test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/pts/ble_central_test.c b/test/pts/ble_central_test.c index ca49119b8..83a77000b 100644 --- a/test/pts/ble_central_test.c +++ b/test/pts/ble_central_test.c @@ -88,6 +88,7 @@ typedef enum { CENTRAL_W4_READ_CHARACTERISTIC_DESCRIPTOR_BY_HANDLE, CENTRAL_ENTER_OFFSET_4_READ_LONG_CHARACTERISTIC_DESCRIPTOR_BY_HANDLE, CENTRAL_W4_READ_LONG_CHARACTERISTIC_DESCRIPTOR_BY_HANDLE, + CENTRAL_W4_READ_MULTIPLE_CHARACTERISTIC_VALUES, } central_state_t; typedef struct advertising_report { @@ -125,6 +126,8 @@ static int ui_uuid16 = 0; static int ui_uuid128_request = 0; static int ui_uuid128_pos = 0; static uint8_t ui_uuid128[16]; +static int ui_num_handles; +static uint16_t ui_handles[10]; static uint16_t ui_attribute_handle; static uint16_t handle = 0; static uint16_t gc_id; @@ -433,6 +436,7 @@ void handle_gatt_client_event(le_event_t * event){ break; case CENTRAL_W4_READ_CHARACTERISTIC_VALUE_BY_HANDLE: case CENTRAL_W4_READ_CHARACTERISTIC_VALUE_BY_UUID: + case CENTRAL_W4_READ_MULTIPLE_CHARACTERISTIC_VALUES: printf("Value: "); printf_hexdump(value->blob, value->blob_length); break; @@ -579,6 +583,7 @@ void show_usage(void){ printf("K - Read Characteristic Value by UUID128\n"); printf("l - Read Characteristic Descriptor by handle\n"); printf("L - Read Long Characteristic Descriptor by handle\n"); + printf("N - Read Multiple Characteristic Values\n"); printf("---\n"); printf("4 - IO_CAPABILITY_DISPLAY_ONLY\n"); printf("5 - IO_CAPABILITY_DISPLAY_YES_NO\n"); @@ -716,6 +721,20 @@ int stdin_process(struct data_source *ds){ printf("Read Characteristic Value with UUID16 0x%04x\n", ui_uint16); gatt_client_read_value_of_characteristics_by_uuid16(gc_id, handle, ui_uint16, 0xffff, ui_uuid16); return 0; + case CENTRAL_W4_READ_MULTIPLE_CHARACTERISTIC_VALUES: + if (ui_uint16){ + ui_handles[ui_num_handles++] = ui_uint16; + ui_request_uint16("Please enter handle: "); + } else { + int i; + printf("Read multiple values, handles: "); + for (i=0;i