CYW20719B2-BT-SDP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TaC_4722371
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

Hi,

I am calling the function wiced_bt_sdp_service_search_attribute_request, with correct arguments, but I am getting WICED_BT_SDP_NO_RESOURCES from the callback function that is passed as argument in the function wiced_bt_sdp_service_search_attribute_request. How I can solve this ?

Regards,

Tamilarasan C.

0 Likes
1 Solution

Hi,

I finally found what was the cause. I didn't allocate buffers using the wiced_bt_cfg_buf_pool_t properly. I changed and then SDP is working fine. Thank you and Can wiced_bt_sdp_init_discovery_db() init search for 2 service UUIDs at the same time?  the preceding link helped me to figure out the cause.

Regards,

Tamilarasan C.

View solution in original post

0 Likes
4 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello TaC_4722371 ,

Hope you referred \Audio_Watch demo in MTB for the API usage. If not, please have a look.

Which peer device you are trying to connect and discover ?

What was the result of wiced_bt_sdp_init_discovery_db function ?

If possible, please share the code, steps to reproduce and your test logs to reproduce the issue at our side.

Other related threads :

Can wiced_bt_sdp_init_discovery_db() init search for 2 service UUIDs at the same time?

WICED_BT_SDP_CONN_FAILED

Regards,

Anjana

0 Likes

Hello,

I am using the same code from \Audio_Watch demo in MTB for service discovery, and I configured services such as A2DP, AVRC Controller  and Target using cycfg_bt.cybt configurator and removed HCI part.

Is there any dependency to carry out to use the wiced_bt_sdp_service_search_attribute_request API ?

Which peer device you are trying to connect and discover ?

Answer: Bluetooth earphones.

What was the result of wiced_bt_sdp_init_discovery_db function ?

Answer: WICED_TRUE.

code I used:

/*

* Send SDP search request

*/

wiced_result_t av_app_initiate_sdp( BD_ADDR bda )

{

    wiced_bt_uuid_t             uuid_list;

    uint16_t attr_list[] = { ATTR_ID_SERVICE_CLASS_ID_LIST, ATTR_ID_PROTOCOL_DESC_LIST, ATTR_ID_BT_PROFILE_DESC_LIST };

    wiced_bool_t                result = WICED_FALSE;

    memcpy( av_app_cb.peer_bda, bda, BD_ADDR_LEN );

    if ( !av_app_cb.p_sdp_db )

    {

        /* Allocate memory for the discovery database */

        av_app_cb.p_sdp_db = ( wiced_bt_sdp_discovery_db_t * ) wiced_bt_get_buffer( SDP_DB_LEN );

        if ( av_app_cb.p_sdp_db == NULL )

        {

            return WICED_ERROR;

        }

    }

    WICED_BT_TRACE( "av_app_initiate_sdp %x\n\r", (uint32_t)av_app_cb.p_sdp_db );

    uuid_list.len       = LEN_UUID_16;

    uuid_list.uu.uuid16 = UUID_SERVCLASS_AUDIO_SINK;

    /* Search the contents of the database for the A2DP Sink service */

    result = wiced_bt_sdp_init_discovery_db (av_app_cb.p_sdp_db, SDP_DB_LEN,

                                             1,&uuid_list,

                                             sizeof(attr_list)/sizeof(attr_list[0]), attr_list);

    if (result == WICED_TRUE)

    {

        if ( wiced_bt_sdp_service_search_attribute_request( av_app_cb.peer_bda, av_app_cb.p_sdp_db, av_app_sdp_cback) )

        {

            av_app_cb.state = AV_STATE_SDP_IN_PROGRESS;

            return WICED_SUCCESS;

        }

        else

        {

            WICED_BT_TRACE("[%s] wiced_bt_sdp_service_search_attribute_request fail \n", __func__);

        }

    }

    else

    {

        WICED_BT_TRACE("[%s] wiced_bt_sdp_init_discovery_db fail \n", __func__);

    }

    wiced_bt_free_buffer(av_app_cb.p_sdp_db);

    av_app_cb.p_sdp_db = NULL;

    return WICED_ERROR;

}

Regards,

Tamilarasan C.

0 Likes

Hi,

I finally found what was the cause. I didn't allocate buffers using the wiced_bt_cfg_buf_pool_t properly. I changed and then SDP is working fine. Thank you and Can wiced_bt_sdp_init_discovery_db() init search for 2 service UUIDs at the same time?  the preceding link helped me to figure out the cause.

Regards,

Tamilarasan C.

0 Likes

Hi TaC_4722371 ,

Thanks for sharing your fix with us.

Yes, you need to allocate the buffer pools first for BT applications to work consistently.

You can have a look at Application Buffer Pools (cypresssemiconductorco.github.io)​ for more details.

Regards,

Anjana