2 Replies Latest reply on Aug 20, 2016 1:40 PM by rfc_1549836

    Use of cyBle_GattcReadCharacteristicValue

    rfc_1549836

      I'm using cyBle_GattcReadCharacteristicValue to read characteristic values from peripheral / server application.

         

      I've more than one characteristic, so I call cyBle_GattcReadCharacteristicValue with the handler of the first characteristic and I get the value. When I use cyBle_GattcReadCharacteristicValue for the next read (with different handler, I receive the same value as before. Of course I've something wrong, but what?

         

      How to read multiple characteristic value?

         

      There are any code examples?

         

      Thanks for help,

         

      Fabrizio

        • 1. Re: Use of cyBle_GattcReadCharacteristicValue
          jeff.sylvester

          sounds like your on the right track, but some things missing,  I got mine working,  I am assuming that this is a custom profile,  

             

          did you verify you changed the handle, if so is your variable different.  

             

          I have one that reads a string, from on handle into an array of bytes, and then read a string  from a different handle into a different array of bytes and it works,  

             

          cyBle_GattcReadCharacteristicValue ( byte* storage array1,  sizeof array1, custom handle_1);

             

          cyBle_GattcReadCharacteristicValue ( byte* storage array2,  sizeof array2, custom handle_2);

             

          this is working for me,  otherwise just open up a sample program like the thermometer project, that has multiple characteristics, and look at their code,  in the sample projects they use an API that is generated by the tool automatically.   and instead of passing the handle directly like above for a custom profile, they use an index to the characteristic value you are looking to read.

             

          not sure if this helps but that's my 2 cents worth!

          • 2. Re: Use of cyBle_GattcReadCharacteristicValue
            rfc_1549836

            I've found the mistake.  Only I have to wait enough for event reply.
            Any way, I will  change approach, moving to notifications management, even if some things are not so clear for me: I'm BLE's beginner :-(

               

            Fabrizio