BTSDK SPP Library BDADDR handling

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

cross mob
lock attach
Attachments are accessible only for community members.
jbruneaux
Level 3
Level 3
25 sign-ins 10 replies posted 10 questions asked

Hi,

While experimenting with BTSDK (V4.0.0), and trying to establish a SPP connection to a remote device, we were facing an issue with a connection failure. The pairing/bonding is working (using wiced_bt_dev_sec_bond and managing events correctly).

Using BTSpy and hci trace, we oberved that during SPP connection request, the bdaddr was reversed (see the trace bellow, line 42, the first request is using correct bdaddr during bonding process, then line 416, during spp connection, the bdaddr is reversed). We double checked that during spp API call, we were not reversing bdaddr content. Looking at the spp library code (https://github.com/Infineon/btsdk-rfcomm/blob/master/COMPONENT_spp_lib/spp_lib.c) line 183/184, we see that the bdaddr is reversed. We tried the same code but with a small change to line 184 to not reverse the bdaddr and the link was successfully established...

Can you please confirm that either the spp library api documentation must be changed to specify that the bdaddr must be reversed before call (quite ugly) or that there's an issue in the spp library ? If neither of these is correct, then can you point me to a working example of a spp connection initiated from the embedded application (we are using the CYBT-483056-EVAL board based on the CYW20719B2 chipset).

 

Regards, Jerome

 

 

0 Likes
4 Replies
advait_kulkarni
Moderator
Moderator
Moderator
25 likes received 250 sign-ins 100 solutions authored

Hi @jbruneaux ,

Can you please refer to this code example: https://github.com/Infineon/mtb-example-btsdk-rfcomm-spp and see if it helps. Meanwhile, I will go through the logs you have shared.

Thanks and regards,

Advait Kulkarni

0 Likes

Hi @advait_kulkarni 

 

Have you been able to look at the source code. The example code that you point me to is only a server example, and the connection is not initiated from the firmware, but from the remote device. That's not our usage. In our application, we wan't to create a connection to a remote SPP service.

Regards, Jerome

0 Likes
advait_kulkarni
Moderator
Moderator
Moderator
25 likes received 250 sign-ins 100 solutions authored

Hi @jbruneaux ,

Can you confirm that the recent ticket you have created in internal case management reflects this same issue? I have already replied to you query there.

Thanks and regards,
Advait Kulkarni

0 Likes

Hi @advait_kulkarni 

No, this topic is a different issue that we have with the spp library.

This problem is that when the spp library is used to create a connection to a remote device, it uses the SDP api to query for services of the remote device. When using this SDP api, somehow the bdaddr of thé queried device is reversed (see the original post for code reference and lines). This is confirmed by the hci logs made using btspy.

We have patched the library to disable bdaddr reversal and it works but WE want in to confirm that this is the issue and if it is the issue, it should be fixed in the library.

 

Now to be complete, here is a list of the current issues that we still have with the cyw20719:

* Bonding between two cyw20719 is problematic (we need code examples of standalone application (i.e not using hci or clientcontrol), like ez-serial firmware) that use br/edr classic bluetooth bonding procedure.

* Sco connection make the device reboot. On this point you told us that cyw20721 is to be used for audio but cyw20719 and cyw20721 seems really close in term of firmware (datasheets are also very close and i couldn't spot any difference). Both datasheet tells that devices are able to do audio. also cyw20721 is not available anywhere

* There's still no example code for the CYBT-483056-EVAL board which enables correctly the embedded PA so when using the device, range is really poor. You pointed that we need to use a library but this should be part of the bsp of this chipset. Maybe this should be a part of this chipset firmware patch so that it is automatically enabled and configured correctly.

 

Regards Jerome 

0 Likes