cancel
Showing results for 
Search instead for 
Did you mean: 

Studio Bluetooth

RiBe_4725556
New Contributor II

We are using the CYW 20706 as the target device for connecting to a BT audio source (using the 'Headset' demo from wiced studio). A mobile phone (android) can conenct correctly and send audio data (verified via I2S output). but our target communication device (security transceiver) can pair but not connect to the device.

When the connection is attempted the CYW 20706 sends the connection status event data (with correct connection status data) but immediatly sends a secondary Connection status event with Connection broken data and Error code 0X13.

The datasheet and 'WICED-HCI-Control-Protocol.pdf' don't refer to the Connection status event so i can't figure out what the problem is.

Can anybody explain what this errorcode measn and how i can fix it?

0 Likes
1 Solution
SheetalJ
Moderator
Moderator

Hi Richard,

The firmware present in ROM of CYW20706 supports latest BT version. I am afraid it is not possible to change it to support BT 4.0. There are much limitations with older versions, with respect to audio applications as well. Therefore I will suggest you to make changes at your target device itself.

Regards,

Sheetal

View solution in original post

11 Replies
SheetalJ
Moderator
Moderator

Hi RiBe_4725556​,

If you check in wiced_result.h, 0x13 means caller error.

Please confirm if you are using CYW920706WCDEVAL board or any other module?

I did not understand the connection part; So your CYW20706 device is disconnecting from the android phone immediately after connection is set up? Please clarify.

RiBe_4725556
New Contributor II

Hi,

Yes i am using the CYW920706WCDEVAL board with the given 'Headset' example. Whenever i conenct the device to an android phone, it can connect and play audio correctly.

But whenever i conenct to our target device (see below) the connection is immediatly broken giving errorcode 0X13.

SC20 TETRA Hand-Portable Radios | Sepura

We would like to connect the CYW920706WCDEVAL as a headset peripheral to the target device.

According to the datasheet the target devices BT peripheral is described as below:

Bluetooth module:

• Bluetooth v2.1+EDR

• Bluetooth v4.x

Bluetooth audio:

• Headset profile (HSP)

• PTT extension to HSP support

Bluetooth data services:

• Serial Port Profile (SPP) for data connectivity with

body-worn printers/scanners

• Dial-up networking (DUN)

• Discovery mode

• Generic attributes profile (GATT)

• Hardware-ready for:

– Object push profile

– Heart device (heart rate & temperature)

– Battery service profile

– Devices identity profile

– MAP

– HID

– HoG

Bluetooth trusted device, auto re-connect

0 Likes
AbhishekK_31
Employee

Hi RiBe_4725556,

0x13 error means "GATT_CONN_TERMINATE_PEER_USER" meaning your peer device is terminating the connection. You can find the disconnection reasons in the file wiced_bt_gatt.h under the enum wiced_bt_gatt_disconn_reason_e

0 Likes
SheetalJ
Moderator
Moderator

Hi Richard,

My sincere apologies, 0x13 do not stand for caller error. I checked different structure previously & responded.

If you check in Bluetooth spec, 0x13 error code stands for Remote User Terminated Connection. This means connection is terminated by the remote device.

If your app is working fine with any android mobile then it can be concluded that there is no problem on the app side. Specifications of your peer device looks good to me. Try doing following things-

- Remove device from the paired device list if it is there and start a new connection.

- Can you try programming hello sensor example on CYW20706 and check if your peer device is able to connect to it?

- Does your peer device accepts Bluetooth connection request from any other device apart from 20706?

- Any way to check IO capabilities of peer device?

0 Likes
RiBe_4725556
New Contributor II

Hi Sheetalj_96,

I tried your options below:

- Remove device from the paired device list if it is there and start a new connection.

     This dit not work sadly >> tried many times

- Can you try programming hello sensor example on CYW20706 and check if your peer device is able to connect to it?

After programming the hello sensor program the target device dit not see it as a connectable device.

- Does your peer device accepts Bluetooth connection request from any other device apart from 20706?

     We can connect a JBL headset using BT 4.0 >> this works correctly but a different JBL headset with BT 4.1 does NOT connect to it >> there is a difference in the device class between the 2 in device class codes:

the headset which DOES connect has the following class codes:

- Major class code: 1024

- Device class code: 1028

- Device group: AUDIO_VIDEO_GROUP

the headset which DOES NOT connect has the following class codes:

- Major class code: 1024

- Device class code: 1048

- Device group: AUDIO_VIDEO_GROUP

i don't know if this is related to the problem but we observed this with a BT scanner app.

- Any way to check IO capabilities of peer device?

     Should it be neccessary we can dismount the device but rather not.

0 Likes
SheetalJ
Moderator
Moderator

After programming the hello sensor program the target device dit not see it as a connectable device.

>> At least your target device should be able to scan hello sensor (20706). Please check if you are advertising using correct parameters in wiced_bt_start_advertisements().

From the information you provided, I think the problem is with your target device. Probably your device should be compatible with BT version 4.2 (or 5) and above.

RiBe_4725556
New Contributor II

Hi Sheetalj_96,

The target device cannot find the hello sensor BT device but an Android phone can. (it can also be possible for the target device just not to display the device in the list as it is not an audio device).

We used the standard HelloSensor project for this test.

We think it may be a problem related to the target device not supporting BT4.1 or above, is it possible for the CYW20706 to use BT 4.0 protocols instead of 4.2 protocols for pairing and connecting?

0 Likes
SheetalJ
Moderator
Moderator

Hi Richard,

The firmware present in ROM of CYW20706 supports latest BT version. I am afraid it is not possible to change it to support BT 4.0. There are much limitations with older versions, with respect to audio applications as well. Therefore I will suggest you to make changes at your target device itself.

Regards,

Sheetal

View solution in original post

RiBe_4725556
New Contributor II

HI everybody,

I have an update on the situation, we had 2 individual problems:

1. Connecting to the target device

2. Getting audio to play through whenever the target device receives audio data (I2S activation).

We tried alot of different settings and options in order to fix these problems and we where able to fix the connection problem after some time >> sadly i don't know which action precisley allowed for the fix of the problem due to a lot of changes.

Regarding the audio passthrough from the target device >> we where able to solve this issue by enabling the

'WICED_BT_HFP_HF_WBS_INCLUDED' in the wiced_bt_hfp_hf_int.h file

definition. this allowed for the enabling of the I2S when receiving audio data.

0 Likes
RiBe_4725556
New Contributor II

Hi everybody,

Apologies for the post above but the value was supposed to be FALSE >> so disabling the include NOT enabling

0 Likes