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

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



-----Original Message-----
From: Mattias Ågren [mailto:mattias.agren@xxxxxxx.com]
Sent: den 8 december 2000 12:15
To: Hagström Björn; bluetooth-dev@xxxxxxx.com
Subject: RE: [bluetooth-dev] How do I setup a virtual serial port?

If the line isn't in active state that means that either there are no app running on top of the tty or the there is no rfcomm connection attached to it (yet). If no active the driver refuses to send anything.
Could you please supply more logs when connecting the stack, e.g is bt_register_rfcomm done ?
 
 
[Hagström Björn] There seems to be some problem when I connect the stack. I could not find the bt_register_rfcomm... This is the log when I give the command ">con 11:22:33:44:55:66 0 1 0" :
[Hagström Björn] 
Dec  8 13:01:18 p151082 kernel: BT (driver) bt_ioctl: BT connect request
Dec  8 13:01:18 p151082 kernel: 
Dec  8 13:01:18 p151082 kernel: bt_connection obj (16)
Dec  8 13:01:18 p151082 kernel:    0x11 0x22 0x33 0x44 0x55 0x66 0x03 0x40 0x00
0x00 0x00 0x00 0x01 0x00 0x00 0x00 
Dec  8 13:01:18 p151082 kernel:           RFCOMM rfcomm_connect_req: server chan
nel:0, line:0
Dec  8 13:01:18 p151082 kernel:     L2CAP get_con : look for connections in stat
e ANY_STATE (7)
Dec  8 13:01:18 p151082 kernel:     L2CAP get_con : connection not found
Dec  8 13:01:18 p151082 kernel:     L2CAP get_lcon : lcid 64 con_list.count = 0
Dec  8 13:01:18 p151082 kernel:     L2CAP get_lcon : connection lcid : 64 not fo
und
Dec  8 13:01:18 p151082 kernel:     L2CAP Create_con rcid 0
Dec  8 13:01:18 p151082 kernel:     L2CAP insert_con() (64:0) [CLOSED] [RFCOMM]
r_mtu[672] C[yes] link_up[no]
Dec  8 13:01:18 p151082 kernel:     L2CAP insert_con : now 1 connections
Dec  8 13:01:18 p151082 kernel:     L2CAP l2ca_connect_req : create new baseband
 link
Dec  8 13:01:18 p151082 kernel: BT DATA <--|X|     13
Dec  8 13:01:18 p151082 kernel: 
Dec  8 13:01:18 p151082 kernel: bt_write_lower_driver : (13)
Dec  8 13:01:18 p151082 kernel:    0x04 0x04 0x0a 0x66 0x55 0x44 0x33 0x22 0x11
0x00 0x00 0x00 0x01 
Dec  8 13:01:18 p151082 kernel: BT (driver) bt_create_connection: No client stuf
f yet... 
 
[Hagström Björn]  I hope that I have turned on the relevant debug flags. Any ideas?
[Hagström Björn]  Regards.
[Hagström Björn]          Björn
  
-----Original Message-----
From: Bjorn.Hagstrom@xxxxxxx.com [mailto:Bjorn.Hagstrom@xxxxxxx.com]
Sent: den 8 december 2000 11:10
To: bluetooth-dev@xxxxxxx.com
Subject: [bluetooth-dev] How do I setup a virtual serial port?

Hello.
 
I found a mail in the maillist archives that described how to run the ttyBT0 as 'a standard serial port'. However I still encountered some problems when I tried to follow these instructions. When my program tried to write to ttyBT0 i got the following debug message in the /var/log/message:
kernel: BT DATA bt_write_top : line 0 is not in active state
 
I am now running the stack released 1031. The mail I mentioned is pasted at the end of this message.
 
Thanks in advance.
 
Björn Hagstöm

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


  • To: "'Gordon McNutt'" <gmcnutt@xxxxxxx.com>
  • Subject: RE: [bluetooth-dev] How do I setup/use a virtual serial port
  • From: Mattias Ågren <mattias@xxxxxxx.com>
  • Date: Fri, 22 Sep 2000 09:35:24 +0200
  • Cc: bluetooth-dev@xxxxxxx.com
  • Sender: owner-bluetooth-dev@xxxxxxx.com
    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. brgds 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 >