Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] Master / Slave question
@ 2006-11-25 15:40 Olivier Le Pogam
  2006-11-26 10:13 ` Marcel Holtmann
  0 siblings, 1 reply; 12+ messages in thread
From: Olivier Le Pogam @ 2006-11-25 15:40 UTC (permalink / raw)
  To: bluez-devel


[-- Attachment #1.1: Type: text/plain, Size: 1149 bytes --]

Hi,

I am trying to make 2 mobile phones connected concurrently
to a RFCOMM server. Please note that they don't support
role switching, so as they initiate the communication, they
are always "master".

My RFCOMM server is a forking one so it can virtually
deal with concurrent clients like on TCP.

I have put lm=accept in hcid.conf

If I open a RFCOMM server on channel 14 and try to make
the 2 mobile connect to channel 14, the first is ok, the
second can't connect. I suppose that's normal, because
channel 14 "slave" is busy linux-side with the first
connection and a "slave" can deal with one connection only.

Then I've launched a second server on channel 15 (server
on channel 14 running concurrently), and i try to make
the first mobile connect to channel 14 and the second
to channel 15 : it's the same, only the first can connect.

I think I have a misunderstanding here, as i thought the
"master/slave" was per channel. Does it mean the "slave" status 
is for the whole adaptor, and once a "slave" connection is
open on one channel, it can't receive other connections at all ?

Thanks a lot for your help,
Oli

[-- Attachment #1.2: Type: text/html, Size: 2763 bytes --]

[-- Attachment #2: "AVG certification" --]
[-- Type: text/plain, Size: 151 bytes --]

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.15/550 - Release Date: 24/11/2006


[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-25 15:40 [Bluez-devel] Master / Slave question Olivier Le Pogam
@ 2006-11-26 10:13 ` Marcel Holtmann
  2006-11-27 20:05   ` Olivier Le Pogam
  0 siblings, 1 reply; 12+ messages in thread
From: Marcel Holtmann @ 2006-11-26 10:13 UTC (permalink / raw)
  To: Olivier Le Pogam, BlueZ development

Hi Olivier,

> I am trying to make 2 mobile phones connected concurrently
> to a RFCOMM server. Please note that they don't support
> role switching, so as they initiate the communication, they
> are always "master".
>  
> My RFCOMM server is a forking one so it can virtually
> deal with concurrent clients like on TCP.
>  
> I have put lm=accept in hcid.conf
>  
> If I open a RFCOMM server on channel 14 and try to make
> the 2 mobile connect to channel 14, the first is ok, the
> second can't connect. I suppose that's normal, because
> channel 14 "slave" is busy linux-side with the first
> connection and a "slave" can deal with one connection only.
>  
> Then I've launched a second server on channel 15 (server
> on channel 14 running concurrently), and i try to make
> the first mobile connect to channel 14 and the second
> to channel 15 : it's the same, only the first can connect.
>  
> I think I have a misunderstanding here, as i thought the
> "master/slave" was per channel. Does it mean the "slave" status 
> is for the whole adaptor, and once a "slave" connection is
> open on one channel, it can't receive other connections at all ?

the master/slave thing is per ACL connection. However there can only be
one ACL connection between two devices. Run "hcidump -X -V" and see
what's the actual error message on the HCI level.

Regards

Marcel




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-26 10:13 ` Marcel Holtmann
@ 2006-11-27 20:05   ` Olivier Le Pogam
  2006-11-28 10:24     ` Peter Wippich
  0 siblings, 1 reply; 12+ messages in thread
From: Olivier Le Pogam @ 2006-11-27 20:05 UTC (permalink / raw)
  To: BlueZ development

Hi Marcel,

Re this, I've done what you advised :

>> I am trying to make 2 mobile phones connected concurrently
>> to a RFCOMM server. Please note that they don't support
>> role switching, so as they initiate the communication, they
>> are always "master".
>>
>> My RFCOMM server is a forking one so it can virtually
>> deal with concurrent clients like on TCP.
>>
>> I have put lm=accept in hcid.conf
>>
>> If I open a RFCOMM server on channel 14 and try to make
>> the 2 mobile connect to channel 14, the first is ok, the
>> second can't connect. I suppose that's normal, because
>> channel 14 "slave" is busy linux-side with the first
>> connection and a "slave" can deal with one connection only.
>>
>> Then I've launched a second server on channel 15 (server
>> on channel 14 running concurrently), and i try to make
>> the first mobile connect to channel 14 and the second
>> to channel 15 : it's the same, only the first can connect.
>>
>> I think I have a misunderstanding here, as i thought the
>> "master/slave" was per channel. Does it mean the "slave" status
>> is for the whole adaptor, and once a "slave" connection is
>> open on one channel, it can't receive other connections at all ?
>
> the master/slave thing is per ACL connection. However there can only be
> one ACL connection between two devices. Run "hcidump -X -V" and see
> what's the actual error message on the HCI level.

- I launch both servers, one on channel 14, the other on channel 15

- I have made a hcidump -X -V with only one mobile connecting to
server on channel 14, I have dlci : 28

- I have made a hcidump -X -V with only one mobile connecting to
server on channel 15, I have dlci : 30

- When trying to make both connect concurrently, one to channel 14
the other to channel 15, once the first is connected the second can't,
and I have **absolulety nothing** in the HCI dump related to the
failed attempt, i.e. I have a final log quite similar to a single connection
one to the channel that has been successful. Could there be a lock/mutual
exclusion somewhere in the BlueZ library ? Could one

Kernel : (I applied the MH7 patch) 2.6.18-1.2239_FC5_mh7

Please find the 3 logs below, and a piece of code :

log_14.txt for the connection on channel 14 only
log_15.txt for the connection on channel 14 only
log_14_15.txt for the concurrent connection attempt,
but successful on channel 14 only.
get_bluetooth_connection function, which is the
"server" main function

Many many thanks for helping me :(
I've certainly missed something obvious !!

Regards,
Oli

----------------------------------------------------------
log_14.txt
----------------------------------------------------------

HCI sniffer - Bluetooth packet analyzer ver 1.33
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:16:4E:83:2D:19 class 0x520204 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:16:4E:83:2D:19 role 0x01
    Role: Slave
> HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:16:4E:83:2D:19 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
    handle 1 policy 0x0f
    Link policy: RSWITCH HOLD SNIFF PARK
> HCI Event: Command Complete (0x0e) plen 6
    Write Link Policy Settings (0x02|0x000d) ncmd 1
    status 0x00 handle 1
< HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
    handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
    Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xbf 0xee 0x0f 0x40 0x18 0x18 0x00 0x00
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
      dlci 28 frame_type 0 credit_flow 15 pri 0 ack_timer 0
      frame_size 1645 max_retrans 0 credits 0
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
      dlci 28 frame_type 0 credit_flow 14 pri 0 ack_timer 0
      frame_size 1645 max_retrans 0 credits 7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 28 pf 1 ilen 0 fcs 0x28
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 28 pf 1 ilen 0 fcs 0xe3
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 1 ilen 0 fcs 0xdd credits 33
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 2
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 30 0a                                             0.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 30 0a                                             0.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 31 0a                                             1.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 31 0a                                             1.
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 32 0a                                             2.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 32 0a                                             2.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 33 0a                                             3.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 33 0a                                             3.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 34 0a                                             4.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 34 0a                                             4.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 35 0a                                             5.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 35 0a                                             5.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 36 0a                                             6.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 36 0a                                             6.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 37 0a                                             7.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 37 0a                                             7.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 38 0a                                             8.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 38 0a                                             8.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 39 0a                                             9.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 39 0a                                             9.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 28 pf 1 ilen 0 fcs 0xc9
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 28 pf 1 ilen 0 fcs 0xe3
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 1 reason 0x13
    Reason: Remote User Terminated Connection

----------------------------------------------------------
log_15.txt
----------------------------------------------------------

HCI sniffer - Bluetooth packet analyzer ver 1.33
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:18:C5:FE:C4:7F class 0x520204 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:18:C5:FE:C4:7F role 0x01
    Role: Slave
> HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:18:C5:FE:C4:7F type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
    handle 1 policy 0x0f
    Link policy: RSWITCH HOLD SNIFF PARK
> HCI Event: Command Complete (0x0e) plen 6
    Write Link Policy Settings (0x02|0x000d) ncmd 1
    status 0x00 handle 1
< HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
    handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
    Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xbf 0xee 0x0f 0xc6 0x9a 0x39 0x00 0x00
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
      dlci 30 frame_type 0 credit_flow 15 pri 0 ack_timer 0
      frame_size 4935 max_retrans 0 credits 0
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
      dlci 30 frame_type 0 credit_flow 14 pri 0 ack_timer 0
      frame_size 4935 max_retrans 0 credits 7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 30 pf 1 ilen 0 fcs 0x6d
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 30 pf 1 ilen 0 fcs 0xa6
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 30 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 30 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 30 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 30 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 1 ilen 0 fcs 0x37 credits 33
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 2
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 30 0a                                             0.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 30 0a                                             0.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 31 0a                                             1.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 31 0a                                             1.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 32 0a                                             2.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 32 0a                                             2.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 33 0a                                             3.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 33 0a                                             3.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 34 0a                                             4.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 34 0a                                             4.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 35 0a                                             5.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 35 0a                                             5.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 36 0a                                             6.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 36 0a                                             6.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 37 0a                                             7.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 37 0a                                             7.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 38 0a                                             8.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 38 0a                                             8.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 0 ilen 2 fcs 0xf1
      0000: 39 0a                                             9.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 30 pf 0 ilen 2 fcs 0x2b
      0000: 39 0a                                             9.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 30 pf 1 ilen 0 fcs 0xed credits 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 30 pf 1 ilen 0 fcs 0x8c
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 30 pf 1 ilen 0 fcs 0xa6
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 1 reason 0x13
    Reason: Remote User Terminated Connection



----------------------------------------------------------
log_14_15.txt
----------------------------------------------------------

HCI sniffer - Bluetooth packet analyzer ver 1.33
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:16:4E:83:2D:19 class 0x520204 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:16:4E:83:2D:19 role 0x01
    Role: Slave
> HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:16:4E:83:2D:19 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
    handle 1 policy 0x0f
    Link policy: RSWITCH HOLD SNIFF PARK
> HCI Event: Command Complete (0x0e) plen 6
    Write Link Policy Settings (0x02|0x000d) ncmd 1
    status 0x00 handle 1
< HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
    handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
    Change Connection Packet Type (0x01|0x000f) status 0x00 ncmd 1
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
    status 0x00 handle 1 ptype 0xcc18
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xbf 0xee 0x0f 0x40 0x18 0x18 0x00 0x00
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0000
< ACL data: handle 1 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 32772
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      Success
      MTU 32772
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8
      dlci 28 frame_type 0 credit_flow 15 pri 0 ack_timer 0
      frame_size 1645 max_retrans 0 credits 0
< ACL data: handle 1 flags 0x02 dlen 18
    L2CAP(d): cid 0x0040 len 14 [psm 3]
      RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8
      dlci 28 frame_type 0 credit_flow 14 pri 0 ack_timer 0
      frame_size 1645 max_retrans 0 credits 7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 28 pf 1 ilen 0 fcs 0x28
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 28 pf 1 ilen 0 fcs 0xe3
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 0 b1 1 b2 1 b3 0 len 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(d): cid 0x0040 len 8 [psm 3]
      RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2
      dlci 28 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0
< ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 1 ilen 0 fcs 0xdd credits 33
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 2
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 30 0a                                             0.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 30 0a                                             0.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 31 0a                                             1.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 31 0a                                             1.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 32 0a                                             2.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 32 0a                                             2.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 33 0a                                             3.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 33 0a                                             3.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 34 0a                                             4.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 34 0a                                             4.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 35 0a                                             5.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 35 0a                                             5.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 36 0a                                             6.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 36 0a                                             6.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 37 0a                                             7.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 37 0a                                             7.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 38 0a                                             8.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 38 0a                                             8.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 0 ilen 2 fcs 0x1b
      0000: 39 0a                                             9.
< ACL data: handle 1 flags 0x02 dlen 10
    L2CAP(d): cid 0x0040 len 6 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 28 pf 0 ilen 2 fcs 0xc1
      0000: 39 0a                                             9.
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 9
    L2CAP(d): cid 0x0040 len 5 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 28 pf 1 ilen 0 fcs 0x7 credits 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 28 pf 1 ilen 0 fcs 0xc9
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 28 pf 1 ilen 0 fcs 0xe3
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd
< ACL data: handle 1 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
< ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 1 reason 0x13
    Reason: Remote User Terminated Connection


-----------------------------
int get_bluetooth_connection
-----------------------------


int get_bluetooth_connection(int socket_type, u_short port, int *listener, 
char *remote_addr)
{
 struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };

 int listening_socket;
 int connected_socket = -1;
 int new_process;
 int reuse_addr = 1;
 int opt = sizeof(rem_addr);

 strcpy(remote_addr, "");
 listening_socket = socket(AF_BLUETOOTH, socket_type, BTPROTO_RFCOMM);
 if (listening_socket < 0) {
  perror("socket");
  exit(EXIT_FAILURE);
 }

   if (listener != NULL)
  *listener = listening_socket;

   //setsockopt(listening_socket, SOL_SOCKET, SO_REUSEADDR, &reuse_addr, 
sizeof(reuse_addr));

 loc_addr.rc_family = AF_BLUETOOTH;
 loc_addr.rc_bdaddr = *BDADDR_ANY;
 loc_addr.rc_channel = (uint8_t) port;
 if (bind(listening_socket, (struct sockaddr *)&loc_addr, sizeof(loc_addr)) 
< 0)
 {
  perror("bind");
  close(listening_socket);
  exit(EXIT_FAILURE);
 }

 if (socket_type == SOCK_STREAM)
 {
  listen(listening_socket, 5); /* Queue up to five connections before having 
them automatically rejected. */

     while(connected_socket < 0)
  {
     printf("[%ld] Waiting accept ...\n", (long)getpid(), remote_addr);
        connected_socket = accept(listening_socket, (struct sockaddr 
*)&rem_addr, &opt);
     ba2str( &(rem_addr.rc_bdaddr), remote_addr );
        if (connected_socket < 0)
   {
          /* Either a real error occured, or blocking was interrupted for
             some reason.  Only abort execution if a real error occured. */
          if (errno != EINTR)
    {
             perror("accept");
             close(listening_socket);
             exit(EXIT_FAILURE);
          } else {
             continue;    /* don't fork - do the accept again */
          }
        }

   printf("[%ld] Accepted from %s\n", (long)getpid(), remote_addr);
        new_process = fork();
        if (new_process < 0)
   {
          printf("[%ld] Forking error\n", (long)getpid());
          close(connected_socket);
          connected_socket = -1;
        } else {
    /* We have a new process... */
          if (new_process == 0)
    {
     printf("[%ld] Start of new process (after fork)\n", (long)getpid());
             /* This is the new process. */
             close(listening_socket); /* Close our copy of this socket */
       if (listener != NULL) *listener = -1; /* Closed in this process.  We 
are not responsible for it. */
          } else {
             /* This is the main loop.  Close copy of connected socket, and 
continue loop. */
             close(connected_socket);
             connected_socket = -1;
          }
        }
     }
     return connected_socket;
   } else
     return listening_socket;
}



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.17/553 - Release Date: 27/11/2006


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-27 20:05   ` Olivier Le Pogam
@ 2006-11-28 10:24     ` Peter Wippich
  2006-11-28 11:01       ` Olivier Le Pogam
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Wippich @ 2006-11-28 10:24 UTC (permalink / raw)
  To: Olivier Le Pogam, BlueZ development


Hi Olivier,

>> lots of stuff deleted.....

your problem is hardware / general Bluetooth / LM related. 

Earlier BT implementations (and may be even actual) support only one slave 
connection at a time. This is why the master slave switch was introduced !
(I think with BT 1.0B). 
Newer implementations MAY support up to two slave connections or at least 
one Master and one Slave connection. 

What hardware are you using ?

Ciao, 

Peter 



|       Peter Wippich                   Voice: +49 30 46776411          |
|       G&W Instruments GmbH            fax:   +49 30 46776419          |
|       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
|       D-13355 Berlin  / Germany                                       |


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-28 10:24     ` Peter Wippich
@ 2006-11-28 11:01       ` Olivier Le Pogam
  2006-11-28 11:34         ` Peter Wippich
  0 siblings, 1 reply; 12+ messages in thread
From: Olivier Le Pogam @ 2006-11-28 11:01 UTC (permalink / raw)
  To: BlueZ development

Hi Peter,

Many many many thanks for your answer, I was supposing
a low level issue indeed !

I am actually using a generic Bluetooth key, the kind of
ones you can plug everywhere and which are recognised
by Microsoft Drivers. It is a HCI type 1 (Bluetooth 1.1).

So basically ... only 1 slave connection at a time for
each bluetooth adaptor ? How many bluetooth adaptors
do you think I can deal with under BlueZ in the case I
definetely want to be able to deal with concurrent incoming
connections ?

Even if I buy bluetooth 2.0 adaptors, I suppose the problem
will be the same, assuming my mobile phones are anyway
always on a lower bluetooth version ?

Many thanks again,
Oli

----- Original Message ----- 
From: "Peter Wippich" <pewi@gw-instruments.de>
To: "Olivier Le Pogam" <olepogam@free.fr>; "BlueZ development" 
<bluez-devel@lists.sourceforge.net>
Sent: Tuesday, November 28, 2006 11:24 AM
Subject: Re: [Bluez-devel] Master / Slave question


>
> Hi Olivier,
>
>>> lots of stuff deleted.....
>
> your problem is hardware / general Bluetooth / LM related.
>
> Earlier BT implementations (and may be even actual) support only one slave
> connection at a time. This is why the master slave switch was introduced !
> (I think with BT 1.0B).
> Newer implementations MAY support up to two slave connections or at least
> one Master and one Slave connection.
>
> What hardware are you using ?
>
> Ciao,
>
> Peter
>
>
>
> |       Peter Wippich                   Voice: +49 30 46776411          |
> |       G&W Instruments GmbH            fax:   +49 30 46776419          |
> |       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
> |       D-13355 Berlin  / Germany                                       |
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.409 / Virus Database: 268.14.19/555 - Release Date: 
> 27/11/2006
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.19/555 - Release Date: 27/11/2006


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-28 11:01       ` Olivier Le Pogam
@ 2006-11-28 11:34         ` Peter Wippich
  2006-11-28 12:32           ` Olivier Le Pogam
  2006-11-30 17:12           ` Andrew Kohlsmith
  0 siblings, 2 replies; 12+ messages in thread
From: Peter Wippich @ 2006-11-28 11:34 UTC (permalink / raw)
  To: Olivier Le Pogam, BlueZ development


Hi Oli, 

> I am actually using a generic Bluetooth key, the kind of
> ones you can plug everywhere and which are recognised
> by Microsoft Drivers. It is a HCI type 1 (Bluetooth 1.1).
You should try to get a newer BT 2.0 device. If I remember right the newer 
CSR devices support two slaves at a time (at least they support one slave 
and one Master connection simultaniously). 
 
> So basically ... only 1 slave connection at a time for
> each bluetooth adaptor ? How many bluetooth adaptors
> do you think I can deal with under BlueZ in the case I
> definetely want to be able to deal with concurrent incoming
> connections ?
There is no real hard limit for the number of adapters you can use with 
BlueZ. Link key managment may become a little bit confusing (on the phone 
side) because the Link key is bound to the BT address of the adaptor. So 
if a phone connects to, say adaptor 1 the first time and then to adaptor 2 
the second time it must pair again 8if your application needs security at 
all). 

> Even if I buy bluetooth 2.0 adaptors, I suppose the problem
> will be the same, assuming my mobile phones are anyway
> always on a lower bluetooth version ?

I think most phones should, in general, support Master/Slave switch. 
However, even when th Bluetooth implementation on the phone supports it, 
it is possible that a role switch request is rejected on the profile layer 
(depends on implementation). 
For a server application like yours I would suggest to use the role 
switch feature in a more relaxed way. So, once a connection comes in try 
to do a role switch. If it succeed it is fine and you're able to accept an 
additional connection. If it fails you're out of resources but at least 
can service the current connection. 

However, if I understand it right you can not set this behaviour in 
hcid.conf. You have to implement it in your application. 

Ciao, 

Peter 
 


|       Peter Wippich                   Voice: +49 30 46776411          |
|       G&W Instruments GmbH            fax:   +49 30 46776419          |
|       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
|       D-13355 Berlin  / Germany                                       |


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-28 11:34         ` Peter Wippich
@ 2006-11-28 12:32           ` Olivier Le Pogam
  2006-11-29 12:11             ` Peter Wippich
  2006-11-30 17:12           ` Andrew Kohlsmith
  1 sibling, 1 reply; 12+ messages in thread
From: Olivier Le Pogam @ 2006-11-28 12:32 UTC (permalink / raw)
  To: BlueZ development

Hi Peter,

> There is no real hard limit for the number of adapters you can use with
> BlueZ. Link key managment may become a little bit confusing (on the phone
> side) because the Link key is bound to the BT address of the adaptor. So
> if a phone connects to, say adaptor 1 the first time and then to adaptor 2
> the second time it must pair again 8if your application needs security at
> all).

That's ok as I don't need security to be enabled :)

> I think most phones should, in general, support Master/Slave switch.
> However, even when th Bluetooth implementation on the phone supports it,
> it is possible that a role switch request is rejected on the profile layer
> (depends on implementation).

Unfortunately, Nokia mobile phones (implementing the JSR 82) have a
problem with role switch, and definetely can't do it ... So if they
initiate the connection, they will remain master, and my linux bluetooth
key slave :) Trying to force to "master=true" in the btspp: URL or
putting lm=master in hcid.conf automatically raises a "role switch"
exception Nokia phone-side.

> For a server application like yours I would suggest to use the role
> switch feature in a more relaxed way. So, once a connection comes in try
> to do a role switch. If it succeed it is fine and you're able to accept an
> additional connection. If it fails you're out of resources but at least
> can service the current connection.
>
> However, if I understand it right you can not set this behaviour in
> hcid.conf. You have to implement it in your application.

What do you mean by implementing this in my application ? Is it
possible to manually deal with this in my server application ? Would you
have a location with examples ?

Thanks a lot, I feel more clever now, and at least understand why I
haven't succeeded !

Oli 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.19/555 - Release Date: 27/11/2006


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-28 12:32           ` Olivier Le Pogam
@ 2006-11-29 12:11             ` Peter Wippich
  2006-11-29 22:54               ` Mark S. Townsley
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Wippich @ 2006-11-29 12:11 UTC (permalink / raw)
  To: Olivier Le Pogam, BlueZ development


Salut Oli,

> > For a server application like yours I would suggest to use the role
> > switch feature in a more relaxed way. So, once a connection comes in try
> > to do a role switch. If it succeed it is fine and you're able to accept an
> > additional connection. If it fails you're out of resources but at least
> > can service the current connection.
> >
> > However, if I understand it right you can not set this behaviour in
> > hcid.conf. You have to implement it in your application.
> 
> What do you mean by implementing this in my application ? Is it
> possible to manually deal with this in my server application ? Would you
> have a location with examples ?
> 
Actualy, the only sample I'm aware of for such things is hcid. I've not 
checked how it handles the case when lm master is set and the remote 
device rejects the role switch. From the documentation I assume it will 
cancel the connection, but this may be wrong. 
Marcel ?? 
If it just ignores a rejected role switch and keeps the connection you 
have the behaviour I outlined above. 
If it cancel the connection may be the easiest way is to modify hcid. 

Peter


|       Peter Wippich                   Voice: +49 30 46776411          |
|       G&W Instruments GmbH            fax:   +49 30 46776419          |
|       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
|       D-13355 Berlin  / Germany                                       |


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-29 12:11             ` Peter Wippich
@ 2006-11-29 22:54               ` Mark S. Townsley
  0 siblings, 0 replies; 12+ messages in thread
From: Mark S. Townsley @ 2006-11-29 22:54 UTC (permalink / raw)
  To: BlueZ development


[-- Attachment #1.1: Type: text/plain, Size: 2349 bytes --]

I read/heard somewhere that newer silicons that supports automatic
master/slave role switch creates problems in the HCI layer and connections
could get dropped if you have a BT radio that supports that auto-switching.

Can someone confirm or discredit this?


On 11/29/06, Peter Wippich <pewi@gw-instruments.de> wrote:
>
>
> Salut Oli,
>
> > > For a server application like yours I would suggest to use the role
> > > switch feature in a more relaxed way. So, once a connection comes in
> try
> > > to do a role switch. If it succeed it is fine and you're able to
> accept an
> > > additional connection. If it fails you're out of resources but at
> least
> > > can service the current connection.
> > >
> > > However, if I understand it right you can not set this behaviour in
> > > hcid.conf. You have to implement it in your application.
> >
> > What do you mean by implementing this in my application ? Is it
> > possible to manually deal with this in my server application ? Would you
> > have a location with examples ?
> >
> Actualy, the only sample I'm aware of for such things is hcid. I've not
> checked how it handles the case when lm master is set and the remote
> device rejects the role switch. From the documentation I assume it will
> cancel the connection, but this may be wrong.
> Marcel ??
> If it just ignores a rejected role switch and keeps the connection you
> have the behaviour I outlined above.
> If it cancel the connection may be the easiest way is to modify hcid.
>
> Peter
>
>
> |       Peter Wippich                   Voice: +49 30 46776411          |
> |       G&W Instruments GmbH            fax:   +49 30 46776419          |
> |       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
> |       D-13355 Berlin  / Germany                                       |
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>

[-- Attachment #1.2: Type: text/html, Size: 3634 bytes --]

[-- Attachment #2: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-28 11:34         ` Peter Wippich
  2006-11-28 12:32           ` Olivier Le Pogam
@ 2006-11-30 17:12           ` Andrew Kohlsmith
  2006-12-01 13:22             ` Peter Wippich
  1 sibling, 1 reply; 12+ messages in thread
From: Andrew Kohlsmith @ 2006-11-30 17:12 UTC (permalink / raw)
  To: bluez-devel

On Tuesday 28 November 2006 06:34, Peter Wippich wrote:
> You should try to get a newer BT 2.0 device. If I remember right the newer
> CSR devices support two slaves at a time (at least they support one slave
> and one Master connection simultaniously).

I'm confused; I thought the limitation was with early early BT 1.0B 
implementations, but now you're saying that BT2.0 even has this limit?  I 
can't, for example, have one BT dongle and work with 2, 3, 4 or more devices 
at the same time?

> For a server application like yours I would suggest to use the role
> switch feature in a more relaxed way. So, once a connection comes in try
> to do a role switch. If it succeed it is fine and you're able to accept an
> additional connection. If it fails you're out of resources but at least
> can service the current connection.

Interesting.  Always try to become a slave (i.e. let the phone be the master 
if it'll let you), correct?

Regards,
Andrew

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-11-30 17:12           ` Andrew Kohlsmith
@ 2006-12-01 13:22             ` Peter Wippich
  2006-12-01 15:33               ` Andrew Kohlsmith
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Wippich @ 2006-12-01 13:22 UTC (permalink / raw)
  To: BlueZ development


Hi Andrew, 

On Thu, 30 Nov 2006, Andrew Kohlsmith wrote:
> On Tuesday 28 November 2006 06:34, Peter Wippich wrote:
> > You should try to get a newer BT 2.0 device. If I remember right the newer
> > CSR devices support two slaves at a time (at least they support one slave
> > and one Master connection simultaniously).
> 
> I'm confused; I thought the limitation was with early early BT 1.0B 
> implementations, but now you're saying that BT2.0 even has this limit?  I 
> can't, for example, have one BT dongle and work with 2, 3, 4 or more devices 
> at the same time?

I think the confusion was caused by the limitations introduced with the 
device roles: master and slave. So most modern devices support the 
following: 

Master with up to 7 slaves. 
Master to (6 ?) slaves and Slave to 1 Master. 
Slave to 2 Masters. 

> > For a server application like yours I would suggest to use the role
> > switch feature in a more relaxed way. So, once a connection comes in try
> > to do a role switch. If it succeed it is fine and you're able to accept an
> > additional connection. If it fails you're out of resources but at least
> > can service the current connection.
> 
> Interesting.  Always try to become a slave (i.e. let the phone be the master 
> if it'll let you), correct?
No, the other way round. Always try to become a master to be able to 
service additional connections and let the phone be the slave. See above 
for the reason. 

Ciao, 

Peter 



|       Peter Wippich                   Voice: +49 30 46776411          |
|       G&W Instruments GmbH            fax:   +49 30 46776419          |
|       Gustav-Meyer-Allee 25, Geb. 12  Email: pewi@gw-instruments.de   |
|       D-13355 Berlin  / Germany                                       |


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Bluez-devel] Master / Slave question
  2006-12-01 13:22             ` Peter Wippich
@ 2006-12-01 15:33               ` Andrew Kohlsmith
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Kohlsmith @ 2006-12-01 15:33 UTC (permalink / raw)
  To: bluez-devel

On Friday 01 December 2006 08:22, Peter Wippich wrote:
> I think the confusion was caused by the limitations introduced with the
> device roles: master and slave. So most modern devices support the
> following:
>
> Master with up to 7 slaves.
> Master to (6 ?) slaves and Slave to 1 Master.
> Slave to 2 Masters.

...

> No, the other way round. Always try to become a master to be able to
> service additional connections and let the phone be the slave. See above
> for the reason.

Thank you for clearing this up.  I don't pretend to "get it" just yet, but 
thank you again for taking the time to explain it.  :-)

-A.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-12-01 15:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-25 15:40 [Bluez-devel] Master / Slave question Olivier Le Pogam
2006-11-26 10:13 ` Marcel Holtmann
2006-11-27 20:05   ` Olivier Le Pogam
2006-11-28 10:24     ` Peter Wippich
2006-11-28 11:01       ` Olivier Le Pogam
2006-11-28 11:34         ` Peter Wippich
2006-11-28 12:32           ` Olivier Le Pogam
2006-11-29 12:11             ` Peter Wippich
2006-11-29 22:54               ` Mark S. Townsley
2006-11-30 17:12           ` Andrew Kohlsmith
2006-12-01 13:22             ` Peter Wippich
2006-12-01 15:33               ` Andrew Kohlsmith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox