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

[bluetooth-dev] New feature : get rfcomm server channel of new connections



Hi all,

The design of RFComm is not really good if we want to be automatically informed when a new connection happens, and on which channel and line it happens. Because we absolutely need to have such information, and because I haven't the time to redesign RFComm, I added a possibility to be informed of the server channel through a new proc file. I first implemented a method through ictl, but if I stay waiting in an ioctl, there is no other ioctl possible until I get out of the first one. This is not really what I wanted.

So I decided to create a new proc file. It has some limitations, but it can be usefull for people that need to know on which server channel a connection happen, to respond with the appropriate userland program.

--> HOW TO USE

The new proc file's name is bt_channel_con . You have to enable CONFIG_BLUETOOTH_PROC if you want to have it created.
Then, you can make a read on it. It's blocking.
When a connection happens, you will recieve the information as a string like :

<line>:<server channel>\n

Then, you can start whatever userland program you want, depending on which server channe the connection has been made.

--> IMPORTANT LIMITATIONS

Unfortunately, the same function in the stack is used when initiating or receiving a connection. So if you initiate a connection on server channel x, line 0, you will recieve 0:x\n in the proc file...

If a connection has already been made when you read the proc file, you won't have any information on it. You should read the proc file before than the connection happens.


--> NOTES

It should work with any kernel version. But it has only been tested on 2.4.18 kernel.

-- 
Alain Paschoud                      SMARTDATA SA
alain.paschoud@xxxxxxx.ch         PSE-A
http://www.smartdata.ch             1015 Lausanne
Phone +41-21-693'84'98              
Fax   +41-27-693'84'91              
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com