All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mathieu Ocaña" <mo@esd-dev.be>
To: linux-bluetooth@vger.kernel.org
Subject: Notify problem in gatt plugin
Date: Mon, 19 Jan 2015 17:20:12 +0100	[thread overview]
Message-ID: <54BD2EBC.7040207@esd-dev.be> (raw)

Hello,

I'm currently working on a plugin to implement a GATT peripheral. Based 
on the plugins/gatt-example and the profiles/alert/server, I finally got 
something which works: read, write, with dbus signaling.
But, notifications doesn't work...
All seems ok until the call to "g_attrib_send()".

>> static void attio_connected_cb(GAttrib *attrib, gpointer user_data)
>> {
>>   [...]
>>   len = enc_notification(p_adapter->batterylevel_chr.level_hnd_value,
>>                     nd->value, nd->len, pdu, len);
>>   [...]
>>   ret = g_attrib_send(attrib, 0, pdu, len, destroy_notify_callback,
>> cb, NULL);
>>   return;
>> }

The parameters passed to g_attrib_send seems valid, I have verified the 
pdu, len and user_data, but I'm not sure to understand well all the 
fields of "attrib" (struct _GAttrib). Moreover the return value is 0.

Some extra details:
- the destroy_notify_callback is not called (maybe normal as the 
notification is not succesfully sent).
- in g_attrib_send, the call to bt_att_send() return 0. After this point 
my understanding of the source code became a little bit fuzzy.

 > It would be great if someone could suggest me a fix or a workaround.

I have also developped some extensions for the function 
gatt_service_add(), such as the support of static value characteristic, 
and the descriptors for presentation format, valid range and user 
description.
 > Before submitting this patch, I want to know which is the patch 
policy for the bluez project? (validation test to perform, etc.).

Regards,

-- 
Mathieu OCAÑA


             reply	other threads:[~2015-01-19 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 16:20 Mathieu Ocaña [this message]
2015-01-20  9:30 ` Notify problem in gatt plugin Luiz Augusto von Dentz
2015-01-20 22:44   ` Mathieu Ocaña
2015-01-28  1:33     ` Notify problem in gatt plugin - solved Mathieu Ocaña

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BD2EBC.7040207@esd-dev.be \
    --to=mo@esd-dev.be \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.