CY5677 data streaming with .net

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.
StSt_289401
Level 1
Level 1

Dear community,

We are using CY5677 to connect with a BLE amplifier.

The amplifier is controlled by a uC which also manages all the communication. Unfortunately, I don't have access to the FW.

The idea is to stream data from the BLE amplifier to the PC.

The manufacturer of the amplifier worked with CySmart app and the streaming is possible in the following manner:

1. Discover all attributes.

2. Write 0x01 to Characteristic Handle 0x026.

3. Data appears and updates asynchronously at Characteristic Handle 0x02C. Its length is fixed.

(No CCCD Handle is used here! I mean, that the streaming also works even if notifications were not enabled in CySmart GUI!)

There is another handle (0x033 in my case) that provides battery & temperature status every 5 seconds~.

To receive these updates asynchronously I do need to enable notifications for this characteristic (it's CCCD handle is 0x034).

What we want to do is this:

1. Create a small app that will automatically connect to the BLE amplifier.

2. Start streaming data upon request into a textbox (let's start with that).

The attached VS solution is based heavily on this: How to send Scan_Request's from CY5677 Dongle with the C# API from Cypress

What we have accomplished thus far and is implemented in the attached solution:

1. Connect to the dongle.

2. Scan and connect to the device using its hardware address.

3. Read a characteristic value.

4. Write to a characteristic value.

5. Enable and receive notifications by writing 0x0100 to the CCCD handle 0x034 to see the battery & temperature data from characteristic handle 0x033 (using the OnCharacteristicChanged callback).

However, I do not receive any updates from 0x026 if I write 0x01 to characteristic handle 0x02C. Additionally, I lose the ability to read/write characteristic values.

The steps to solve this so far were:

1. Debug the above solution.

2. Try to locate the thread/method which is locked or stuck after I write 0x01 to char. handle 0x026 and try to figure out why I don't get the OnCharacteristicChanged callback.

So, streaming works with CySmart app but does not work with the attached simplified example. Question is why?

What am I missing? What are your suggestions?

Thankfully,

Stas

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

When the notification button is clicked, check if GATTClientEventCallback.DescriptorWriteHandler() and GattClient.WriteDescriptor() are executed successfully.

If the above code executes correctly, then it should notify the GATTClientEventCallback.CharacteristicChangedHandler(). Check if it enters this.

When you debug, please share the call stack when the code is stuck to give more insight on the problem.

Regards,

Dheeraj

0 Likes