Hi Elvis, Is it allowed to have notification and indication bits set to the same characteristic? If it is not allowed you could simplify the logic inside the "for". On Thu, Mar 10, 2011 at 2:01 PM, Elvis PfÃtzenreuter <epx@xxxxxxxxxxx> wrote: > This patch takes advantage of g_attrib_send() implicit guarantee of > queueing i.e. indication is only sent if the previous one has been > confirmed, so we don't need to maintain an explicit queue. > --- > Âsrc/attrib-server.c |  16 ++++++++++++++++ > Â1 files changed, 16 insertions(+), 0 deletions(-) > > diff --git a/src/attrib-server.c b/src/attrib-server.c > index b980b28..f157424 100644 > --- a/src/attrib-server.c > +++ b/src/attrib-server.c > @@ -875,6 +875,8 @@ static void channel_handler(const uint8_t *ipdu, uint16_t len, >        Âlength = find_by_type(start, end, &uuid, value, vlen, >                            Âopdu, channel->mtu); >        Âbreak; > +    case ATT_OP_HANDLE_CNF: > +        return; >    Âcase ATT_OP_READ_MULTI_REQ: >    Âcase ATT_OP_PREP_WRITE_REQ: >    Âcase ATT_OP_EXEC_WRITE_REQ: > @@ -972,6 +974,20 @@ static void attrib_notify_clients(struct attribute *attr) >            Âg_attrib_send(channel->attrib, 0, pdu[0], pdu, len, >                            ÂNULL, NULL, NULL); >        Â} > + > +        /* Indication */ > +        if (g_slist_find_custom(channel->indicate, > +                    GUINT_TO_POINTER(handle), handle_cmp)) { > +            uint8_t pdu[ATT_MAX_MTU]; > +            uint16_t len; The same declarations(pdu and len) exist for Notification. I suggest move to the outer scope. BR, Claudio > + > +            len = enc_indication(attr, pdu, channel->mtu); > +            if (len == 0) > +                return; > + > +            g_attrib_send(channel->attrib, 0, pdu[0], pdu, len, > +                            NULL, NULL, NULL); > +        } >    Â} > Â} > > -- > 1.7.1 > > -- > 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 > ÿô.nÇ·®+%˱é¥wÿº{.nÇ·¥{±ý¶â^nr¡öë¨è&£ûz¹Þúzf£¢·h§~Ûÿÿïÿê_èæ+v¨þ)ßø