Linux bluetooth development
 help / color / mirror / Atom feed
From: Maksim Krasnyanskiy <maxk@qualcomm.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Serial port baud rate autodetection.
Date: Fri, 24 Aug 2001 15:13:27 -0700	[thread overview]
Message-ID: <4.3.1.0.20010824144506.02100320@mail1> (raw)

Folks,

I've been playing with the baud rate auto detection for a while.
I hacked hci_uart driver to provide nice read/write interface before actual HCI device registration.
This allows to reuse it serial stream parsing engine, so  you can read/write complete HCI frames
to/from tty. I also added baud rate detection logic to hcid.  
Algorithm is pretty simple (we've already discussed it):
	1. Start at highest speed (115200 for now).
	2. Send read local version command
	3. Wait for any event
		3.1 Timed out: decrease speed, goto 1
		3.2 Got it: proceed with initialization. 

All that seems to work. But here is the problem. For some reason EBDK|AK goes totally numb 
when you play with baud rate. And I could not got any event from it until hard reset. 
You can easily verify that yourself:
	Reset DK and start hcid on 57600.
	Everything works.
	Now do: 
		stty 115200 < /dev/ttyS0
		hciconfig hci0 version # or any other command, data, etc
		(Time out)
		stty 57600 < /dev/ttyS0
	That's it. After this point DK is not responding even though we switched back to 57600.
		hciconfig hci0 version
		(Time out)

There is only way to bring it back after above trick - hard reset. Same thing happens when hcid tries to scan baud rates.
I tried pretty much everything: flushing, sending bunch of zeros before command, voodoo dancing, etc. Nothing works.
So I thought hell with it, I'd rather do something more important (like PAN or role switch for example).
Is anybody else interested in playing with that ? 
I'll keep modified UART driver and hcid. Let me know if you need them.

Regards
Max

  



	
		  


	



Maksim Krasnyanskiy	
Senior Kernel Engineer
Qualcomm Incorporated

maxk@qualcomm.com
http://bluez.sf.net
http://vtun.sf.net


_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/bluez-devel

                 reply	other threads:[~2001-08-24 22:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.3.1.0.20010824144506.02100320@mail1 \
    --to=maxk@qualcomm.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox