2015-01-21 20:28:37

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 00/23] More server GATT Test Spec tests

Adds the remaining tests possible to implement given the current state
of gatt-server. Functionality found broken or lacking was implemented.

Read multiple is now supported.

Michael Janssen (23):
unit/gatt: Add /TP/GAD/CL/BV-05-C test
unit/gatt: Add /TP/GAD/SR/BV-05-C test
unit/gatt: Add /TP/GAR/SR/BV-03-C test
unit/gatt: Add /TP/GAR/SR/BI-06-C test
unit/gatt: Add /TP/GAR/SR/BI-07-C test
unit/gatt: Add /TP/GAR/SR/BI-08-C test
unit/gatt: Add /TP/GAR/SR/BV-04-C test
unit/gatt: Add /TP/GAR/SR/BI-12-C test
shared/gatt-db: fix error read from invalid offset
unit/gatt: Add /TP/GAR/SR/BI-13-C test
unit/gatt: Add /TP/GAR/SR/BI-14-C test
shared/gatt-server: Add read multiple support.
unit/gatt: Add /TP/GAR/SR/BV-05-C test
unit/gatt: Add /TP/GAR/SR/BI-18-C test
unit/gatt: Add /TP/GAR/SR/BI-19-C test
unit/gatt: Add /TP/GAR/SR/BV-06-C test
unit/gatt: Add /TP/GAR/SR/BI-23-C test
unit/gatt: Add /TP/GAR/SR/BI-24-C test
unit/gatt: Add /TP/GAR/SR/BV-07-C test
unit/gatt: Add /TP/GAR/SR/BV-08-C test
unit/gatt: Add /TP/GAR/SR/BI-28-C test
unit/gatt: Add /TP/GAR/SR/BI-29-C test
unit/gatt: Add /TP/GAR/SR/BI-30-C test

src/shared/gatt-db.c | 7 +-
src/shared/gatt-server.c | 154 ++++++++++++++++++++++++++
unit/test-gatt.c | 276 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 435 insertions(+), 2 deletions(-)

--
2.2.0.rc0.207.ga3a616c



2015-01-22 14:17:12

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ 00/23] More server GATT Test Spec tests

Hi Michael,

On Wed, Jan 21, 2015 at 10:28 PM, Michael Janssen <[email protected]> wrote:
> Adds the remaining tests possible to implement given the current state
> of gatt-server. Functionality found broken or lacking was implemented.
>
> Read multiple is now supported.
>
> Michael Janssen (23):
> unit/gatt: Add /TP/GAD/CL/BV-05-C test
> unit/gatt: Add /TP/GAD/SR/BV-05-C test
> unit/gatt: Add /TP/GAR/SR/BV-03-C test
> unit/gatt: Add /TP/GAR/SR/BI-06-C test
> unit/gatt: Add /TP/GAR/SR/BI-07-C test
> unit/gatt: Add /TP/GAR/SR/BI-08-C test
> unit/gatt: Add /TP/GAR/SR/BV-04-C test
> unit/gatt: Add /TP/GAR/SR/BI-12-C test
> shared/gatt-db: fix error read from invalid offset
> unit/gatt: Add /TP/GAR/SR/BI-13-C test
> unit/gatt: Add /TP/GAR/SR/BI-14-C test
> shared/gatt-server: Add read multiple support.
> unit/gatt: Add /TP/GAR/SR/BV-05-C test
> unit/gatt: Add /TP/GAR/SR/BI-18-C test
> unit/gatt: Add /TP/GAR/SR/BI-19-C test
> unit/gatt: Add /TP/GAR/SR/BV-06-C test
> unit/gatt: Add /TP/GAR/SR/BI-23-C test
> unit/gatt: Add /TP/GAR/SR/BI-24-C test
> unit/gatt: Add /TP/GAR/SR/BV-07-C test
> unit/gatt: Add /TP/GAR/SR/BV-08-C test
> unit/gatt: Add /TP/GAR/SR/BI-28-C test
> unit/gatt: Add /TP/GAR/SR/BI-29-C test
> unit/gatt: Add /TP/GAR/SR/BI-30-C test
>
> src/shared/gatt-db.c | 7 +-
> src/shared/gatt-server.c | 154 ++++++++++++++++++++++++++
> unit/test-gatt.c | 276 +++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 435 insertions(+), 2 deletions(-)
>
> --
> 2.2.0.rc0.207.ga3a616c

Applied, thanks.


--
Luiz Augusto von Dentz

2015-01-21 20:28:58

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 21/23] unit/gatt: Add /TP/GAR/SR/BI-28-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Descriptor Request to a non-readable
characteristic descriptor and issue a Read Not Permitted Response.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 4f7c376..d31a157 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2097,5 +2097,11 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0xCE, 0x00, 0x2B, 0x00),
raw_pdu(0x0D));

+ define_test_server("/TP/GAR/SR/BI-28-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0x96, 0x00, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0x96, 0x00, 0x02));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:52

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 15/23] unit/gatt: Add /TP/GAR/SR/BI-19-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Multiple Characteristic Value Request including an unsupported
Characteristic Value handle and issue an Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 29387f0..8f5b076 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2024,5 +2024,17 @@ int main(int argc, char *argv[])
raw_pdu(0x0e, 0x44, 0x00, 0x06, 0x00, 0x27, 0x00),
raw_pdu(0x01, 0x0e, 0x27, 0x00, 0x02));

+ define_test_server("/TP/GAR/SR/BI-19-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0e, 0x15, 0xF0, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x0e, 0xF0, 0x0F, 0x01));
+
+ define_test_server("/TP/GAR/SR/BI-19-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0e, 0x44, 0x00, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x0e, 0xF0, 0x0F, 0x01));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:49

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 12/23] shared/gatt-server: Add read multiple support.

Add server handling for BT_ATT_OP_READ_MULT_REQ.
---
src/shared/gatt-server.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 154 insertions(+)

diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c
index f12ac47..b406ed6 100644
--- a/src/shared/gatt-server.c
+++ b/src/shared/gatt-server.c
@@ -92,6 +92,7 @@ struct bt_gatt_server {
unsigned int write_cmd_id;
unsigned int read_id;
unsigned int read_blob_id;
+ unsigned int read_multiple_id;
unsigned int prep_write_id;
unsigned int exec_write_id;

@@ -120,6 +121,7 @@ static void bt_gatt_server_free(struct bt_gatt_server *server)
bt_att_unregister(server->att, server->write_cmd_id);
bt_att_unregister(server->att, server->read_id);
bt_att_unregister(server->att, server->read_blob_id);
+ bt_att_unregister(server->att, server->read_multiple_id);
bt_att_unregister(server->att, server->prep_write_id);
bt_att_unregister(server->att, server->exec_write_id);

@@ -971,6 +973,149 @@ static void read_blob_cb(uint8_t opcode, const void *pdu,
handle_read_req(server, opcode, handle, offset);
}

+struct read_multiple_resp_data {
+ struct bt_gatt_server *server;
+ uint16_t *handles;
+ size_t cur_handle;
+ size_t num_handles;
+ uint8_t *rsp_data;
+ size_t length;
+ size_t mtu;
+};
+
+static void read_multiple_resp_data_free(struct read_multiple_resp_data *data)
+{
+ free(data->handles);
+ data->handles = NULL;
+
+ free(data->rsp_data);
+ data->rsp_data = NULL;
+}
+
+static void read_multiple_complete_cb(struct gatt_db_attribute *attr, int err,
+ const uint8_t *value, size_t len,
+ void *user_data)
+{
+ struct read_multiple_resp_data *data = user_data;
+ struct gatt_db_attribute *next_attr;
+ uint32_t perm;
+
+ uint16_t handle = gatt_db_attribute_get_handle(attr);
+
+ if (err != 0) {
+ bt_att_send_error_rsp(data->server->att,
+ BT_ATT_OP_READ_MULT_REQ, handle, err);
+ read_multiple_resp_data_free(data);
+ return;
+ }
+
+ perm = gatt_db_attribute_get_permissions(attr);
+
+ if (perm && !(perm & BT_ATT_PERM_READ)) {
+ bt_att_send_error_rsp(data->server->att,
+ BT_ATT_OP_READ_MULT_REQ, handle,
+ BT_ATT_ERROR_READ_NOT_PERMITTED);
+ read_multiple_resp_data_free(data);
+ return;
+ }
+
+ len = MIN(len, data->mtu - data->length - 1);
+
+ memcpy(data->rsp_data + data->length, value, len);
+ data->length += len;
+
+ data->cur_handle++;
+
+ if ((data->length >= data->mtu - 1) ||
+ (data->cur_handle == data->num_handles)) {
+ bt_att_send(data->server->att, BT_ATT_OP_READ_MULT_RSP,
+ data->rsp_data, data->length, NULL, NULL, NULL);
+ read_multiple_resp_data_free(data);
+ return;
+ }
+
+ util_debug(data->server->debug_callback, data->server->debug_data,
+ "Read Multiple Req - #%lu of %lu: 0x%04x",
+ data->cur_handle + 1, data->num_handles,
+ data->handles[data->cur_handle]);
+
+ next_attr = gatt_db_get_attribute(data->server->db,
+ data->handles[data->cur_handle]);
+
+ if (!next_attr) {
+ bt_att_send_error_rsp(data->server->att,
+ BT_ATT_OP_READ_MULT_REQ,
+ data->handles[data->cur_handle],
+ BT_ATT_ERROR_INVALID_HANDLE);
+ read_multiple_resp_data_free(data);
+ return;
+ }
+
+ if (!gatt_db_attribute_read(next_attr, 0, BT_ATT_OP_READ_MULT_REQ, NULL,
+ read_multiple_complete_cb, data)) {
+ bt_att_send_error_rsp(data->server->att,
+ BT_ATT_OP_READ_MULT_REQ,
+ data->handles[data->cur_handle],
+ BT_ATT_ERROR_UNLIKELY);
+ read_multiple_resp_data_free(data);
+ }
+}
+
+static void read_multiple_cb(uint8_t opcode, const void *pdu,
+ uint16_t length, void *user_data)
+{
+ struct bt_gatt_server *server = user_data;
+ struct gatt_db_attribute *attr;
+ struct read_multiple_resp_data data;
+ uint8_t ecode = BT_ATT_ERROR_UNLIKELY;
+ size_t i = 0;
+
+ data.handles = NULL;
+ data.rsp_data = NULL;
+
+ if (length < 4) {
+ ecode = BT_ATT_ERROR_INVALID_PDU;
+ goto error;
+ }
+
+ data.server = server;
+ data.num_handles = length / 2;
+ data.cur_handle = 0;
+ data.mtu = bt_att_get_mtu(server->att);
+ data.length = 0;
+ data.rsp_data = malloc(data.mtu - 1);
+
+ if (!data.rsp_data)
+ goto error;
+
+ data.handles = new0(uint16_t, data.num_handles);
+
+ if (!data.handles)
+ goto error;
+
+ for (i = 0; i < data.num_handles; i++)
+ data.handles[i] = get_le16(pdu + i * 2);
+
+ util_debug(server->debug_callback, server->debug_data,
+ "Read Multiple Req - %lu handles, 1st: 0x%04x",
+ data.num_handles, data.handles[0]);
+
+ attr = gatt_db_get_attribute(server->db, data.handles[0]);
+
+ if (!attr) {
+ ecode = BT_ATT_ERROR_INVALID_HANDLE;
+ goto error;
+ }
+
+ if (gatt_db_attribute_read(attr, 0, opcode, NULL,
+ read_multiple_complete_cb, &data))
+ return;
+
+error:
+ read_multiple_resp_data_free(&data);
+ bt_att_send_error_rsp(server->att, opcode, 0, ecode);
+}
+
static void prep_write_cb(uint8_t opcode, const void *pdu,
uint16_t length, void *user_data)
{
@@ -1248,6 +1393,15 @@ static bool gatt_server_register_att_handlers(struct bt_gatt_server *server)
if (!server->read_blob_id)
return false;

+ /* Read Multiple Request */
+ server->read_multiple_id = bt_att_register(server->att,
+ BT_ATT_OP_READ_MULT_REQ,
+ read_multiple_cb,
+ server, NULL);
+
+ if (!server->read_multiple_id)
+ return false;
+
/* Prepare Write Request */
server->prep_write_id = bt_att_register(server->att,
BT_ATT_OP_PREP_WRITE_REQ,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:59

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 22/23] unit/gatt: Add /TP/GAR/SR/BI-29-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Descriptor Request with an invalid offset and
issue an Invalid Offset Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index d31a157..e09b055 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2103,5 +2103,17 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0x96, 0x00, 0x00, 0x00),
raw_pdu(0x01, 0x0C, 0x96, 0x00, 0x02));

+ define_test_server("/TP/GAR/SR/BI-29-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0x05, 0x00, 0xF0, 0x00),
+ raw_pdu(0x01, 0x0C, 0x05, 0x00, 0x07));
+
+ define_test_server("/TP/GAR/SR/BI-29-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xCE, 0x00, 0xF0, 0x00),
+ raw_pdu(0x01, 0x0C, 0xCE, 0x00, 0x07));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:29:00

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 23/23] unit/gatt: Add /TP/GAR/SR/BI-30-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Descriptor Request to an invalid handle and
issue an Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index e09b055..cd6a616 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2115,5 +2115,17 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0xCE, 0x00, 0xF0, 0x00),
raw_pdu(0x01, 0x0C, 0xCE, 0x00, 0x07));

+ define_test_server("/TP/GAR/SR/BI-30-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
+
+ define_test_server("/TP/GAR/SR/BI-30-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:50

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 13/23] unit/gatt: Add /TP/GAR/SR/BV-05-C test

Verify that a Generic Attribute Profile server can support reading
multiple Characteristic Values selected by a set of handles.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index fc98558..5856630 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2004,5 +2004,19 @@ int main(int argc, char *argv[])
raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x0c));

+ define_test_server("/TP/GAR/SR/BV-05-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0e, 0x15, 0xF0, 0x03, 0x00),
+ raw_pdu(0x0f, 0x09, 'B', 'l', 'u', 'e', 'Z'));
+
+ define_test_server("/TP/GAR/SR/BV-05-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0e, 0x44, 0x00, 0x06, 0x00, 0xC4, 0x00),
+ raw_pdu(0x0f, 0x11, 0x0B, '1', '1', '1', '1', '1', '2',
+ '2', '2', '2', '2', '3', '3', '3', '3', '3',
+ '4', '4', '4', '4', '4'));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:48

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 11/23] unit/gatt: Add /TP/GAR/SR/BI-14-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Value Request to an invalid handle and issue an
Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5741918..fc98558 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1956,6 +1956,18 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0xD3, 0x00, 0xF0, 0x00),
raw_pdu(0x01, 0x0C, 0xD3, 0x00, 0x07));

+ define_test_server("/TP/GAR/SR/BI-14-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
+
+ define_test_server("/TP/GAR/SR/BI-14-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:53

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 16/23] unit/gatt: Add /TP/GAR/SR/BV-06-C test

Verify that a Generic Attribute Profile server can support reading a
characteristic descriptor selected by handle.
---
unit/test-gatt.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 8f5b076..dbbd504 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2036,5 +2036,20 @@ int main(int argc, char *argv[])
raw_pdu(0x0e, 0x44, 0x00, 0xF0, 0x0F),
raw_pdu(0x01, 0x0e, 0xF0, 0x0F, 0x01));

+ define_test_server("/TP/GAR/SR/BV-06-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0A, 0x05, 0x00),
+ raw_pdu(0x0B, 'M', 'a', 'n', 'u', 'f', 'a', 'c', 't',
+ 'u', 'r', 'e', 'r', ' ', 'N', 'a', 'm', 'e'));
+
+ define_test_server("/TP/GAR/SR/BV-06-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0A, 0xD4, 0x00),
+ raw_pdu(0x0B, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:47

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 10/23] unit/gatt: Add /TP/GAR/SR/BI-13-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Value Request with an invalid offset and issue
an Invalid Offset Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 55b4584..5741918 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1944,6 +1944,18 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0x27, 0x00, 0x00, 0x00),
raw_pdu(0x01, 0x0C, 0x27, 0x00, 0x02));

+ define_test_server("/TP/GAR/SR/BI-13-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0x13, 0xF0, 0xF0, 0x00),
+ raw_pdu(0x01, 0x0C, 0x13, 0xF0, 0x07));
+
+ define_test_server("/TP/GAR/SR/BI-13-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xD3, 0x00, 0xF0, 0x00),
+ raw_pdu(0x01, 0x0C, 0xD3, 0x00, 0x07));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:45

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 08/23] unit/gatt: Add /TP/GAR/SR/BI-12-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Long Characteristic Value Request to a non-readable Characteristic
Value and issue a Read Not Permitted Response.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index b96adb5..55b4584 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1938,6 +1938,12 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0xD3, 0x00, 0x2D, 0x00),
raw_pdu(0x0D));

+ define_test_server("/TP/GAR/SR/BI-12-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0x27, 0x00, 0x00, 0x00),
+ raw_pdu(0x01, 0x0C, 0x27, 0x00, 0x02));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:44

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 07/23] unit/gatt: Add /TP/GAR/SR/BV-04-C test

Verify that a Generic Attribute Profile server can support reading a
long Characteristic Value selected by handle.
---
unit/test-gatt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index f9c7e27..b96adb5 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1922,6 +1922,22 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28),
raw_pdu(0x01, 0x08, 0x02, 0x00, 0x01));

+ define_test_server("/TP/GAR/SR/BV-04-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xD3, 0x00, 0x00, 0x00),
+ raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
+ 0x66, 0x77, 0x88, 0x99, 0x00, 0x11, 0x22),
+ raw_pdu(0x0C, 0xD3, 0x00, 0x16, 0x00),
+ raw_pdu(0x0D, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
+ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44),
+ raw_pdu(0x0C, 0xD3, 0x00, 0x2C, 0x00),
+ raw_pdu(0x0D, 0x55),
+ raw_pdu(0x0C, 0xD3, 0x00, 0x2D, 0x00),
+ raw_pdu(0x0D));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:43

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 06/23] unit/gatt: Add /TP/GAR/SR/BI-08-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Characteristic by UUID Request with an invalid handle range and
issue an Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index df49f6a..f9c7e27 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1910,6 +1910,18 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xF0, 0x0F),
raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a));

+ define_test_server("/TP/GAR/SR/BI-08-C/small", test_server, ts_small_db,
+ NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28),
+ raw_pdu(0x01, 0x08, 0x02, 0x00, 0x01));
+
+ define_test_server("/TP/GAR/SR/BI-08-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28),
+ raw_pdu(0x01, 0x08, 0x02, 0x00, 0x01));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:57

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 20/23] unit/gatt: Add /TP/GAR/SR/BV-08-C test

Verify that a Generic Attribute Profile server returns a 0-length part
value when reading a Long Characteristic Descriptor selected by handle
with an offset equal to the length of the Long Characteristic Value.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index ca4ea45..4f7c376 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2083,5 +2083,19 @@ int main(int argc, char *argv[])
raw_pdu(0x0C, 0xD1, 0x00, 0x2C, 0x00),
raw_pdu(0x0D));

+ define_test_server("/TP/GAR/SR/BV-08-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xCE, 0x00, 0x00, 0x00),
+ raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34),
+ raw_pdu(0x0C, 0xCE, 0x00, 0x16, 0x00),
+ raw_pdu(0x0D, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
+ 0x90, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x11, 0x22, 0x33),
+ raw_pdu(0x0C, 0xCE, 0x00, 0x2B, 0x00),
+ raw_pdu(0x0D));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:56

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 19/23] unit/gatt: Add /TP/GAR/SR/BV-07-C test

Verify that a Generic Attribute Profile server can support reading a
Long Characteristic Descriptor selected by handle.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index d8efb5d..ca4ea45 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2069,5 +2069,19 @@ int main(int argc, char *argv[])
raw_pdu(0x0A, 0xF0, 0x0F),
raw_pdu(0x01, 0x0A, 0xF0, 0x0F, 0x01));

+ define_test_server("/TP/GAR/SR/BV-07-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0C, 0xD1, 0x00, 0x00, 0x00),
+ raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
+ 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34),
+ raw_pdu(0x0C, 0xD1, 0x00, 0x16, 0x00),
+ raw_pdu(0x0D, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
+ 0x90, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44),
+ raw_pdu(0x0C, 0xD1, 0x00, 0x2C, 0x00),
+ raw_pdu(0x0D));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:51

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 14/23] unit/gatt: Add /TP/GAR/SR/BI-18-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Multiple Characteristic Values Request including any non-readable
Characteristic Value and issue a Read Not Permitted Response.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5856630..29387f0 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2018,5 +2018,11 @@ int main(int argc, char *argv[])
'2', '2', '2', '2', '3', '3', '3', '3', '3',
'4', '4', '4', '4', '4'));

+ define_test_server("/TP/GAR/SR/BI-18-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0e, 0x44, 0x00, 0x06, 0x00, 0x27, 0x00),
+ raw_pdu(0x01, 0x0e, 0x27, 0x00, 0x02));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:54

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 17/23] unit/gatt: Add /TP/GAR/SR/BI-23-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Characteristic Descriptor Request to a non-readable characteristic
descriptor and issue a Read Not Permitted Response.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index dbbd504..ecbebe9 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2051,5 +2051,11 @@ int main(int argc, char *argv[])
0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34));

+ define_test_server("/TP/GAR/SR/BI-23-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0A, 0x96, 0x00),
+ raw_pdu(0x01, 0x0A, 0x96, 0x00, 0x02));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:55

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 18/23] unit/gatt: Add /TP/GAR/SR/BI-24-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Characteristic Descriptor Request with an unsupported
characteristic descriptor handle and issue an Invalid Handle Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index ecbebe9..d8efb5d 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -2057,5 +2057,17 @@ int main(int argc, char *argv[])
raw_pdu(0x0A, 0x96, 0x00),
raw_pdu(0x01, 0x0A, 0x96, 0x00, 0x02));

+ define_test_server("/TP/GAR/SR/BI-24-C/small", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0A, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x0A, 0xF0, 0x0F, 0x01));
+
+ define_test_server("/TP/GAR/SR/BI-24-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x0A, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x0A, 0xF0, 0x0F, 0x01));
+
return g_test_run();
}
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:46

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 09/23] shared/gatt-db: fix error read from invalid offset

Read from an invalid offset should return BT_ATT_ERROR_INVALID_OFFSET
instead of BT_ATT_ERROR_UNLIKELY.
---
src/shared/gatt-db.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 47aae7f..780d640 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -29,6 +29,7 @@
#include "src/shared/queue.h"
#include "src/shared/timeout.h"
#include "src/shared/gatt-db.h"
+#include "src/shared/att-types.h"

#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -1457,8 +1458,10 @@ bool gatt_db_attribute_read(struct gatt_db_attribute *attrib, uint16_t offset,
}

/* Check boundary if value is stored in the db */
- if (offset > attrib->value_len)
- return false;
+ if (offset > attrib->value_len) {
+ func(attrib, BT_ATT_ERROR_INVALID_OFFSET, NULL, 0, user_data);
+ return true;
+ }

/* Guard against invalid access if offset equals to value length */
value = offset == attrib->value_len ? NULL : &attrib->value[offset];
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:42

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 05/23] unit/gatt: Add /TP/GAR/SR/BI-07-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Characteristic by UUID Request to an unsupported characteristic and
issue an Attribute Not Found Response.
---
unit/test-gatt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 5872445..df49f6a 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1898,6 +1898,18 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x07, 0xB0),
raw_pdu(0x01, 0x08, 0x32, 0x00, 0x02));

+ define_test_server("/TP/GAR/SR/BI-07-C/small", test_server, ts_small_db,
+ NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a));
+
+ define_test_server("/TP/GAR/SR/BI-07-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xF0, 0x0F),
+ raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:38

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 01/23] unit/gatt: Add /TP/GAD/CL/BV-05-C test

Verify that a Generic Attribute Profile client can discover
characteristics of a specified service, using 16-bit and 128-bit
characteristic UUIDs.
---
unit/test-gatt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index b6be716..2f8750d 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1680,6 +1680,20 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x29, 0x00, 0x29, 0x00, 0x03, 0x28),
raw_pdu(0x01, 0x08, 0x29, 0x00, 0x0a));

+ define_test_att("/TP/GAD/CL/BV-05-C", test_search_chars, NULL,
+ NULL,
+ MTU_EXCHANGE_CLIENT_PDUS,
+ raw_pdu(0x08, 0x10, 0x00, 0x20, 0x00, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x11, 0x00, 02, 0x12, 0x00, 0x25,
+ 0x2a),
+ raw_pdu(0x08, 0x12, 0x00, 0x20, 0x00, 0x03, 0x28),
+ raw_pdu(0x09, 0x15, 0x13, 0x00, 0x02, 0x14, 0x00, 0x85,
+ 0x00, 0xef, 0xcd, 0xab, 0x89, 0x67,
+ 0x45, 0x23, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00),
+ raw_pdu(0x08, 0x14, 0x00, 0x20, 0x00, 0x03, 0x28),
+ raw_pdu(0x01, 0x08, 0x12, 0x00, 0x0a));
+
define_test_att("/TP/GAD/CL/BV-06-C", test_search_descs, NULL, NULL,
MTU_EXCHANGE_CLIENT_PDUS,
raw_pdu(0x04, 0x13, 0x00, 0x16, 0x00),
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:40

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 03/23] unit/gatt: Add /TP/GAR/SR/BV-03-C test

Verify that a Generic Attribute Profile server can support the Read
using Characteristic UUID procedure, using a 16-bit UUID and using a
128-bit UUID if supported.
---
unit/test-gatt.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index aa612dc..f2a4dcb 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1868,6 +1868,30 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x0c));

+ define_test_server("/TP/GAR/SR/BV-03-C/small", test_server, ts_small_db,
+ NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xef, 0xcd, 0xab,
+ 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x09, 0xB0, 0x00,
+ 0x00),
+ raw_pdu(0x09, 0x03, 0x15, 0xF0, 0x09),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x01, 0x2a),
+ raw_pdu(0x09, 0x04, 0x17, 0xF0, 0x00, 0x00));
+
+ define_test_server("/TP/GAR/SR/BV-03-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xef, 0xcd, 0xab,
+ 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0xd4, 0xd5, 0x00,
+ 0x00),
+ raw_pdu(0x09, 0x03, 0x76, 0x00, 0x44),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x02, 0xB0),
+ raw_pdu(0x09, 0x15, 0x25, 0x00, '1', '1', '1', '1', '1',
+ '2', '2', '2', '2', '2', '3', '3', '3', '3',
+ '3', '4', '4', '4', '4'));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:41

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 04/23] unit/gatt: Add /TP/GAR/SR/BI-06-C test

Verify that a Generic Attribute Profile server can detect and reject a
Read Characteristic by UUID Request to a non-readable Characteristic
Value and issue a Read Not Permitted Response.
---
unit/test-gatt.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index f2a4dcb..5872445 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1892,6 +1892,12 @@ int main(int argc, char *argv[])
'2', '2', '2', '2', '2', '3', '3', '3', '3',
'3', '4', '4', '4', '4'));

+ define_test_server("/TP/GAR/SR/BI-06-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x07, 0xB0),
+ raw_pdu(0x01, 0x08, 0x32, 0x00, 0x02));
+
define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
&test_multiple_read_1,
SERVICE_DATA_1_PDUS,
--
2.2.0.rc0.207.ga3a616c


2015-01-21 20:28:39

by Marie Janssen

[permalink] [raw]
Subject: [PATCH BlueZ 02/23] unit/gatt: Add /TP/GAD/SR/BV-05-C test

Verify that a Generic Attribute Profile server can discover service
Characteristics of a specified UUID, using 16-bit UUIDs, and using
128-bit UUIDs.
---
unit/test-gatt.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 2f8750d..aa612dc 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
@@ -1694,6 +1694,45 @@ int main(int argc, char *argv[])
raw_pdu(0x08, 0x14, 0x00, 0x20, 0x00, 0x03, 0x28),
raw_pdu(0x01, 0x08, 0x12, 0x00, 0x0a));

+ define_test_server("/TP/GAD/SR/BV-05-C/small/1", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x10, 0xf0, 0x17, 0xf0, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00,
+ 0x2a),
+ raw_pdu(0x08, 0x13, 0xf0, 0x17, 0xf0, 0x03, 0x28),
+ raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x02, 0x15, 0xf0, 0xef,
+ 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x09,
+ 0xb0, 0x00, 0x00),
+ raw_pdu(0x08, 0x15, 0xf0, 0x17, 0xf0, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x16, 0xf0, 0x02, 0x17, 0xf0, 0x01,
+ 0x2a),
+ raw_pdu(0x08, 0x17, 0xf0, 0x17, 0xf0, 0x03, 0x28),
+ raw_pdu(0x01, 0x08, 0x17, 0xf0, 0x0a));
+
+ define_test_server("/TP/GAD/SR/BV-05-C/small/2", test_server,
+ ts_small_db, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x02, 0x00, 0x02, 0x03, 0x00, 0x29,
+ 0x2a),
+ raw_pdu(0x08, 0x03, 0x00, 0x0f, 0x00, 0x03, 0x28),
+ raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a));
+
+ define_test_server("/TP/GAD/SR/BV-05-C/large-1", test_server,
+ ts_large_db_1, NULL,
+ raw_pdu(0x03, 0x00, 0x02),
+ raw_pdu(0x08, 0x20, 0x00, 0x29, 0x00, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x22, 0x00, 0x02, 0x23, 0x00, 0x01,
+ 0xb0, 0x24, 0x00, 0x0a, 0x25, 0x00, 0x02, 0xb0,
+ 0x26, 0x00, 0x08, 0x27, 0x00, 0x02, 0xb0),
+ raw_pdu(0x08, 0x27, 0x00, 0x29, 0x00, 0x03, 0x28),
+ raw_pdu(0x09, 0x07, 0x28, 0x00, 0x08, 0x29, 0x00, 0x03,
+ 0xb0),
+ raw_pdu(0x08, 0x29, 0x00, 0x29, 0x00, 0x03, 0x28),
+ raw_pdu(0x01, 0x08, 0x29, 0x00, 0x0a));
+
define_test_att("/TP/GAD/CL/BV-06-C", test_search_descs, NULL, NULL,
MTU_EXCHANGE_CLIENT_PDUS,
raw_pdu(0x04, 0x13, 0x00, 0x16, 0x00),
--
2.2.0.rc0.207.ga3a616c