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

RE: [bluetooth-dev] How do I setup/use a virtual serial port


To be able to run the ttyBT0 as 'a standard serialport' you still need to have the actual physical port used by the stack open (e.g ttySx) during the whole session. If you exit btd the ttySx will be closed automatically which will prevent the stack from communication with physical serial port.

So if you want for example minicom to run on ttyBTx you have to keep ttySx open after a connect (add a while(1) ... in btd) but close ttyBT0. Now in another process open minicom or whatever you want to use on ttyBT0, I have tried cat  /dev/ttyBT0 which worked pretty well.

These things will be fixed properly eventually, however until then you'll have to do it like I described. If you have any good ideas please let us know.

Mattias Ågren, 
AXIS Communications AB

> >     All references I can find discuss running ppp over the bluetooth
> > link, and btd automatically launches pppd when run as 
> "server".  How do
> > I just setup ttyBT0 as a serial port so that it can be used like a
> > normal serial port.
> >
> > Note:  I'm using no HW, have covered the HCI_EMULATION 
> define thing, and
> > can get as far as opening an RFCOMM connection using btd, 
> but when I try
> > to open /dev/ttyBT0 from kermit it reports "cannot open 
> device".  No I'm
> > not trying to do anything strange like dialing in using 
> kermit to setup
> > a network connection, it just happens to be the easiest RS-232 test
> > program I have found so far.
> I've been thinking about looking at that myself.
> I assume that you do have bt.o insmod'd, right? If so, then I 
> think that
> "open" will work (bt_open will only fail if more than one 
> thing tries to
> open it -- at least in the version of the stack I have). 
> However, writing
> data looks like it will fail if the underlying RF connection 
> doesn't exist
> yet (see rfcomm_send_data in rfcomm.c).  It looks like one side of the
> connection has to go through the steps of executing 'con 
> xx:xx:xx: ...' in
> order to make this happen.
> Here's one thing to try:
> 1. Modify btd.c so that 'start_ppp' defaults to 0 and rebuild it.
> 2. Execute 'btd -e 0 -i none' on the server -- it should exit 
> immediately
> after setting up the stack
> 3. Execute 'btd -e 0 -i none -r client' on the client, and 
> execute the 'con
> 11:22:33:44:55:66 0' command (assuming a serial link), then 'quit'.
> At this point, the stacks on both sides should be up & the rfcomm link
> initialized.  Note that I haven't tried this yet myself. 
> Maybe the Axis
> folks have a real plan for how they want to do this.

> I understand that IrDA requires similar steps to setup the 
> tty's... but I'm
> no expert there.
> --Gordon