[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-bluetooth
Subject: Re: [PATCH 1/2] Bluetooth: Add mgmt_device_found event
From: Anderson Lizardo <anderson.lizardo () openbossa ! org>
Date: 2011-03-30 12:30:38
Message-ID: AANLkTinxPChXddNN_8Qzv4xxBBhvhpzgFD=qk4eKhcVS () mail ! gmail ! com
[Download RAW message or body]
Hi Johan,
On Wed, Mar 30, 2011 at 6:18 AM, <johan.hedberg@gmail.com> wrote:
> +int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
> + u8 *eir)
> +{
> + struct mgmt_ev_device_found ev;
> +
> + memset(&ev, 0, sizeof(ev));
> +
> + bacpy(&ev.bdaddr, bdaddr);
> + memcpy(ev.dev_class, dev_class, 3);
What about "sizeof(ev.dev_class)" instead of 3 ?
> + ev.rssi = rssi;
> +
> + if (eir)
> + memcpy(ev.eir, eir, HCI_MAX_EIR_LENGTH);
This could be "sizeof(ev.eir)" as well, although it is already clear
by the #define.
> +
> + return mgmt_event(MGMT_EV_DEVICE_FOUND, index, &ev, sizeof(ev), NULL);
> +}
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic