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

RE: [bluetooth-dev] HCI inquiry implementation



> -----Original Message-----
> From: Ulrich Müller [mailto:muelleru@xxxxxxx.de]
> Sent: 18 June 2001 11:19
> To: bluetooth-dev@xxxxxxx.com
> Subject: [bluetooth-dev] HCI inquiry implementation
> 
> Hi all,
> 
> it seems that my mail from last Thursday didn't come through.
> Next try:
> 
> 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]

The proper fix for this has now been commited to the 
repository.

> - 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.

As far as I can tell from looking into linux/kernel/sched.c,
it should not be a problem.

> - 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.

Feel free to submit a patch ;)

> Ulrich

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