Reading and writing to peripheral from central

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

cross mob
Anonymous
Not applicable

I was under the impression that the CyBle_GattsReadAttributeValue and CyBle_GattsWriteAttributeValue functions were used by the central to read and write values of the peripheral but it seems they only interact with the local values on the system. My scenario is:

   

I have 2 pioneer kits, one acting as central and another acting as a peripheral. I just want the central to read the peripheral's values and then update them. I figure its a relatively simple answer but I've been going down the wrong path for a while now and I figure just asking the question is easier.

0 Likes
1 Solution
Anonymous
Not applicable

You're almost on the right path; the GATT server methods (CyBle_Gatts...) work with data in the local GATT server, as you have found. The ones that you want are GATT client methods (CyBle_Gattc...) instead. Specifically, refer to:

   
        
  • CyBle_GattcReadCharacteristicValue()
  •     
  • CyBle_GattcWriteCharacteristicValue()
  •    
   

These are documented in the API reference material.

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

You're almost on the right path; the GATT server methods (CyBle_Gatts...) work with data in the local GATT server, as you have found. The ones that you want are GATT client methods (CyBle_Gattc...) instead. Specifically, refer to:

   
        
  • CyBle_GattcReadCharacteristicValue()
  •     
  • CyBle_GattcWriteCharacteristicValue()
  •    
   

These are documented in the API reference material.

0 Likes