6 Replies Latest reply on Apr 21, 2016 12:34 AM by mcmagnus

    Service discovery fails

      Hi

       

      I'm trying to bond with my Android phone from a BCM943341 eval board.

       

      The bluetooth communications seems to go well until I try to connect to it.

       

      I use wiced_bt_start_inquiry to start the inquiry.

       

      When I see the phone, I cancel the inquiry and try to bond with it using wiced_bt_dev_sec_bond. I then get the BTM_PAIRING_IO_CAPABILITIES_BR_EDR_REQUEST_EVT event and set the local_io_cap to DISPLAY_AND_KEYBOARD (which is what I will be having on the target board), and auth_req to BTM_AUTH_ALL_PROFILES_NO (which is a guess).

       

      I then get a connect status callback telling me it is connected.

       

      Then I get a BTM_USER_CONFIRMATION_REQUEST_EVT with the PIN, and I reply with a:

       

      wiced_bt_dev_confirm_req_reply(WICED_BT_SUCCESS, p_event_data->user_confirmation_request.bd_addr);

       

      A dialog pops up on the phone with the PIN and I press PAIR.

       

      After that, I get a BTM_PAIRING_COMPLETE_EVT. This is when I initiate the service discovery using:

       

      wiced_bt_sdp_init_discovery_db(sdp_disc_db, size, 0, NULL, 0, NULL)

      (where size is the sum of the wiced_bt_sdp_discovery_db_t plus 50 records and 50 attributes total 1600 bytes)

       

      Then I start the discovery using:

      wiced_bt_sdp_service_search_request(bd_addr, sdp_disc_db, discComplete_cb);

       

      But the result I get to the discComplete_cb (after a few seconds) is always FFF1 (WICED_BT_SDP_CONN_FAILED).

       

      Anyone has a suggestion?