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

[bluetooth-dev] HCI inquiry implementation



Hi all,

I have a few suggestions regarding the HCI inquiry implementation.
- the current implementation does not filter duplicates.
   In hci.c, process_event(), case INQUIRY_RESULT, there is the
   code:

for (j = 0; j < inq_res->nbr_of_units; j++) {
    if (!memcmp(inq_res->bd_addr +
       inq_res->nbr_of_units * 6,  tmp_bd,
       6)) {
          j = inq_res->nbr_of_units;
       }
}
if (j >= inq_res->nbr_of_units)
    [add new result]

I think it should be:

for (j = 0; j < inq_res->nbr_of_units; j++) {
    if (!memcmp(inq_res->bd_addr +
       j * 6, tmp_bd,6)) {
          j = inq_res->nbr_of_units + 1; /* j > inq_res->nbr_of_units */
       }
    }
if (j == inq_res->nbr_of_units)
    [add new result]

- both send_inq_cmd_block() and send_cmd_block() change
   the task state to TASK_INTERRUPTIBLE, but never restore the
   previous state. I think that may cause some trouble.
- I would prefer if the inquiry functions return some more information
   beside the device address. Especially the class of device field can
   be of a great value.

Ulrich

-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com