OSDN Git Service

Fix g_attrib_send() to include a new ID parameter
authorBrian Gix <bgix@codeaurora.org>
Fri, 7 Jan 2011 00:39:42 +0000 (16:39 -0800)
committerJohan Hedberg <johan.hedberg@nokia.com>
Fri, 7 Jan 2011 19:31:31 +0000 (21:31 +0200)
commit7f0b31cbb436a93e41f1b67cbbd2e7d217b9d0c7
treebcb63c689013df274a31c5a15c79b7d5237e74f5
parent03085e6ba3e636e35e0395b694077635a9b0f563
Fix g_attrib_send() to include a new ID parameter

Overall purpose of change is to enable a GATT procedure to be
executed atomically, even if it requires multiple ATT
request/response transactions.

Fix g_attrib_send() to include an ID parameter, if the pkt to
be sent should be added to the Head of the pkt queue.  If the
ID is Zero, legacy functionality is maintained, and the pkt will
be added at the tail of the queuer, and a new ID will be generated,
and returned to the caller. If ID is non-zero, the pkt will be
added to the head of the queue, with the ID value requested, which
will also be returned to the caller.

Fix received_data() to not service the send queue until after the
received data has been processed by calling the cmd->func()
callback, to allow the callback to insert another pkt on the head
of the queue.

Fix all callers of g_attrib_send() to include new parameter.
attrib/client.c
attrib/gatt.c
attrib/gattrib.c
attrib/gattrib.h
attrib/gatttool.c
src/attrib-server.c