[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bluetooth-dev] How do I setup/use a virtual serial port
> 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.