Thread (7 messages) flat view 7 messages, 3 authors, 2011-04-04

Re: [PATCH 1/2] Bluetooth: Add mgmt_device_found event

From: Anderson Lizardo <hidden>
Date: 2011-03-30 12:30:38

Hi Johan,

On Wed, Mar 30, 2011 at 6:18 AM,  [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help