Johan, You can see the INTR and CONTROL channel sockets are different from the session which is created by HIDPCONNADD. They don't share the same reference. And PTS log fils is attached, please check it. Best regards shy 2011/8/23 Johan Hedberg <johan.hedberg@xxxxxxxxx>: > Hi, > > On Tue, Aug 23, 2011, Luiz Augusto von Dentz wrote: >> On Tue, Aug 23, 2011 at 11:54 AM, shy <shyboysby@xxxxxxxxx> wrote: >> > Hi Marcel, >> > According to connection_disconnect in input/device.c(Bluez version >> > 4.93), it would disconnect INTR and CONTROL L2cap link and then send >> > HIDP_CTRL_VIRTUAL_CABLE_UNPLUG message by the process sequence. >> > That seems it doesn't comply to the spec Page120, HID version 1.0. >> > Could you please confirm this case? If so, I would submit a patch. >> >> You mean that the disconnect sequence is wrong? Note that we only send >> virtual cable unplug in case the device is being removed, otherwise it >> is just a regular disconnect. > > I'm not really an expert with the HID implementation, but I think what's > causing confusion here are the close() (g_io_channel_shutdown) calls in > user-space code. Since the kernel keeps its own socket references > (created through HIDPCONNADD) this will not actually disconnect the > L2CAP channels and so it's still safe to send the unplug command > (triggered by the HIDPCONNDEL ioctl) and wait for the remote side to > disconnect. > > So unless you've got actual traces (air or HCI) showing an incorrect > sequence I don't think there's anything wrong with the code. > > Johan >
Test case : TC_HOS_HCR_BV_03_I started - SDP Service record for PTS: 'HID Pointing Device'successfully registered - Device ID Service Recordsuccessfully registered - HID control channel connected - HID interrupt channel connected - OUTPUT REPORT: ID: 2 Hex: 00000000 - OUTPUT REPORT: ID: 3 Hex: 00 - HID interrupt channel disconnected - HID control channel disconnected - FATAL ERROR: Received a CM_HID_DISCONNECT_IND (L2CAP channels disconnected) when the PTS and IUT are still virtually cabled - HID PTC exiting - MTC: Test case ended Final Verdict : Inconclusive Test Case Started: HID v. 7.2.0.11, TC_HOS_HCR_BV_03_I started at Friday, August 19, 2011 11:07:38 PICS VALUES : TSPC_HID_1_1 TRUE TSPC_HID_1_2 FALSE TSPC_HID_1_3 TRUE TSPC_HID_2_1 TRUE TSPC_HID_2_2 TRUE TSPC_HID_2_3 TRUE TSPC_HID_2_4 TRUE TSPC_HID_2_5 TRUE TSPC_HID_2_6 TRUE TSPC_HID_2_7 TRUE TSPC_HID_2_8 TRUE TSPC_HID_2_9 TRUE TSPC_HID_2_10 FALSE TSPC_HID_2_11 FALSE TSPC_HID_2_12 FALSE TSPC_HID_2_13 FALSE TSPC_HID_3_1 TRUE TSPC_HID_3_2 TRUE TSPC_HID_3_3 TRUE TSPC_HID_3_4 FALSE TSPC_HID_4_1 FALSE TSPC_HID_4_2 FALSE TSPC_HID_4_3 FALSE TSPC_HID_4_4 FALSE TSPC_HID_5_1 FALSE TSPC_HID_5_2 FALSE TSPC_HID_5_3 FALSE TSPC_HID_5_4 FALSE TSPC_HID_5_5 TRUE TSPC_HID_5_6 TRUE TSPC_HID_6_1 FALSE TSPC_HID_6_2 FALSE TSPC_HID_6_3 FALSE TSPC_HID_6_4 FALSE TSPC_HID_6_5 FALSE TSPC_HID_6_6 FALSE TSPC_HID_6_7 FALSE TSPC_HID_6_8 TRUE TSPC_HID_6_9 TRUE TSPC_HID_6_10 TRUE TSPC_HID_6_11 FALSE TSPC_HID_6_12 TRUE TSPC_HID_6_13 FALSE TSPC_HID_7_1 TRUE TSPC_HID_7_2 TRUE TSPC_HID_8_1 FALSE TSPC_HID_8_2 FALSE TSPC_HID_8_3 FALSE TSPC_HID_8_4 FALSE TSPC_HID_9_1 FALSE TSPC_HID_9_2 TRUE TSPC_HID_9_3 FALSE TSPC_HID_9_4 TRUE TSPC_HID_9_5 FALSE TSPC_HID_9_6 FALSE TSPC_HID_9_7 FALSE TSPC_HID_9_8 FALSE TSPC_HID_9_9 FALSE TSPC_HID_9_10 FALSE TSPC_HID_9_11 FALSE TSPC_HID_9_12 FALSE TSPC_HID_9_13 FALSE TSPC_HID_9_14 FALSE TSPC_HID_10_1 FALSE TSPC_HID_10_2 FALSE TSPC_HID_10_3 FALSE TSPC_HID_10_4 FALSE TSPC_HID_11_1 FALSE TSPC_HID_11_2 FALSE TSPC_HID_11_3 FALSE TSPC_HID_11_4 FALSE TSPC_HID_12_1 FALSE TSPC_HID_12_2 FALSE TSPC_HID_12_3 FALSE TSPC_HID_12_4 FALSE TSPC_HID_12_5 FALSE TSPC_HID_12_6 FALSE TSPC_HID_13_1 FALSE TSPC_HID_13_2 FALSE TSPC_HID_13_3 FALSE TSPC_HID_13_4 FALSE TSPC_HID_13_5 FALSE TSPC_HID_13_6 FALSE TSPC_HID_13_7 FALSE TSPC_HID_13_8 FALSE TSPC_HID_13_9 FALSE TSPC_HID_13_10 FALSE TSPC_HID_13_11 FALSE TSPC_HID_13_12 FALSE TSPC_HID_13_13 FALSE TSPC_HID_14_1 FALSE TSPC_HID_14_2 TRUE TSPC_ALL FALSE PIXIT VALUES : TSPX_security_enabled TRUE TSPX_delete_link_key TRUE TSPX_query_iut_sdp TRUE TSPX_bd_addr_iut 202BC1C7A97D TSPX_pointing_device_class_of_device 002580 TSPX_keyboard_device_class_of_device 002540 TSPX_host_class_of_device 100108 TSPX_pts_device_role MOUSE TSPX_pin_code 0000 TSPX_use_dynamic_pin_code FALSE TSPX_time_guard 600000000000000 TSPX_hid_data_interval 1000 TSPX_use_implicit_send TRUE TSPX_verbose_implicit_send FALSE TSPX_no_fail_verdicts FALSE TSPX_time_reconnect 30000 TSPX_secure_simple_pairing_pass_key_confirmation FALSE TSPX_hid_report_id 1 +3024 ms Start Test Case: TC_HOS_HCR_BV_03_I +3135 ms Verdict Description: SDP Service record for PTS: 'HID Pointing Device'successfully registered +3135 ms Preliminary verdict: : [8] (PASS) +3195 ms Verdict Description: Device ID Service Recordsuccessfully registered +3195 ms Preliminary verdict: : [8] (PASS) +3235 ms Send event: :[7]HCI!HCI_WRITE_SCAN_ENABLE=PDU:{ scanEnable:'03'O } +3245 ms Receive event: :[3]HCI?HCI_WRITE_SCAN_ENABLE_COMPLETE_EVENT=PDU:{ status:HCI_OK } +3245 ms Preliminary verdict: : [3] (PASS) +3265 ms Send event: :[1]HCI!HCI_CHANGE_LOCAL_NAME=PDU:{ name:"PTS-HID-CHINA-F66FD2846" } +3265 ms Receive event: :[3]HCI?HCI_CHANGE_LOCAL_NAME_COMPLETE_EVENT=PDU:{ status:HCI_OK } +3275 ms Preliminary verdict: : [3] (PASS) +3285 ms Send event: :[1]HCI!HCI_WRITE_CLASS_OF_DEVICE=PDU:{ classOfDevice:'002580'O } +3295 ms Receive event: :[3]HCI?HCI_WRITE_CLASS_OF_DEVICE_COMPLETE_EVENT=PDU:{ status:HCI_OK } +3295 ms Preliminary verdict: : [3] (PASS) +3305 ms Send event: :[1]HCI!HCI_DELETE_STORED_LINK_KEY=PDU:{ bd_addr:'202BC1C7A97D'O, delete_all:GcTRUE } +3315 ms Receive event: :[3]HCI?HCI_DELETE_STORED_LINK_KEY_COMPLETE_EVENT=PDU:{ status:HCI_OK, num_keys_deleted:0 } +3315 ms Preliminary verdict: : [3] (PASS) +3325 ms Send event: :[1]HCI!HCI_WRITE_CONNECTABLE_REQ=PDU:{ connectable:GcTRUE } +3335 ms Receive event: :[3]HCI?HCI_WRITE_CONNECTABLE_CFM=PDU:{ result:GcTRUE } +3345 ms Preliminary verdict: : [3] (PASS) +3355 ms Send event: :[1]HCI!HCI_READ_BD_ADDR=PDU:{ } +3365 ms Receive event: :[3]HCI?HCI_READ_BD_ADDR_COMPLETE_EVENT=PDU:{ status:HCI_OK, bd_addr:'008098E736F0'O } +3365 ms Preliminary verdict: : [3] (PASS) +3375 ms Send event: :[1]HCI!HCI_READ_LOCAL_VERSION_INFORMATION=PDU:{ } +3385 ms Receive event: :[3]HCI?HCI_READ_LOCAL_VERSION_INFORMATION_COMPLETE_EVENT=PDU:{ status:HCI_OK, hciVersion:4, hciRevision:5360, lmpVersion:4, manufacturerName:10, lmpSubversion:5360 } +3385 ms Preliminary verdict: : [3] (PASS) +4166 ms Send event: :[36]MMI!MMI_MSGBOX_REQ=PDU:{ caption:"{ 1, %s, HID }ClickOk, thenusingtheImplementationUnderTest(IUT)connecttothePTS.", style:MMI_Style_Ok_Cancel1 } +6840 ms Receive event: :[5]MMI?MMI_MSGBOX_RSP=PDU:{ status:MMI_OK } +14891 ms Receive event: :[144]HCI?HCI_CONNECTION_COMPLETE_EVENT=PDU:{ status:HCI_OK, handle:'002E'O, bd_addr:'202BC1C7A97D'O, link_type:HCI_LINK_TYPE_ACL, encryption_mode:HCI_ENCRYPTION_DISABLED } +15873 ms Receive event: :[128]HCI?HCI_SSP_PASSKEY_REQ=PDU:{ bd_addr:'202BC1C7A97D'O, passkey:"474011", rm_name:"MediaPad" } +15903 ms Send event: :[4]HCI!HCI_SSP_PASSKEY_RSP=PDU:{ bd_addr:'202BC1C7A97D'O, accept:GcTRUE } +20299 ms Receive event: :[139]HCI?HCI_LINK_KEY_NOTIFICATION_EVENT=PDU:{ bd_addr:'202BC1C7A97D'O, link_key:'C87CC88AC942F9905D83623C38302E5A'O, link_key_type:HCI_LINK_KEY_TYPE_AUTHENTICATED_COMBINATION_KEY } +22132 ms Receive event: A:[2]L2CAP?L2CAP_SETUP_IND=PDU:{ bdAddr:'202BC1C7A97D'O, psm:'0011'O, lcid:'0041'O } +22142 ms Send event: :[19]L2CAP!L2CAP_SETUP_RSP=PDU:{ lcid:'0041'O, result:L2CAP_RESULT_CONNECTION_SUCCESSFUL, linkTimeout:'FFFF'O } +22152 ms Receive event: :[142]HCI?HCI_AUTHENTICATION_COMPLETE_EVENT=PDU:{ status:HCI_OK, handle:'002E'O } +22182 ms Receive event: :[11]L2CAP?L2CAP_SETUP_COMPLETE_IND=PDU:{ lcid:'0041'O, result:L2CAP_RESULT_CONNECTION_SUCCESSFUL, localMtu:672, remoteMtu:672, remoteFlushTimeout:65535 } +22192 ms Verdict Description: HID control channel connected +22192 ms Preliminary verdict: : [1] (PASS) +22302 ms Receive event: A:[2]L2CAP?L2CAP_SETUP_IND=PDU:{ bdAddr:'202BC1C7A97D'O, psm:'0013'O, lcid:'0042'O } +22312 ms Send event: :[38]L2CAP!L2CAP_SETUP_RSP=PDU:{ lcid:'0042'O, result:L2CAP_RESULT_CONNECTION_SUCCESSFUL, linkTimeout:'FFFF'O } +22322 ms Receive event: :[142]HCI?HCI_AUTHENTICATION_COMPLETE_EVENT=PDU:{ status:HCI_OK, handle:'002E'O } +22342 ms Receive event: :[11]L2CAP?L2CAP_SETUP_COMPLETE_IND=PDU:{ lcid:'0042'O, result:L2CAP_RESULT_CONNECTION_SUCCESSFUL, localMtu:672, remoteMtu:672, remoteFlushTimeout:65535 } +22352 ms Verdict Description: HID interrupt channel connected +22352 ms Preliminary verdict: : [1] (PASS) +22412 ms Receive event: :[20]L2CAP?L2CAP_DATA_IND=PDU:{ lcid:'0042'O, payload:'A20200000000'O } +22422 ms Verdict Description: OUTPUT REPORT: ID: 2 Hex: 00000000 +22432 ms Receive event: :[20]L2CAP?L2CAP_DATA_IND=PDU:{ lcid:'0042'O, payload:'A20300'O } +22442 ms Verdict Description: OUTPUT REPORT: ID: 3 Hex: 00 +23243 ms Send event: :[36]MMI!MMI_MSGBOX_REQ=PDU:{ caption:"{ 4, %s, HID }ClickOk, thensendaVirtualCableUnplug(VCU)fromtheImplementationUnderTest(IUT), andwaitforthePTStodisconnecttheInterrruptandthenthecontrolchannels.", style:MMI_Style_Ok_Cancel1 } +25977 ms Receive event: :[5]MMI?MMI_MSGBOX_RSP=PDU:{ status:MMI_OK } +31906 ms Receive event: :[30]L2CAP?L2CAP_DISCONNECT_IND=PDU:{ lcid:'0042'O, reason:L2CAP_HCI_OK } +31916 ms Verdict Description: HID interrupt channel disconnected +31916 ms Preliminary verdict: : [1] (PASS) +31916 ms Send event: :[64]L2CAP!L2CAP_DISCONNECT_RSP=PDU:{ lcid:'0042'O } +32417 ms Receive event: :[30]L2CAP?L2CAP_DISCONNECT_IND=PDU:{ lcid:'0041'O, reason:L2CAP_HCI_OK } +32417 ms Verdict Description: HID control channel disconnected +32417 ms Preliminary verdict: : [1] (PASS) +32427 ms Send event: :[55]L2CAP!L2CAP_DISCONNECT_RSP=PDU:{ lcid:'0041'O } +32437 ms Verdict Description: FATAL ERROR: Received a CM_HID_DISCONNECT_IND (L2CAP channels disconnected) when the PTS and IUT are still virtually cabled +32437 ms Preliminary verdict: : [6] (INCONC) +32457 ms Verdict Description: HID PTC exiting +32457 ms Preliminary verdict: : [1] (PASS) +32457 ms Verdict Description: MTC: Test case ended +32457 ms Preliminary verdict: : [3] (PASS) +32467 ms Final verdict: : [4] INCONC +32517 ms Encrypted Verdict A1#ZWY4MzQ5MDg3MmQwNTIxOGQzMzQ5YjY2ODA5M2MzNjQ5ZDY4NmY0Yjc2MzIzM2VkNTUyNTFhNGU4Mjg1MjI0NA==#kbrJvmoYLJM1hNnWGou5y2aQC2wVSBesud241vDZtNHkPahxlVj61lAIRMiSrun4 +32517 ms Test Case ended: TC_HOS_HCR_BV_03_I