2015-08-26 09:59:54

by Gowtham Anandha Babu

[permalink] [raw]
Subject: [PATCH 1/2] doc/pts: Update OPP PTS test results

PTS issues got resolved after updating the ETS file attached in
https://www.bluetooth.org/pts/issues/view_issue.cfm?id=13842,
which will be updated in next PTS release.
---
doc/pts-opp.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/pts-opp.txt b/doc/pts-opp.txt
index ae1bb7c..832028c 100644
--- a/doc/pts-opp.txt
+++ b/doc/pts-opp.txt
@@ -1,7 +1,7 @@
PTS test results for OPP

PTS version: 6.2.0
-Tested: 30-Jul-2015
+Tested: 26-Aug-2015

Results:
PASS test passed
@@ -92,9 +92,9 @@ TC_SERVER_OPH_BV_15_I N/A
TC_SERVER_OPH_BV_16_I N/A
TC_SERVER_OPH_BV_17_I PASS
TC_SERVER_OPH_BV_18_I PASS
-TC_SERVER_OPH_BV_19_I INC PTS issue #13842
+TC_SERVER_OPH_BV_19_I PASS
TC_SERVER_OPH_BV_21_I N/A
-TC_SERVER_OPH_BV_22_I INC PTS issue #13842
+TC_SERVER_OPH_BV_22_I PASS
TC_SERVER_OPH_BV_23_I PASS
TC_SERVER_OPH_BV_24_I N/A
TC_SERVER_OPH_BV_25_I N/A
--
1.9.1



2015-08-26 13:49:51

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH 1/2] doc/pts: Update OPP PTS test results

Hi Gowtham,

On Wed, Aug 26, 2015 at 12:59 PM, Gowtham Anandha Babu
<[email protected]> wrote:
> PTS issues got resolved after updating the ETS file attached in
> https://www.bluetooth.org/pts/issues/view_issue.cfm?id=13842,
> which will be updated in next PTS release.
> ---
> doc/pts-opp.txt | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/doc/pts-opp.txt b/doc/pts-opp.txt
> index ae1bb7c..832028c 100644
> --- a/doc/pts-opp.txt
> +++ b/doc/pts-opp.txt
> @@ -1,7 +1,7 @@
> PTS test results for OPP
>
> PTS version: 6.2.0
> -Tested: 30-Jul-2015
> +Tested: 26-Aug-2015
>
> Results:
> PASS test passed
> @@ -92,9 +92,9 @@ TC_SERVER_OPH_BV_15_I N/A
> TC_SERVER_OPH_BV_16_I N/A
> TC_SERVER_OPH_BV_17_I PASS
> TC_SERVER_OPH_BV_18_I PASS
> -TC_SERVER_OPH_BV_19_I INC PTS issue #13842
> +TC_SERVER_OPH_BV_19_I PASS
> TC_SERVER_OPH_BV_21_I N/A
> -TC_SERVER_OPH_BV_22_I INC PTS issue #13842
> +TC_SERVER_OPH_BV_22_I PASS
> TC_SERVER_OPH_BV_23_I PASS
> TC_SERVER_OPH_BV_24_I N/A
> TC_SERVER_OPH_BV_25_I N/A
> --
> 1.9.1

I went ahead and applied this one.


--
Luiz Augusto von Dentz

2015-08-26 10:18:20

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH 2/2] tools/btgatt-server: Handle Charc Value Indication

Hi Gowtham,

On Wed, Aug 26, 2015 at 12:59 PM, Gowtham Anandha Babu
<[email protected]> wrote:
> This patch verifies that a Generic Attribute Profile server can
> send a Characteristic Value Indication.
> TC_GAI_SR_BV_01_C - PASS
> ---
> tools/btgatt-server.c | 30 +++++++++++++++++++++++++-----
> 1 file changed, 25 insertions(+), 5 deletions(-)
>
> diff --git a/tools/btgatt-server.c b/tools/btgatt-server.c
> index 292b584..5b38d47 100644
> --- a/tools/btgatt-server.c
> +++ b/tools/btgatt-server.c
> @@ -94,6 +94,8 @@ struct server {
> bool hr_msrmt_enabled;
> int hr_ee_count;
> unsigned int hr_timeout_id;
> +
> + bool indicate;
> };
>
> static void print_prompt(void)
> @@ -285,6 +287,11 @@ static void hr_msrmt_ccc_read_cb(struct gatt_db_attribute *attrib,
> gatt_db_attribute_read_result(attrib, id, 0, value, 2);
> }
>
> +static void conf_callback(void *user_data)
> +{
> + PRLOG("GATT server received confirmation\n");
> +}
> +
> static bool hr_msrmt_cb(void *user_data)
> {
> struct server *server = user_data;
> @@ -302,11 +309,15 @@ static bool hr_msrmt_cb(void *user_data)
> len += 2;
> }
>
> - bt_gatt_server_send_notification(server->gatt,
> + if (server->indicate)
> + bt_gatt_server_send_indication(server->gatt,
> + server->hr_msrmt_handle,
> + pdu, len, conf_callback, NULL, NULL);
> + else
> + bt_gatt_server_send_notification(server->gatt,
> server->hr_msrmt_handle,
> pdu, len);
>
> -
> cur_ee = server->hr_energy_expended;
> server->hr_energy_expended = MIN(UINT16_MAX, cur_ee + 10);
> server->hr_ee_count++;
> @@ -350,7 +361,14 @@ static void hr_msrmt_ccc_write_cb(struct gatt_db_attribute *attrib,
> PRLOG("HR Measurement Already Enabled\n");
> goto done;
> }
> -
> + server->hr_msrmt_enabled = true;
> + }
> + else if (value[0] == 0x02) {
> + if (server->hr_msrmt_enabled) {
> + PRLOG("HR Measurement Already Enabled\n");
> + goto done;
> + }
> + server->indicate = true;
> server->hr_msrmt_enabled = true;
> } else
> ecode = 0x80;
> @@ -494,7 +512,8 @@ static void populate_hr_service(struct server *server)
> bt_uuid16_create(&uuid, UUID_HEART_RATE_MSRMT);
> hr_msrmt = gatt_db_service_add_characteristic(service, &uuid,
> BT_ATT_PERM_NONE,
> - BT_GATT_CHRC_PROP_NOTIFY,
> + BT_GATT_CHRC_PROP_NOTIFY |
> + BT_GATT_CHRC_PROP_INDICATE,
> NULL, NULL, NULL);

I would have added a different characteristic for this, afaik HR does
not use indications.

> server->hr_msrmt_handle = gatt_db_attribute_get_handle(hr_msrmt);
>
> @@ -533,8 +552,8 @@ static void populate_hr_service(struct server *server)
> static void populate_db(struct server *server)
> {
> populate_gap_service(server);
> - populate_gatt_service(server);
> populate_hr_service(server);
> + populate_gatt_service(server);
> }
>
> static struct server *server_create(int fd, uint16_t mtu, bool hr_visible)
> @@ -589,6 +608,7 @@ static struct server *server_create(int fd, uint16_t mtu, bool hr_visible)
> }
>
> server->hr_visible = hr_visible;
> + server->indicate = false;
>
> if (verbose) {
> bt_att_set_debug(server->att, att_debug_cb, "att: ", NULL);
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Luiz Augusto von Dentz

2015-08-26 09:59:55

by Gowtham Anandha Babu

[permalink] [raw]
Subject: [PATCH 2/2] tools/btgatt-server: Handle Charc Value Indication

This patch verifies that a Generic Attribute Profile server can
send a Characteristic Value Indication.
TC_GAI_SR_BV_01_C - PASS
---
tools/btgatt-server.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/tools/btgatt-server.c b/tools/btgatt-server.c
index 292b584..5b38d47 100644
--- a/tools/btgatt-server.c
+++ b/tools/btgatt-server.c
@@ -94,6 +94,8 @@ struct server {
bool hr_msrmt_enabled;
int hr_ee_count;
unsigned int hr_timeout_id;
+
+ bool indicate;
};

static void print_prompt(void)
@@ -285,6 +287,11 @@ static void hr_msrmt_ccc_read_cb(struct gatt_db_attribute *attrib,
gatt_db_attribute_read_result(attrib, id, 0, value, 2);
}

+static void conf_callback(void *user_data)
+{
+ PRLOG("GATT server received confirmation\n");
+}
+
static bool hr_msrmt_cb(void *user_data)
{
struct server *server = user_data;
@@ -302,11 +309,15 @@ static bool hr_msrmt_cb(void *user_data)
len += 2;
}

- bt_gatt_server_send_notification(server->gatt,
+ if (server->indicate)
+ bt_gatt_server_send_indication(server->gatt,
+ server->hr_msrmt_handle,
+ pdu, len, conf_callback, NULL, NULL);
+ else
+ bt_gatt_server_send_notification(server->gatt,
server->hr_msrmt_handle,
pdu, len);

-
cur_ee = server->hr_energy_expended;
server->hr_energy_expended = MIN(UINT16_MAX, cur_ee + 10);
server->hr_ee_count++;
@@ -350,7 +361,14 @@ static void hr_msrmt_ccc_write_cb(struct gatt_db_attribute *attrib,
PRLOG("HR Measurement Already Enabled\n");
goto done;
}
-
+ server->hr_msrmt_enabled = true;
+ }
+ else if (value[0] == 0x02) {
+ if (server->hr_msrmt_enabled) {
+ PRLOG("HR Measurement Already Enabled\n");
+ goto done;
+ }
+ server->indicate = true;
server->hr_msrmt_enabled = true;
} else
ecode = 0x80;
@@ -494,7 +512,8 @@ static void populate_hr_service(struct server *server)
bt_uuid16_create(&uuid, UUID_HEART_RATE_MSRMT);
hr_msrmt = gatt_db_service_add_characteristic(service, &uuid,
BT_ATT_PERM_NONE,
- BT_GATT_CHRC_PROP_NOTIFY,
+ BT_GATT_CHRC_PROP_NOTIFY |
+ BT_GATT_CHRC_PROP_INDICATE,
NULL, NULL, NULL);
server->hr_msrmt_handle = gatt_db_attribute_get_handle(hr_msrmt);

@@ -533,8 +552,8 @@ static void populate_hr_service(struct server *server)
static void populate_db(struct server *server)
{
populate_gap_service(server);
- populate_gatt_service(server);
populate_hr_service(server);
+ populate_gatt_service(server);
}

static struct server *server_create(int fd, uint16_t mtu, bool hr_visible)
@@ -589,6 +608,7 @@ static struct server *server_create(int fd, uint16_t mtu, bool hr_visible)
}

server->hr_visible = hr_visible;
+ server->indicate = false;

if (verbose) {
bt_att_set_debug(server->att, att_debug_cb, "att: ", NULL);
--
1.9.1