Re: [PATCH] Remove automatic battery state change on attribute example

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

 



Hi Luiz,

On Fri, Dec 3, 2010 at 11:37 AM, Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
> Hi,
>
> On Fri, Dec 3, 2010 at 4:24 PM, Claudio Takahasi
> <claudio.takahasi@xxxxxxxxxxxxx> wrote:
>> Legacy code implemented to test Indication and Notification
>> ---
>> Âattrib/example.c | Â 19 -------------------
>> Â1 files changed, 0 insertions(+), 19 deletions(-)
>>
>> diff --git a/attrib/example.c b/attrib/example.c
>> index c29e1e4..2d5b758 100644
>> --- a/attrib/example.c
>> +++ b/attrib/example.c
>> @@ -59,22 +59,6 @@
>> Â#define FMT_KILOGRAM_UUID Â Â Â Â Â Â Â0xA010
>> Â#define FMT_HANGING_UUID Â Â Â Â Â Â Â 0xA011
>>
>> -static guint timeout_id = 0;
>> -
>> -static gboolean change_battery_state(gpointer user_data)
>> -{
>> - Â Â Â static uint8_t state = Â0x05;
>> - Â Â Â uuid_t uuid;
>> - Â Â Â uint8_t atval[1];
>> -
>> - Â Â Â /* Battery state is being increased every 10 seconds. */
>> - Â Â Â atval[0] = state++;
>> - Â Â Â sdp_uuid16_create(&uuid, BATTERY_STATE_UUID);
>> - Â Â Â attrib_db_update(0x0110, &uuid, atval, 1);
>> -
>> - Â Â Â return TRUE;
>> -}
>> -
>> Âstatic int register_attributes(void)
>> Â{
>> Â Â Â Âconst char *devname = "Example Device";
>> @@ -170,8 +154,6 @@ static int register_attributes(void)
>> Â Â Â Âatval[1] = 0x00;
>> Â Â Â Âattrib_db_add(0x0111, &uuid, atval, 2);
>>
>> - Â Â Â timeout_id = g_timeout_add_seconds(10, change_battery_state, NULL);
>> -
>> Â Â Â Â/* Thermometer: primary service definition */
>> Â Â Â Âsdp_uuid16_create(&uuid, GATT_PRIM_SVC_UUID);
>> Â Â Â Âu16 = htons(THERM_HUMIDITY_SVC_UUID);
>> @@ -436,5 +418,4 @@ int server_example_init(void)
>>
>> Âvoid server_example_exit(void)
>> Â{
>> - Â Â Â g_source_remove(timeout_id);
>> Â}
>> --
>> 1.7.3.2
>>
>> --
>> 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
>>
>
> I wonder what is the relation of this code with attrib-server.c, does
> this work if we don't have the attrib server enabled?
>
> --
> Luiz Augusto von Dentz
> Computer Engineer
>

Currently, we don't have compile option to disable the gatt server(in
the core), only configuration option: "EnableAttrib" in the main.conf.
The gatt server example "belongs" to the attribute plugin,
--disable-attrib disables the attrib client and the attribute server
example.

Claudio.
--
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