Re: [PATCH 1/6] Add dump for ATT MTU req/resp and notify value

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

 



This patchset misses a first patch that adds att.c. I'll be reposting
them along with it. Sorry for the inconvenience.

On Wed, Feb 9, 2011 at 11:53 AM, Andre Dieb Martins
<andre.dieb@xxxxxxxxxxx> wrote:
> ---
> Âparser/att.c | Â 31 ++++++++++++++++++++++++++++++-
> Â1 files changed, 30 insertions(+), 1 deletions(-)
>
> diff --git a/parser/att.c b/parser/att.c
> index b670694..05f9c23 100644
> --- a/parser/att.c
> +++ b/parser/att.c
> @@ -132,12 +132,35 @@ static const char *attop2str(uint8_t op)
> Â Â Â Â}
> Â}
>
> +static void att_mtu_req_dump(int level, struct frame *frm)
> +{
> + Â Â Â uint16_t client_rx_mtu = btohs(htons(get_u16(frm)));
> +
> + Â Â Â p_indent(level, frm);
> + Â Â Â printf("client rx mtu %d\n", client_rx_mtu);
> +}
> +
> +static void att_mtu_resp_dump(int level, struct frame *frm)
> +{
> + Â Â Â uint16_t server_rx_mtu = btohs(htons(get_u16(frm)));
> +
> + Â Â Â p_indent(level, frm);
> + Â Â Â printf("server rx mtu %d\n", server_rx_mtu);
> +}
> +
> Âstatic void att_handle_notify_dump(int level, struct frame *frm)
> Â{
> Â Â Â Âuint16_t handle = btohs(htons(get_u16(frm)));
>
> Â Â Â Âp_indent(level, frm);
> Â Â Â Âprintf("handle 0x%2.2x\n", handle);
> +
> + Â Â Â p_indent(level, frm);
> + Â Â Â printf("value ");
> + Â Â Â while (frm->len > 0) {
> + Â Â Â Â Â Â Â printf("0x%.2x ", get_u8(frm));
> + Â Â Â }
> + Â Â Â printf("\n");
> Â}
>
> Âvoid att_dump(int level, struct frame *frm)
> @@ -147,9 +170,15 @@ void att_dump(int level, struct frame *frm)
> Â Â Â Âop = get_u8(frm);
>
> Â Â Â Âp_indent(level, frm);
> - Â Â Â printf("Opcode: %d (%s)\n", op, attop2str(op));
> + Â Â Â printf("Opcode %d (%s)\n", op, attop2str(op));
>
> Â Â Â Âswitch (op) {
> + Â Â Â Â Â Â Â case ATT_OP_MTU_REQ:
> + Â Â Â Â Â Â Â Â Â Â Â att_mtu_req_dump(level + 1, frm);
> + Â Â Â Â Â Â Â Â Â Â Â break;
> + Â Â Â Â Â Â Â case ATT_OP_MTU_RESP:
> + Â Â Â Â Â Â Â Â Â Â Â att_mtu_resp_dump(level + 1, frm);
> + Â Â Â Â Â Â Â Â Â Â Â break;
> Â Â Â Â Â Â Â Âcase ATT_OP_HANDLE_NOTIFY:
> Â Â Â Â Â Â Â Â Â Â Â Âatt_handle_notify_dump(level + 1, frm);
> Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> --
> 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


[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