Problems opening connections for an HDP implementation.
Hi everybody,
I am developing a free/open source implementation of HDP using sancane's MCAP implementation. I am using ERTM and STREAMING mode provided by Gustavo's patches from 3th October. I've been testing my implementation between two computers (both of them using the previously mentioned profiles). This test seems working correctly but I am also trying to test it against a Nonin Onix II 9560BT PulseOximeter (certified by Continua). This device is using HDP but when I try to test my HDP implementation I've observed that the MCAP control channel L2CAP connection is not correctly opened (see trace bellow)
...
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12
L2CAP(s): Connect req: psm 49704 scid 0x0041
< ACL data: handle 46 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 0 status 0
Connection successful....
There is a thread waiting for incoming connections on this psm, but it is never waked up from the recv system call.
.....
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
HCI Event: Link Key Request (
0x17) plen 6
bdaddr 00:1C:05:00:19:56
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
bdaddr 00:1C:05:00:19:56 key DD4D176E23CDB1D95334CD8A7D077773Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 10
Link Key Request Reply (0x01|0x000b) ncmd 1
status 0x00 bdaddr 00:1C:05:00:19:56Quoted 1 line
HCI Event: Encrypt Change (
0x08) plen 4
status 0x00 handle 46 encrypt 0x01
< HCI Command: Read RSSI (0x05|0x0005) plen 2
handle 46
....
This part of the trace is repeated until local host closes L2CAP connection.
....
< ACL data: handle 46 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0041 scid 0x0040
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12
L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0040
....
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 7
Read Transmit Power Level (0x03|0x002d) ncmd 1
status 0x00 handle 46 level 3< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 46 reason 0x13
Reason: Remote User Terminated Connection
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Disconnect (0x01|0x0006) status 0x00 ncmd 1
Quoted 1 line
HCI Event: Disconn Complete (
0x05) plen 4
status 0x00 handle 46 reason 0x16
Reason: Connection Terminated by Local Host
What am I doing wrong? Why the connection to this socket is not finished?
If you are interested in the complete trace I can send it to you.
Thank you very much.
Regards.
Jose.
Hi José,
Quoted 15 lines · José Antonio Santos Cadenas
Hi everybody,
I am developing a free/open source implementation of HDP using sancane's MCAP implementation. I am using ERTM and STREAMING mode provided by Gustavo's patches from 3th October. I've been testing my implementation between two computers (both of them using the previously mentioned profiles). This test seems working correctly but I am also trying to test it against a Nonin Onix II 9560BT PulseOximeter (certified by Continua). This device is using HDP but when I try to test my HDP implementation I've observed that the MCAP control channel L2CAP connection is not correctly opened (see trace bellow)
...
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12
Quoted 9 lines
L2CAP(s): Connect req: psm 49704 scid 0x0041 < ACL data: handle 46 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 0 status 0 Connection successful....
There is a thread waiting for incoming connections on this psm, but it is never waked up from the recv system call.
MCAP control channels are simply L2CAP socket with ERTM enabled. Current implementations waits in a recv call for incoming connections. When a device connect with you, the thread is waked up to create an MCAP Communications Link (MCL). Since here, all negotiations are established using MCAP commands.
At a minimum, the l2cap connection should be opened before MCAP working thread will be waked up.
I suspect that the problem is that the l2cap with ERMT connections is not opened.
Quoted 49 lines
.....
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
HCI Event: Link Key Request (
0x17) plen 6bdaddr 00:1C:05:00:19:56 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22 bdaddr 00:1C:05:00:19:56 key DD4D176E23CDB1D95334CD8A7D077773Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 10Link Key Request Reply (0x01|0x000b) ncmd 1 status 0x00 bdaddr 00:1C:05:00:19:56Quoted 1 line
HCI Event: Encrypt Change (
0x08) plen 4status 0x00 handle 46 encrypt 0x01< HCI Command: Read RSSI (0x05|0x0005) plen 2
handle 46
....
This part of the trace is repeated until local host closes L2CAP connection.
....< ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Disconn req: dcid 0x0041 scid 0x0040Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0040....
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 7Read Transmit Power Level (0x03|0x002d) ncmd 1 status 0x00 handle 46 level 3< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 46 reason0x13
Reason: Remote User Terminated ConnectionQuoted 1 line
HCI Event: Command Status (
0x0f) plen 4Disconnect (0x01|0x0006) status 0x00 ncmd 1Quoted 1 line
HCI Event: Disconn Complete (
0x05) plen 4status
0x00handle 46 reason0x16
Reason: Connection Terminated by Local HostWhat am I doing wrong? Why the connection to this socket is not finished?
If you are interested in the complete trace I can send it to you.
Thank you very much.
Regards.Jose.
Quoted 24 lines · sancane
Hi José,
Quoted 21 lines · José Antonio Santos Cadenas
Hi everybody,
I am developing a free/open source implementation of HDP using sancane's MCAP implementation. I am using ERTM and STREAMING mode provided by Gustavo's patches from 3th October. I've been testing my implementation between two computers (both of them using the previously mentioned profiles). This test seems working correctly but I am also trying to test it against a Nonin Onix II 9560BT PulseOximeter (certified by Continua). This device is using HDP but when I try to test my HDP implementation I've observed that the MCAP control channel L2CAP connection is not correctly opened (see trace bellow)
...
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Connect req: psm 49704 scid 0x0041 < ACL data: handle 46 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 0 status 0 Connection successful....
Quoted 6 lines
Quoted 3 lines
There is a thread waiting for incoming connections on this psm, but it is never waked up from the recv system call.
MCAP control channels are simply L2CAP socket with ERTM enabled. Current implementations waits in a recv
sorry:
sed s/recv/accept
Quoted 60 lines
call for incoming connections. When a
device connect with you, the thread is waked up to create an MCAP Communications Link (MCL). Since here, all negotiations are established using MCAP commands.
At a minimum, the l2cap connection should be opened before MCAP working thread will be waked up.
I suspect that the problem is that the l2cap with ERMT connections is not opened.Quoted 49 lines
.....
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
HCI Event: Link Key Request (
0x17) plen 6bdaddr 00:1C:05:00:19:56 < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22 bdaddr 00:1C:05:00:19:56 key DD4D176E23CDB1D95334CD8A7D077773Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 10Link Key Request Reply (0x01|0x000b) ncmd 1 status 0x00 bdaddr 00:1C:05:00:19:56Quoted 1 line
HCI Event: Encrypt Change (
0x08) plen 4status 0x00 handle 46 encrypt 0x01< HCI Command: Read RSSI (0x05|0x0005) plen 2
handle 46
....
This part of the trace is repeated until local host closes L2CAP connection.
....< ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Disconn req: dcid 0x0041 scid 0x0040Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0040....
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 7Read Transmit Power Level (0x03|0x002d) ncmd 1 status 0x00 handle 46 level 3< HCI Command: Disconnect (0x01|0x0006) plen 3
handle 46 reason0x13
Reason: Remote User Terminated ConnectionQuoted 1 line
HCI Event: Command Status (
0x0f) plen 4Disconnect (0x01|0x0006) status 0x00 ncmd 1Quoted 1 line
HCI Event: Disconn Complete (
0x05) plen 4status
0x00handle 46 reason0x16
Reason: Connection Terminated by Local HostWhat am I doing wrong? Why the connection to this socket is not finished?
If you are interested in the complete trace I can send it to you.
Thank you very much.
Regards.Jose.