Skip to contentSkip to conversation

l2test problem

Bluez-users Swarup Mohalik 3 participants 7 messages Mar 22, 2004 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

I have BlueZ on a red hat 8 linux kerner 2.6.0.
I have built all the modules for bluetooth (I believe so).

I am able to send and receive to/from a Nokia 3650 via Obex Push. I can establish a ppp connection as well and browse the web.

After all this, when I ran
l2test -s <phone bt address>,

I get the following output
[root@lx98218 tools]# cd ../test;./l2test -s 00:60:57:4A:25:DB l2test[11744]: Can't connect. Connection refused(111)

hcidump data

[root@lx98218 bluetooth]# hcidump
HCIDump - HCI packet analyzer ver 1.6
device: hci0 snap_len: 1028 filter: 0xffffffff

Quoted 2 lines

HCI Event: Link Key Notification(0x18) plen 23 HCI Event: Connect Complete(0x03) plen 11

< ACL data: handle 0x0028 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 4097 scid 0x0040
< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4

Quoted 4 lines

HCI Event: Command Complete(0x0e) plen 6 HCI Event: Number of Completed Packets(0x13) plen 5 HCI Event: Max Slots Change(0x1b) plen 3 ACL data: handle 0x0028 flags 0x02 dlen 16

L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0040 result 2 status 0

Quoted 1 line

HCI Event: QoS Setup Complete(0x0d) plen 21

< HCI Command: Disconnect(0x01|0x0006) plen 3

Quoted 2 lines

HCI Event: Command Status(0x0f) plen 4
HCI Event: Disconn Complete(0x05) plen 4

The original l2test.c uses PSM 10, which gives identical failure.

Please give me some clue.

Thanks in advance.
Swarup Mohalik

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Swarup,

Quoted 27 lines

I have BlueZ on a red hat 8 linux kerner 2.6.0.
I have built all the modules for bluetooth (I believe so).

I am able to send and receive to/from a Nokia 3650 via Obex Push. I can establish a ppp connection as well and browse the web.

After all this, when I ran
l2test -s <phone bt address>,

I get the following output
[root@lx98218 tools]# cd ../test;./l2test -s 00:60:57:4A:25:DB l2test[11744]: Can't connect. Connection refused(111)

hcidump data

[root@lx98218 bluetooth]# hcidump
HCIDump - HCI packet analyzer ver 1.6
device: hci0 snap_len: 1028 filter: 0xffffffff

Quoted 2 lines

HCI Event: Link Key Notification(0x18) plen 23 HCI Event: Connect Complete(0x03) plen 11

< ACL data: handle 0x0028 flags 0x02 dlen 12

    L2CAP(s): Connect req: psm 4097 scid 0x0040

< HCI Command: Write Link Policy Settings(0x02|0x000d) plen 4

Quoted 4 lines

HCI Event: Command Complete(0x0e) plen 6 HCI Event: Number of Completed Packets(0x13) plen 5 HCI Event: Max Slots Change(0x1b) plen 3 ACL data: handle 0x0028 flags 0x02 dlen 16

Quoted 7 lines
    L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0040 result 2 status 0
Quoted 1 line

HCI Event: QoS Setup Complete(0x0d) plen 21

< HCI Command: Disconnect(0x01|0x0006) plen 3

Quoted 2 lines

HCI Event: Command Status(0x0f) plen 4
HCI Event: Disconn Complete(0x05) plen 4

The original l2test.c uses PSM 10, which gives identical failure.

may you wanna take a look at the Bluetooth specification and search for result code 2 of the L2CAP connect response ;)

	0x0002 Connection refused - PSM not supported.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

Hi Swarup,

Quoted 10 lines
Quoted 5 lines

may you wanna take a look at the Bluetooth specification and search for result code 2 of the L2CAP connect response ;)

	0x0002 Connection refused - PSM not supported.

Yes, I saw that earlier. But how do I get the supported PSM's? Are they available from the SDP records one gets from the output of "sdptool browse"?
(are they the numbers beside L2CAP in the records?)

yes, they are the uint16 numbers besides the uuid16 protocol UUID for L2CAP, but why do you want them? You asked about a mobile phone and most of them are based on the higher layer RFCOMM. So far I haven't seen any phone that support BNEP, HID or HCRP. And this means that in your case only two PSM's are supported. PSM 1 for the SDP requests and PSM 3 for the RFCOMM protocol.

Quoted 1 line

In case of l2test, which PSM (psm of which record) should it use?

The l2test program is for Linux-to-Linux testing and not really meant for testing other devices. You should ask yourself what you are trying to do.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#4 lore raw
Quoted 6 lines

yes, they are the uint16 numbers besides the uuid16 protocol UUID for L2CAP, but why do you want them? You asked about a mobile phone and most of them are based on the higher layer RFCOMM. So far I haven't seen any phone that support BNEP, HID or HCRP. And this means that in your case only two PSM's are supported. PSM 1 for the SDP requests and PSM 3 for the RFCOMM protocol.

Symbian Phones like Nokia 3650 allows you to use an L2CAP (or higher) api for application programming.

But as with other bluetooth applications, you of course must have a server llistening on a given PSM for it to answer "Connection accepted" (0).

mohalik, you should have a look at development papers from Sony Ericcson (and maybe nokia) on symbian bluetooth programming (Basically, they also provide a socket interface).

http://developer.sonyericsson.com/ (you'll have to create an account first)

BR,

Signature · 15 lines
Xavier Garreau <[email protected]>
Prim'Time Technology
http://www.prim-time.fr/



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
#5 lore raw

Thanks a lot Marcel and Xavier.

Actually I started with a client on the linux PC and a symbian server on the nokia 3650. I used the API's for l2cap sockets and had set the psm to 5 (arbitrary choice). Then i got the
connection refused(111)
message from the PC.

It was now that I wanted to use l2test as a client (just for the connection part). So I changed the psm in l2test.c to 5 and tested. But connection still gets refused. The reason for connect response is always - "psm not supported".

Does this mean that the nokia device may not have l2cap socket support? I did not find any such information though on the web.

Marcel, please tell me if I am not addressing the forum.

Regards,
Swarup

Quoted 24 lines · Xavier Garreau
Quoted 8 lines

yes, they are the uint16 numbers besides the uuid16 protocol UUID for L2CAP, but why do you want them? You asked about a mobile phone and most of them are based on the higher layer RFCOMM. So far I haven't seen any phone that support BNEP, HID or HCRP. And this means that in your case only two PSM's are supported. PSM 1 for the SDP requests and PSM 3 for the RFCOMM protocol.

Symbian Phones like Nokia 3650 allows you to use an L2CAP (or higher) api for application programming.

But as with other bluetooth applications, you of course must have a server llistening on a given PSM for it to answer "Connection accepted" (0).

mohalik, you should have a look at development papers from Sony Ericcson (and maybe nokia) on symbian bluetooth programming (Basically, they also provide a socket interface).

http://developer.sonyericsson.com/ (you'll have to create an account first)

BR,

#6 lore raw
Quoted 7 lines

Actually I started with a client on the linux PC and a symbian server on the nokia 3650. I used the API's for l2cap sockets and had set the psm to 5 (arbitrary choice). Then i got the
connection refused(111)
message from the PC.

It was now that I wanted to use l2test as a client (just for the

connection part).

Quoted 1 line

So I changed the psm in l2test.c to 5 and tested. But connection still

gets refused.

Quoted 1 line

The reason for connect response is always - "psm not supported".

PSM 5 is reserved for Telephony Control Protocol so it can be tricky to access it.
Use a PSM > 0x1000, odd, and with the least significant bit of the most significant octet equal to 0.

Also look at the -P param for l2test ;-)

BR,

Signature · 15 lines
Xavier Garreau <[email protected]>
Prim'Time Technology
http://www.prim-time.fr/



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
maintainer
#7 lore raw
In reply to Swarup Mohalik

Hi Swarup,

Quoted 12 lines

Actually I started with a client on the linux PC and a symbian server on the nokia 3650. I used the API's for l2cap sockets and had set the psm to 5 (arbitrary choice). Then i got the
connection refused(111)
message from the PC.

It was now that I wanted to use l2test as a client (just for the connection part).
So I changed the psm in l2test.c to 5 and tested. But connection still gets refused.
The reason for connect response is always - "psm not supported".

Quoted 3 lines

Does this mean that the nokia device may not have l2cap socket support?
I did not find any such information though on the web.

you must use a PSM > 0x1000, so PSM 4097 is the first usable choise and of course your application on the Symbian must listen on that PSM for incoming connection. From what your hcidump shows is that the problem is on the phone side and so a problem of your symbian server code.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users