Re: [PATCH v4] Implement ATT handle indications

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

 



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
>
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±ý¶â^n‡r¡öë¨è&£ûz¹Þúzf£¢·hšˆ§~†­†Ûÿÿïÿ‘ê_èæ+v‰¨þ)ßø

[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