C# Data Logging to interface with PSOC4 BLE device

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.
TW_Chia
Level 3
Level 3
First like received 25 replies posted 10 sign-ins

Good day,

   

I have developed a prototype PSOC BLE 4.1 board that captures analog data from a sensor and this information is sent via BLE to a windows PC via the Cypress BLE Dongle.

   

 I am using C# (Visual Studio 2015) for the windows based test program development.

   

The c# program is developed based on api examples found in the Cypress Community.

   

In that example, it is divided into 2 segments, notifications and scanner project.

   

I have integrated both the segment into my test program as shown in the attached file.

   

On program launch, the program is able to connect to the dongle and detect the BLE device as shown in the attached.

   

However, when one click on the <Select> checkbox, it is not able to connect to the BLE device.

   

If one skip the scanning segment and set the notification segment with the BLE address of that device, then connection is established and notification is able to read the periodic information sent from the BLE device.

   

Initial analysis seems to point to the AutoResetEvent from either the Scanner or the Notification fucntions to be the caused of the issue.

   

My C# project can be downloaded via this link 

   

https://www.dropbox.com/s/sa55zhyasc76yki/aMixerBLEApp.zip?dl=0

   

I am hence seeking your expertise advice as to how the connection issue can be resolved.

   

Thank you very much in advance.

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

The connection can be established only when the Dongle is not scanning. Can you please ensure that the scanning is stopped before you click connect?

   

Also, I have attached a C# Dongle Simple Example project which shows how to scan, connect, read, write, receive notifications, disconnect. The corresponding BLE project for PSoC creator is also attached.  

   

https://www.dropbox.com/s/8p2i2w17bzqmkkc/CySmart%20GUI%20Mady-40.zip?dl=0

   

Regards,

   

-Madhu Sudhan

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

Hi,

   

The connection can be established only when the Dongle is not scanning. Can you please ensure that the scanning is stopped before you click connect?

   

Also, I have attached a C# Dongle Simple Example project which shows how to scan, connect, read, write, receive notifications, disconnect. The corresponding BLE project for PSoC creator is also attached.  

   

https://www.dropbox.com/s/8p2i2w17bzqmkkc/CySmart%20GUI%20Mady-40.zip?dl=0

   

Regards,

   

-Madhu Sudhan

0 Likes

Good day Madhu Sudhan,

   

Thank you for the reply.

   

Yes, I have got it to work after the scanning callback is stopped.

   

May I ask another question if the Cypress Dongle allows simultaneous connection to more than 1 BLE devices at one time?

   

For your advice.

   

 

   

Thank you & Best Regards,

   

 

   

Tat Weng Chia

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

Cypress dongle does not allow multiple connection simultaneously.You will need to time multiplex the connection.

   

Thanks,

   

Hima