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

RE: [bluetooth-dev] readbd and HCI inquiry scan error




Hi,
the problem is that you must be sure that you 
really have sent the baud rate change command 
on the serial port before the baudrate of the 
serial port changes. Thats why the sleep helps
since it is inserted between the command tx and 
the change of serial port speed.

However, as stated before we don't maintain the
code in /apps/bluetooth/btd anymore and recommend
that you use the code in /apps/bluetooth/experimental,
which already has taken care of this. (See bt_vendor.c, 
ericsson_hw_init())

There is another way to fix this in the kernel by
using a function called bt_wait_tx() (in bluetooth.c)
which busy-waits until the serial driver is finished
with a serial port transmission. This is currently 
only used for CSR but if you try it out for ericsson 
aswell I can add it. Have a look in hci_vendor.c to
see how we use it in the CSR case.

BTW...think how easy it would be if the module manufacturers
could send back the command complete on the old baudrate
and _then_ change the speed on the module uart ??!?  ;)

brgds
Mattias

-----Original Message-----
From: Supriyo Chatterjea
To: Hirotsugu Okura
Cc: Mattias Ågren; bluetooth-dev@xxxxxxx.com
Sent: 2001-08-02 11:31
Subject: Re: [bluetooth-dev] readbd and HCI inquiry scan error

Hi Hiro Okura,

Thanks for your help! Inserting the delay solved my problem!

Regards,
Supriyo

PS: Mattias, you may want to take note of the following changes that are
required if someone's using the Ericsson toolkit together with the
openbt
stack. And as Hiro Okura asked, is it the correct way of doing things?
Thanks!

----- Original Message -----
From: "Hirotsugu Okura" <ookura@xxxxxxx.jp>
To: <bluetooth-dev@xxxxxxx.com>
Sent: Wednesday, August 01, 2001 4:58 PM
Subject: Re: [bluetooth-dev] readbd and HCI inquiry scan error


> Hi,
>
> Is the result when using "btd" different from that when using
"btduser"?
> If it is so, the same trouble happened to me.
> It seemed to me that some critical timing happened when executing
> ericsson_init_hw() in btd.c .
>
> To solve the problem, I inserted usleep() like shown below.
> I'm not sure and I want to know if it is the proper way.
> But it is working well now. Any advises are welcome.
>
> Hiro Okura
>
------------------------------------------------------------------------
--
>
>
>
> (From ericsson_init_hw() of openbt-0.0.5 )
>                      :
>                      :
>   sleep(1); // wait for HW...
>   printf("Setting baudrate in Ericsson module!\n");
>   if (ioctl(bt_cfd, HCISETBAUDRATE, &spd) < 0)
>   {
>     perror("HCISETBAUDRATE");
>     exit(1);
>   }
>   /* ================= added  begin================== */
>   usleep(10000);
>   /* ================= added end   ================== */
> #else
>   printf("Setting write_scan_enable in Ericsson module!\n");
>   hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE);
>   sleep(1); /* wait for HW... */
>                       :
>                       :
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe
bluetooth-dev"
in
> the body of a message to majordomo@xxxxxxx.com


_________________________________________________________
Do You Yahoo!?
Get your free @xxxxxxx.com">http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com