* [PATCH] gatt-server: Fix mutlpile definition of same func
@ 2015-02-06 12:47 Gowtham Anandha Babu
2015-02-13 11:20 ` Gowtham Anandha Babu
2015-02-13 11:33 ` Johan Hedberg
0 siblings, 2 replies; 6+ messages in thread
From: Gowtham Anandha Babu @ 2015-02-06 12:47 UTC (permalink / raw)
To: linux-bluetooth; +Cc: bharat.panda, cpgs, Gowtham Anandha Babu
Removed 'put_uuid_le' func from gatt-server,
which was already defined in gatt-helpers.
---
src/shared/gatt-helpers.c | 2 +-
src/shared/gatt-helpers.h | 2 ++
src/shared/gatt-server.c | 21 ---------------------
3 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c
index a33f960..6dfc24f 100644
--- a/src/shared/gatt-helpers.c
+++ b/src/shared/gatt-helpers.c
@@ -567,7 +567,7 @@ bool bt_gatt_exchange_mtu(struct bt_att *att, uint16_t client_rx_mtu,
return true;
}
-static void put_uuid_le(const bt_uuid_t *src, void *dst)
+void put_uuid_le(const bt_uuid_t *src, void *dst)
{
bt_uuid_t uuid;
diff --git a/src/shared/gatt-helpers.h b/src/shared/gatt-helpers.h
index 0217e82..7a2076b 100644
--- a/src/shared/gatt-helpers.h
+++ b/src/shared/gatt-helpers.h
@@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att, uint16_t start, uint16_t end,
bt_gatt_discovery_callback_t callback,
void *user_data,
bt_gatt_destroy_func_t destroy);
+
+void put_uuid_le(const bt_uuid_t *src, void *dst);
diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c
index 8f7b5cd..0652d3d 100644
--- a/src/shared/gatt-server.c
+++ b/src/shared/gatt-server.c
@@ -499,27 +499,6 @@ error:
queue_destroy(q, NULL);
}
-static void put_uuid_le(const bt_uuid_t *src, void *dst)
-{
- bt_uuid_t uuid;
-
- switch (src->type) {
- case BT_UUID16:
- put_le16(src->value.u16, dst);
- break;
- case BT_UUID128:
- bswap_128(&src->value.u128, dst);
- break;
- case BT_UUID32:
- bt_uuid_to_uuid128(src, &uuid);
- bswap_128(&uuid.value.u128, dst);
- break;
- case BT_UUID_UNSPEC:
- default:
- break;
- }
-}
-
static bool encode_find_info_rsp(struct gatt_db *db, struct queue *q,
uint16_t mtu,
uint8_t *pdu, uint16_t *len)
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH] gatt-server: Fix mutlpile definition of same func
2015-02-06 12:47 [PATCH] gatt-server: Fix mutlpile definition of same func Gowtham Anandha Babu
@ 2015-02-13 11:20 ` Gowtham Anandha Babu
2015-02-13 12:53 ` Luiz Augusto von Dentz
2015-02-13 11:33 ` Johan Hedberg
1 sibling, 1 reply; 6+ messages in thread
From: Gowtham Anandha Babu @ 2015-02-13 11:20 UTC (permalink / raw)
To: linux-bluetooth
Ping.
> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> Sent: Friday, February 06, 2015 6:17 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: bharat.panda@samsung.com; cpgs@samsung.com; Gowtham Anandha
> Babu
> Subject: [PATCH] gatt-server: Fix mutlpile definition of same func
>
> Removed 'put_uuid_le' func from gatt-server, which was already defined in
> gatt-helpers.
> ---
> src/shared/gatt-helpers.c | 2 +-
> src/shared/gatt-helpers.h | 2 ++
> src/shared/gatt-server.c | 21 ---------------------
> 3 files changed, 3 insertions(+), 22 deletions(-)
>
> diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c index
> a33f960..6dfc24f 100644
> --- a/src/shared/gatt-helpers.c
> +++ b/src/shared/gatt-helpers.c
> @@ -567,7 +567,7 @@ bool bt_gatt_exchange_mtu(struct bt_att *att,
> uint16_t client_rx_mtu,
> return true;
> }
>
> -static void put_uuid_le(const bt_uuid_t *src, void *dst)
> +void put_uuid_le(const bt_uuid_t *src, void *dst)
> {
> bt_uuid_t uuid;
>
> diff --git a/src/shared/gatt-helpers.h b/src/shared/gatt-helpers.h index
> 0217e82..7a2076b 100644
> --- a/src/shared/gatt-helpers.h
> +++ b/src/shared/gatt-helpers.h
> @@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att,
> uint16_t start, uint16_t end,
> bt_gatt_discovery_callback_t
> callback,
> void *user_data,
> bt_gatt_destroy_func_t destroy);
> +
> +void put_uuid_le(const bt_uuid_t *src, void *dst);
> diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c index
> 8f7b5cd..0652d3d 100644
> --- a/src/shared/gatt-server.c
> +++ b/src/shared/gatt-server.c
> @@ -499,27 +499,6 @@ error:
> queue_destroy(q, NULL);
> }
>
> -static void put_uuid_le(const bt_uuid_t *src, void *dst) -{
> - bt_uuid_t uuid;
> -
> - switch (src->type) {
> - case BT_UUID16:
> - put_le16(src->value.u16, dst);
> - break;
> - case BT_UUID128:
> - bswap_128(&src->value.u128, dst);
> - break;
> - case BT_UUID32:
> - bt_uuid_to_uuid128(src, &uuid);
> - bswap_128(&uuid.value.u128, dst);
> - break;
> - case BT_UUID_UNSPEC:
> - default:
> - break;
> - }
> -}
> -
> static bool encode_find_info_rsp(struct gatt_db *db, struct queue *q,
> uint16_t mtu,
> uint8_t *pdu, uint16_t *len)
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gatt-server: Fix mutlpile definition of same func
2015-02-06 12:47 [PATCH] gatt-server: Fix mutlpile definition of same func Gowtham Anandha Babu
2015-02-13 11:20 ` Gowtham Anandha Babu
@ 2015-02-13 11:33 ` Johan Hedberg
2015-02-13 13:49 ` Luiz Augusto von Dentz
1 sibling, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2015-02-13 11:33 UTC (permalink / raw)
To: Gowtham Anandha Babu; +Cc: linux-bluetooth, bharat.panda, cpgs
Hi,
On Fri, Feb 06, 2015, Gowtham Anandha Babu wrote:
> --- a/src/shared/gatt-helpers.h
> +++ b/src/shared/gatt-helpers.h
> @@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att, uint16_t start, uint16_t end,
> bt_gatt_discovery_callback_t callback,
> void *user_data,
> bt_gatt_destroy_func_t destroy);
> +
> +void put_uuid_le(const bt_uuid_t *src, void *dst);
gatt-helpers.h uses a namespace prefix of "bt_gatt" so you should at the
very least conform to that. The function name would then become e.g.
bt_gatt_put_uuid(). Besides that I don't have any objections to the
patch.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gatt-server: Fix mutlpile definition of same func
2015-02-13 11:20 ` Gowtham Anandha Babu
@ 2015-02-13 12:53 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2015-02-13 12:53 UTC (permalink / raw)
To: Gowtham Anandha Babu; +Cc: linux-bluetooth@vger.kernel.org
Hi Gowtham,
On Fri, Feb 13, 2015 at 1:20 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Ping.
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
>> Sent: Friday, February 06, 2015 6:17 PM
>> To: linux-bluetooth@vger.kernel.org
>> Cc: bharat.panda@samsung.com; cpgs@samsung.com; Gowtham Anandha
>> Babu
>> Subject: [PATCH] gatt-server: Fix mutlpile definition of same func
>>
>> Removed 'put_uuid_le' func from gatt-server, which was already defined in
>> gatt-helpers.
>> ---
>> src/shared/gatt-helpers.c | 2 +-
>> src/shared/gatt-helpers.h | 2 ++
>> src/shared/gatt-server.c | 21 ---------------------
>> 3 files changed, 3 insertions(+), 22 deletions(-)
>>
>> diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c index
>> a33f960..6dfc24f 100644
>> --- a/src/shared/gatt-helpers.c
>> +++ b/src/shared/gatt-helpers.c
>> @@ -567,7 +567,7 @@ bool bt_gatt_exchange_mtu(struct bt_att *att,
>> uint16_t client_rx_mtu,
>> return true;
>> }
>>
>> -static void put_uuid_le(const bt_uuid_t *src, void *dst)
>> +void put_uuid_le(const bt_uuid_t *src, void *dst)
>> {
>> bt_uuid_t uuid;
>>
>> diff --git a/src/shared/gatt-helpers.h b/src/shared/gatt-helpers.h index
>> 0217e82..7a2076b 100644
>> --- a/src/shared/gatt-helpers.h
>> +++ b/src/shared/gatt-helpers.h
>> @@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att,
>> uint16_t start, uint16_t end,
>> bt_gatt_discovery_callback_t
>> callback,
>> void *user_data,
>> bt_gatt_destroy_func_t destroy);
>> +
>> +void put_uuid_le(const bt_uuid_t *src, void *dst);
>> diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c index
>> 8f7b5cd..0652d3d 100644
>> --- a/src/shared/gatt-server.c
>> +++ b/src/shared/gatt-server.c
>> @@ -499,27 +499,6 @@ error:
>> queue_destroy(q, NULL);
>> }
>>
>> -static void put_uuid_le(const bt_uuid_t *src, void *dst) -{
>> - bt_uuid_t uuid;
>> -
>> - switch (src->type) {
>> - case BT_UUID16:
>> - put_le16(src->value.u16, dst);
>> - break;
>> - case BT_UUID128:
>> - bswap_128(&src->value.u128, dst);
>> - break;
>> - case BT_UUID32:
>> - bt_uuid_to_uuid128(src, &uuid);
>> - bswap_128(&uuid.value.u128, dst);
>> - break;
>> - case BT_UUID_UNSPEC:
>> - default:
>> - break;
>> - }
>> -}
>> -
>> static bool encode_find_info_rsp(struct gatt_db *db, struct queue *q,
>> uint16_t mtu,
>> uint8_t *pdu, uint16_t *len)
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
>> the body of a message to majordomo@vger.kernel.org More majordomo
>> info at http://vger.kernel.org/majordomo-info.html
Pushed, thansl
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gatt-server: Fix mutlpile definition of same func
2015-02-13 11:33 ` Johan Hedberg
@ 2015-02-13 13:49 ` Luiz Augusto von Dentz
2015-02-13 14:25 ` Gowtham Anandha Babu
0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2015-02-13 13:49 UTC (permalink / raw)
To: Gowtham Anandha Babu, linux-bluetooth@vger.kernel.org,
Bharat Panda, cpgs
Hi Johan,
On Fri, Feb 13, 2015 at 1:33 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi,
>
> On Fri, Feb 06, 2015, Gowtham Anandha Babu wrote:
>> --- a/src/shared/gatt-helpers.h
>> +++ b/src/shared/gatt-helpers.h
>> @@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att, uint16_t start, uint16_t end,
>> bt_gatt_discovery_callback_t callback,
>> void *user_data,
>> bt_gatt_destroy_func_t destroy);
>> +
>> +void put_uuid_le(const bt_uuid_t *src, void *dst);
>
> gatt-helpers.h uses a namespace prefix of "bt_gatt" so you should at the
> very least conform to that. The function name would then become e.g.
> bt_gatt_put_uuid(). Besides that I don't have any objections to the
> patch.
You are absolutely right, this function does not belong here, Ive send
and patch moving it to lib/uuid.h where bt_uuid is implemented since
it is given as parameter here.
@Gowtham, I hope you are paying attention to the outcome of these changes.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] gatt-server: Fix mutlpile definition of same func
2015-02-13 13:49 ` Luiz Augusto von Dentz
@ 2015-02-13 14:25 ` Gowtham Anandha Babu
0 siblings, 0 replies; 6+ messages in thread
From: Gowtham Anandha Babu @ 2015-02-13 14:25 UTC (permalink / raw)
To: 'Luiz Augusto von Dentz', linux-bluetooth,
'Johan Hedberg'
Cc: 'Bharat Panda', cpgs
Hi Johan & Luiz,
> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Friday, February 13, 2015 7:19 PM
> To: Gowtham Anandha Babu; linux-bluetooth@vger.kernel.org; Bharat
> Panda; cpgs@samsung.com
> Subject: Re: [PATCH] gatt-server: Fix mutlpile definition of same func
>
> Hi Johan,
>
> On Fri, Feb 13, 2015 at 1:33 PM, Johan Hedberg <johan.hedberg@gmail.com>
> wrote:
> > Hi,
> >
> > On Fri, Feb 06, 2015, Gowtham Anandha Babu wrote:
> >> --- a/src/shared/gatt-helpers.h
> >> +++ b/src/shared/gatt-helpers.h
> >> @@ -105,3 +105,5 @@ bool bt_gatt_read_by_type(struct bt_att *att,
> uint16_t start, uint16_t end,
> >> bt_gatt_discovery_callback_t callback,
> >> void *user_data,
> >> bt_gatt_destroy_func_t
> >> destroy);
> >> +
> >> +void put_uuid_le(const bt_uuid_t *src, void *dst);
> >
> > gatt-helpers.h uses a namespace prefix of "bt_gatt" so you should at
> > the very least conform to that. The function name would then become e.g.
> > bt_gatt_put_uuid(). Besides that I don't have any objections to the
> > patch.
>
> You are absolutely right, this function does not belong here, Ive send and
> patch moving it to lib/uuid.h where bt_uuid is implemented since it is given
> as parameter here.
>
> @Gowtham, I hope you are paying attention to the outcome of these
> changes.
>
I am about to submit a patch to address Johan comments (to add "bt_uuid" prefix to put_uuid_le func).
Anyway your patch optimizes the whole thing. Thanks !.
Since I am new to BlueZ, may be it will take some time get an overview of all.
Please feel free to correct my patches in future, if anything is wrong.
Regards,
Gowtham Anandha Babu
>
> --
> Luiz Augusto von Dentz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-13 14:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 12:47 [PATCH] gatt-server: Fix mutlpile definition of same func Gowtham Anandha Babu
2015-02-13 11:20 ` Gowtham Anandha Babu
2015-02-13 12:53 ` Luiz Augusto von Dentz
2015-02-13 11:33 ` Johan Hedberg
2015-02-13 13:49 ` Luiz Augusto von Dentz
2015-02-13 14:25 ` Gowtham Anandha Babu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox