1 Reply Latest reply on Jul 29, 2019 4:30 AM by GaneshD_41

    Passing Strings over BLE

    RoSy_3754371

      I am attempting develop a project that passes temperature and humidity data from one PSoC 6 device to another, with the data in the form of strings.

       

      To achieve this i have added extra functionality to the Find Me project. Currently, I have created a custom service for a peripheral device that reads "Hello World" from the PSoC to the CySmart Android Application.

      I want to send a byte (eventually evolving into a string for UART output) in the opposite direction that will simply light an LED (or something else). I have ran into a wall and am not sure how to develop the write event handler.

       

      Any help would be appreciated, I understand this might be a rudimentary task but I just can  not figure out what I am meant to do next. 

       

      Thanks

        • 1. Re: Passing Strings over BLE
          GaneshD_41

          Hi

           

          You can send strings over BLE without any problem. But to design this application you have to decide which is going to be Central, peripheral, Client and Server. I recommend you to use the Peripheral + Server combination for the device which is going to be connected to sensors.

           

          The BLE Find me code example that you are using is a Peripheral as well as Server. As f now you are able to read the String data from the Mobile phone. Great !!

           

           

          To initiate the data transfer in the reverse direction, you have to enable the notification for the string characteristic. After enabling the notification, you will get another Client Characteristic configuration descriptor. You can enable the notifications in the client characteristic configuration descriptor (CCCD).

           

           

          One you have done this you can use the API Cy_BLE_GATTS_SendNotification() whenever you want to initiate the transaction from the peripheral.

           

          Please find the attached project where the notifications are sent upon triggering the button interrupt on the peripheral side.

           

           

          Thanks

          Ganesh

          1 of 1 people found this helpful