Linux bluetooth development
 help / color / mirror / Atom feed
From: Max Krasnyansky <maxk@qualcomm.com>
To: Alexandros Karypidis <karypid@inf.uth.gr>,
	Marcel Holtmann <marcel@rvs.uni-bielefeld.de>
Cc: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] Re: [Bluez-users] How do I obtain a free PSM automatically?
Date: Tue, 11 Feb 2003 10:23:55 -0800	[thread overview]
Message-ID: <5.1.0.14.2.20030211100822.043916e0@mail1.qualcomm.com> (raw)
In-Reply-To: <200302111822.44704.karypid@inf.uth.gr>

At 06:22 PM 2/11/2003 +0200, Alexandros Karypidis wrote:
>On Monday 10 February 2003 22:49, Max Krasnyansky wrote:
>
>> [...]
>> Currently psm zero means that socket doesn't have PSM assigned to it.
>> bind(psm==0) means that application doesn't need PSM it's simply wants to
>> bind it's socket to some BD address. Which is exactly what L2CAP clients
>> need. So you proposing a change that will brake current bind() interface.
>> Well I guess it won't really break it but it will allocated PSM for all
>> client apps which doesn't make any sense.
>
>Ok, from another e-mail you sent in this thread I realize that I should not 
>consider the PSM as the equivalent of a port number. CIDs are closer to that 
>notion. Sorry, I've only started using Bluetooth for a week now and since IP 
>is all I've ever known, I'm trying (perhaps too much) to find analogies.
That's perfectly ok. No need to apologize. 

>> Why do you think we need dynamic PSM allocation ? l2cap already allocates
>> CIDs dynamically. I don't see why people would want the same thing for
>> PSMs.
>
>Well, assume that I need to run several server processes on a BT device. When 
>each process launches, it needs to bind to a BDADDR:PSM entry point and 
>accept() connections. Currently, I need to pre-assign this PSM value for each 
>server process, as I have no other option. 
>I would like to have a fixed 
>BDADDR:PSM value for only one "special" server and have the others bind() to 
>a BDADDR:I_DONT_CARE_PSM pair. Then, clients could inquire and obtain the 
>PSMs of the other servers from the "special" server at the well-known entry 
>point. It would be very much like a custom "service contact-address 
>discovery" method.
Same problem (I don't really consider it a problem btw) exists in IP. Client has to 
know server's port number. What if the PSM you picked for discovery service is used
by some other service ?
btw That discovery method is called SDP in Bluetooth. You don't have to invent you own.

>Basically, my problem is that when you have a device where you can 
>install/remove services created from various manufacturers, there must exist 
>a global agreement about PSM allocations. For example, suppose I install 2 
>services which are manufactured from entities A and B. Now, A decides that it 
>will receive connections on PSM 15000 and B chooses 16004. No problem. If by 
>pure bad luck they had chosen the same PSM, I would be unable to run both 
>concurrently. 
That's exactly the reason why I don't consider it a problem in Bluetooth world.
There are very few applications exist for Bluetooth. The chances that two different 
proprietary apps pick the same PSM are very slim. Vendors can apply and 
reserve official PSM for well known apps. IP managed that pretty well.

>Ideally, each would obtain an arbitrary PSM when it was launched and publish its contact 
>address via some other mechanism.
Actually I don't think that this is ideal :). Simply because you have to do yet another 
connection to obtain PSM and Bluetooth connections already take too long (mostly baseband).
But I'm not against the idea of dynamic PSMs. We just have to decide what's the best way 
to implement them.

Max

      parent reply	other threads:[~2003-02-11 18:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200302071951.35073.karypid@inf.uth.gr>
     [not found] ` <1044653120.32671.4.camel@pegasus.local>
2003-02-08 11:42   ` [Bluez-users] How do I obtain a free PSM automatically? Stephen Crane
     [not found] ` <200302072329.21333.karypid@inf.uth.gr>
     [not found]   ` <1044653775.32672.14.camel@pegasus.local>
2003-02-08 15:40     ` Alexandros Karypidis
2003-02-08 16:14       ` [Bluez-devel] " Alexandros Karypidis
2003-02-10 21:13         ` Max Krasnyansky
2003-02-11 12:01           ` Marcel Holtmann
2003-02-11 17:26             ` Alexandros Karypidis
2003-02-11 17:52               ` Maksim Yevmenkin
2003-02-11 18:58               ` Max Krasnyansky
2003-02-11 18:06             ` Max Krasnyansky
2003-02-17 14:12               ` Marcel Holtmann
2003-02-18 21:06                 ` Max Krasnyansky
2003-02-18 23:00                   ` Marcel Holtmann
2003-02-19 20:04                     ` Max Krasnyansky
2003-02-11 16:30           ` Alexandros Karypidis
2003-02-10 20:49       ` Max Krasnyansky
2003-02-11 16:22         ` Alexandros Karypidis
2003-02-11 18:04           ` [Bluez-devel] " Maksim Yevmenkin
2003-02-11 18:52             ` Max Krasnyansky
2003-02-11 20:01               ` Maksim Yevmenkin
2003-02-11 21:09                 ` Max Krasnyansky
2003-02-11 18:23           ` Max Krasnyansky [this message]

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=5.1.0.14.2.20030211100822.043916e0@mail1.qualcomm.com \
    --to=maxk@qualcomm.com \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=karypid@inf.uth.gr \
    --cc=marcel@rvs.uni-bielefeld.de \
    /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