Re: [PATCH BlueZ v1 12/17] core/gatt: Add btd_gatt_database_notify function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

> On Thu, Feb 26, 2015 at 12:51 AM, Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx> wrote:
> Hi Arman,
>
> On Thu, Feb 26, 2015 at 7:13 AM, Arman Uguray <armansito@xxxxxxxxxxxx> wrote:
>> This patch add the btd_gatt_database_notify function to database's
>> public API. This allows upper layers to send out notifications
>> and indications to all connected devices that have configured the
>> specified CCC descriptor.
>> ---
>>  src/gatt-database.c | 4 ++--
>>  src/gatt-database.h | 5 +++++
>>  2 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gatt-database.c b/src/gatt-database.c
>> index ebfcf2d..d75b971 100644
>> --- a/src/gatt-database.c
>> +++ b/src/gatt-database.c
>> @@ -737,7 +737,7 @@ static void send_notification_to_device(void *data, void *user_data)
>>                                                         NULL, NULL);
>>  }
>>
>> -static void send_notification_to_devices(struct btd_gatt_database *database,
>> +void btd_gatt_database_notify(struct btd_gatt_database *database,
>>                                         uint16_t handle, const uint8_t *value,
>>                                         uint16_t len, uint16_t ccc_handle,
>>                                         bool indicate)
>> @@ -781,7 +781,7 @@ static void send_service_changed(struct btd_gatt_database *database,
>>         put_le16(start, value);
>>         put_le16(end, value + 2);
>>
>> -       send_notification_to_devices(database, handle, value, sizeof(value),
>> +       btd_gatt_database_notify(database, handle, value, sizeof(value),
>>                                                         ccc_handle, true);
>>  }
>>
>> diff --git a/src/gatt-database.h b/src/gatt-database.h
>> index 163b601..2a89ad6 100644
>> --- a/src/gatt-database.h
>> +++ b/src/gatt-database.h
>> @@ -34,3 +34,8 @@ btd_gatt_database_add_ccc(struct btd_gatt_database *database,
>>                                 btd_gatt_database_ccc_write_t write_callback,
>>                                 void *user_data,
>>                                 btd_gatt_database_destroy_t destroy);
>> +
>> +void btd_gatt_database_notify(struct btd_gatt_database *database,
>> +                                       uint16_t handle, const uint8_t *value,
>> +                                       uint16_t len, uint16_t ccc_handle,
>> +                                       bool indicate);
>> --
>> 2.2.0.rc0.207.ga3a616c
>
> I think we should make gatt_db notify about database changes directly
> so anyone interested in attribute value changes can subscribe to it.
>

So, after our discussion on IRC, will you be implementing this or
should I? If you give me a description of the kind of API you're
thinking about and how things should fit together, then I can have a
go at it, unless you've started working on it already.

>
>
> --
> Luiz Augusto von Dentz

Thanks!
Arman
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux