none
BlueTooth HID Profile Driver, SDP Submission faliure RRS feed

  • Question

  • I am Implementing a virtual BT Keyboard ( My Desktop is to be used as a BT Keyboard device ), For that, I have implemented a KMDF BT Profile Driver.

    I am building the SDP in accordance with the HID SDP Spec and according to a BT Keyboard SDP Dump I have extracted using sdpverifier.exe

    The generated SDP is successfully validated using SdpValidateStream.

    The generated SDP is 90% Identical to the one sniffed through using sdpverifier.exe ( Comparing the binary stream )

    However, SDP submission using IOCTL_BTH_SDP_SUBMIT_RECORD fails with STATUS_INVALID_PARAMETER 

    OPs in this forum suggest that registering a L2CAP channel with HID PSM ( 0x11 ) might not be possible, and indeed it is not, I want to try to register "HumanInterfaceDeviceServiceClassID_UUID16" with a PSM other than 0x11.

    Having in mind that the PSM Id is referenced through the HID SDP, might "IOCTL_BTH_SDP_SUBMIT_RECORD" have a specialized HID verification implemented ( mandating the PSM referred through the SDP to be 0x11 ) ?

    Having the above in mind, and, that SdpValidateStream SUCCEED, what may cause the SDP Submission failure ?

    Additional experimenting show that SDP with only a SDP_ATTRIB_CLASS_ID_LIST of HumanInterfaceDeviceServiceClassID_UUID16 is SUCCESSFULY Submited, while when adding SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST Submission fail, following is a snap of the SDPs used ( reduced for experimenting )

    SUCCESSFULY Submitted SDP: 

    SDP_BEGIN_RECORD()
    	SDP_ROOT_ATTRIBUTE_UINT(32, SDP_ATTRIB_RECORD_HANDLE, 0x10000)
    	SDP_START_LIST(SDP_ATTRIB_CLASS_ID_LIST)
    		SDP_DEFINE_NODE_UUID(16, HumanInterfaceDeviceServiceClassID_UUID16)
    	SDP_END_LIST()
    SDP_END_RECORD()

    FAILED SDP Submission:

    SDP_BEGIN_RECORD()
    	SDP_ROOT_ATTRIBUTE_UINT(32, SDP_ATTRIB_RECORD_HANDLE, 0x10000)
    	SDP_START_LIST(SDP_ATTRIB_CLASS_ID_LIST)
    		SDP_DEFINE_NODE_UUID(16, HumanInterfaceDeviceServiceClassID_UUID16)
    	SDP_END_LIST()
    	// New Stuff added
    	SDP_START_LIST(SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST)
    		SDP_START_LIST(NULL)
    			SDP_DEFINE_NODE_UUID(16, L2CAP_PROTOCOL_UUID16)
    			SDP_DEFINE_NODE_UUID(16, m_Psm)// 0x11)
    		SDP_END_LIST()
    		SDP_START_LIST(NULL)
    			SDP_DEFINE_NODE_UUID(16, HID_PROTOCOL_UUID16)
    //SDP_DEFINE_NODE_UUID(16, 0x13) SDP_END_LIST() SDP_END_LIST() SDP_END_RECORD()



    Nadav Rubinstein, See my Blog @ http://www.sophin.com













    • Edited by Nadav Rub Wednesday, October 22, 2014 1:04 PM
    Tuesday, October 21, 2014 2:35 PM

Answers

  • RESOLVED!

    The problem was that I was using UUID rather than UINT for the PSM definition, The following made the SDP Submit successfully.

    SDP_DEFINE_NODE_UUID(16, m_Psm) => SDP_DEFINE_NODE_UINT(16, m_Psm)
    

    I have wasted few hours to have this pinned down.

    Having in mind that the BlueTooth stack has the logic for verifying the SDP integrity ( otherwise SDP registration wouldn't have failed ), It seems to me in-place for Microsoft to provide the DSP verification logic as a separate Tool, one that is able to verify a binary SDP dump, adding this functionality to sdpverify.exe would be optimal.


    Nadav Rubinstein, See my Blog @ http://www.sophin.com


    • Edited by Nadav Rub Wednesday, October 22, 2014 1:10 PM
    • Marked as answer by Nadav Rub Wednesday, October 22, 2014 1:14 PM
    Wednesday, October 22, 2014 1:09 PM