* [PATCH v2 1/3] android/gatt: Remove unused uuid variable
@ 2014-04-04 7:31 Grzegorz Kolodziejczyk
2014-04-04 7:31 ` [PATCH v2 2/3] android/gatt: Remove useless variable cast Grzegorz Kolodziejczyk
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2014-04-04 7:31 UTC (permalink / raw)
To: linux-bluetooth
This patch removes unused uuid string variable.
---
android/gatt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/android/gatt.c b/android/gatt.c
index 7a6a2a2..68e2112 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2215,7 +2215,6 @@ static void handle_client_register_for_notification(const void *buf,
{
const struct hal_cmd_gatt_client_register_for_notification *cmd = buf;
struct notification_data *notification;
- char uuid[MAX_LEN_UUID_STR];
struct gatt_client *client;
struct characteristic *c;
struct element_id match_id;
@@ -2247,7 +2246,6 @@ static void handle_client_register_for_notification(const void *buf,
hal_srvc_id_to_element_id(&cmd->srvc_id, &match_id);
service = queue_find(dev->services, match_srvc_by_element_id,
&match_id);
- bt_uuid_to_string(&match_id.uuid, uuid, MAX_LEN_UUID_STR);
if (!service) {
status = HAL_STATUS_FAILED;
goto failed;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/3] android/gatt: Remove useless variable cast
2014-04-04 7:31 [PATCH v2 1/3] android/gatt: Remove unused uuid variable Grzegorz Kolodziejczyk
@ 2014-04-04 7:31 ` Grzegorz Kolodziejczyk
2014-04-04 7:32 ` [PATCH v2 3/3] android/gatt: Fix matching characteristict Grzegorz Kolodziejczyk
2014-04-04 8:30 ` [PATCH v2 1/3] android/gatt: Remove unused uuid variable Szymon Janc
2 siblings, 0 replies; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2014-04-04 7:31 UTC (permalink / raw)
To: linux-bluetooth
This patch removes useless uint8_t array to bdaddr_t cast.
android2bdaddr function expects const void *buf as first parametr.
---
android/gatt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/gatt.c b/android/gatt.c
index 68e2112..473929d 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2233,7 +2233,7 @@ static void handle_client_register_for_notification(const void *buf,
goto failed;
}
- android2bdaddr((bdaddr_t *)&cmd->bdaddr, &addr);
+ android2bdaddr(&cmd->bdaddr, &addr);
dev = queue_find(conn_list, match_dev_by_bdaddr, &addr);
if (!dev) {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 3/3] android/gatt: Fix matching characteristict
2014-04-04 7:31 [PATCH v2 1/3] android/gatt: Remove unused uuid variable Grzegorz Kolodziejczyk
2014-04-04 7:31 ` [PATCH v2 2/3] android/gatt: Remove useless variable cast Grzegorz Kolodziejczyk
@ 2014-04-04 7:32 ` Grzegorz Kolodziejczyk
2014-04-04 8:30 ` [PATCH v2 1/3] android/gatt: Remove unused uuid variable Szymon Janc
2 siblings, 0 replies; 4+ messages in thread
From: Grzegorz Kolodziejczyk @ 2014-04-04 7:32 UTC (permalink / raw)
To: linux-bluetooth
This patch fixes searching for characteristic within service.
Characteristics should be matched by element id (uuid, instance) not
only instance id. Also redundant helper to match characteristic by
instance is removed.
---
android/gatt.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/android/gatt.c b/android/gatt.c
index 473929d..4f0a656 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -310,14 +310,6 @@ static bool match_descr_by_higher_inst_id(const void *data,
return instance < descr->id.instance;
}
-static bool match_char_by_instance(const void *data, const void *user_data)
-{
- const struct characteristic *ch = data;
- uint8_t inst_id = PTR_TO_INT(user_data);
-
- return inst_id == ch->id.instance;
-}
-
static bool match_notification(const void *a, const void *b)
{
const struct notification_data *a1 = a;
@@ -2251,8 +2243,8 @@ static void handle_client_register_for_notification(const void *buf,
goto failed;
}
- c = queue_find(service->chars, match_char_by_instance,
- INT_TO_PTR(cmd->char_id.inst_id));
+ hal_gatt_id_to_element_id(&cmd->char_id, &match_id);
+ c = queue_find(service->chars, match_char_by_element_id, &match_id);
if (!c) {
status = HAL_STATUS_FAILED;
goto failed;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] android/gatt: Remove unused uuid variable
2014-04-04 7:31 [PATCH v2 1/3] android/gatt: Remove unused uuid variable Grzegorz Kolodziejczyk
2014-04-04 7:31 ` [PATCH v2 2/3] android/gatt: Remove useless variable cast Grzegorz Kolodziejczyk
2014-04-04 7:32 ` [PATCH v2 3/3] android/gatt: Fix matching characteristict Grzegorz Kolodziejczyk
@ 2014-04-04 8:30 ` Szymon Janc
2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2014-04-04 8:30 UTC (permalink / raw)
To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
Hi Grzegorz,
On Friday 04 of April 2014 09:31:58 Grzegorz Kolodziejczyk wrote:
> This patch removes unused uuid string variable.
> ---
> android/gatt.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 7a6a2a2..68e2112 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -2215,7 +2215,6 @@ static void handle_client_register_for_notification(const void *buf,
> {
> const struct hal_cmd_gatt_client_register_for_notification *cmd = buf;
> struct notification_data *notification;
> - char uuid[MAX_LEN_UUID_STR];
> struct gatt_client *client;
> struct characteristic *c;
> struct element_id match_id;
> @@ -2247,7 +2246,6 @@ static void handle_client_register_for_notification(const void *buf,
> hal_srvc_id_to_element_id(&cmd->srvc_id, &match_id);
> service = queue_find(dev->services, match_srvc_by_element_id,
> &match_id);
> - bt_uuid_to_string(&match_id.uuid, uuid, MAX_LEN_UUID_STR);
> if (!service) {
> status = HAL_STATUS_FAILED;
> goto failed;
>
All patches applied, thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-04 8:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04 7:31 [PATCH v2 1/3] android/gatt: Remove unused uuid variable Grzegorz Kolodziejczyk
2014-04-04 7:31 ` [PATCH v2 2/3] android/gatt: Remove useless variable cast Grzegorz Kolodziejczyk
2014-04-04 7:32 ` [PATCH v2 3/3] android/gatt: Fix matching characteristict Grzegorz Kolodziejczyk
2014-04-04 8:30 ` [PATCH v2 1/3] android/gatt: Remove unused uuid variable Szymon Janc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox