I can't find a dedicated page for CySmart development, so I'm posing my question here: I've developed a Windows 7 BLE Host application using the CySmart libraries as exposed via the CySmart API Reference Guide. My app communicates through a CY5677 USB don

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

cross mob
Anonymous
Not applicable

I can't find a dedicated page for CySmart development, so I'm posing my question here: I've developed a Windows 7 BLE Host application using the CySmart libraries as exposed via the CySmart API Reference Guide. My app communicates through a CY5677 USB dongle. We have changed our peripheral design slightly, but now my Host app can't complete pairing any more. The expected LL_ENC_REQ packet is never sent to the peripheral; instead, the ICyBleDevice.Pair() method returns BLE_ERROR_INSUFFICIENT_RESOURCES. This never used to happen, but the fact that the LL packet isn't even being sent indicates this is a problem internal to the CySmart components. Any idea what's going on?

0 Likes
1 Solution
Anonymous
Not applicable

HI Dheeraj,

I figured out what the issue was: my dongle's pairing table was full! The reason why the peripheral used to work but stopped working after a minor code change is because the Bluetooth Device Address was inadvertently changed. The previous BDA was already in the dongle's pairing table, but after the peripheral's firmware was updated it used a new, different BDA. Naturally, the dongle didn't have any extra room for this new BDA and thus reported 'Insufficient Resources'. I confirmed this using the CySmart program itself, which finally revealed the cause of this error condition.

Thanks once again for all your help,

Kevin

View solution in original post

0 Likes
3 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

The error "BLE_ERROR_INSUFFICIENT_RESOURCES" is returned by the enum class CyStatus and not the ICyBleDevice.Pair() (which returns the status as part of CyApiErr class as mentioned in page#163 in the API reference guide)

API reference guide link: http://www.cypress.com/file/232791/download

Hence, it looks like the connection handler which is part of BleMgrCb class is not able to connect with the device. Because the connection handler returns the result and status which is the peer device connected and errors associated with the connection which is BLE_ERROR_INSUFFECIENT_RESOURCES in your case.

Hence, attach your project so that I can have a look at your code and assist you better.

Regards,

Dheeraj

Anonymous
Not applicable

Hi Dheeraj,

Thanks for the quick response. Actually, the connection request is sent by the Host and received by the target. In fact, the CyBleMgrCallback.OnConnected() handler returns a status of CyStatus.BLE_STATUS_OK along with a CyConnectResult object containing a peer device. This leads me to believe that the connection has been established.

Because the status indicates success, my code next registers my device callbacks with this CyConnectResult.Device, and then invokes the device's Pair() method after instantiating a CyPairSettings object. It is this device's CyBleDeviceCallback.OnPairingCompleted handler that returns a status of CyStatus.BLE_ERROR_INSUFFICIENT_RESOURCES.

I will attach my Visual Studio project (C#/.NET plus WinForms) for your review.

Thanks again for your help!

Kevin Degrood

0 Likes
Anonymous
Not applicable

HI Dheeraj,

I figured out what the issue was: my dongle's pairing table was full! The reason why the peripheral used to work but stopped working after a minor code change is because the Bluetooth Device Address was inadvertently changed. The previous BDA was already in the dongle's pairing table, but after the peripheral's firmware was updated it used a new, different BDA. Naturally, the dongle didn't have any extra room for this new BDA and thus reported 'Insufficient Resources'. I confirmed this using the CySmart program itself, which finally revealed the cause of this error condition.

Thanks once again for all your help,

Kevin

0 Likes