6 Replies Latest reply on Aug 1, 2017 8:26 AM by e.pratt_1639216

    Characteristic Notifies Correctly but Blank When Read

    user_385543602

      Hi,

         

      I have a system values characteristic that is being read by an android app.  The characteristic delivers the correct values when the PSOC notifies the app, but when the app reads the characteristic, it shows up as whatever values are in the component in PSOC Creator.  Am I writing to the GATT database incorrectly?  Below is my update code.

         


      // Sends notificaiton of sysValues change to the app
      void NotifySysValuesChange()
      {
          // Set up value structure
          struct valsStruct{
              uint16 angleLow;
              uint16 angleHigh;
              uint8 mode;
          } tempStruct;
          
          // Gather system values and update GATT database
          tempStruct.angleLow = dataLocal.angleLow;
          tempStruct.angleHigh = dataLocal.angleHigh;
          tempStruct.mode = dataLocal.mode;
          CYBLE_GATT_HANDLE_VALUE_PAIR_T tempHandle;
          tempHandle.attrHandle = CYBLE_ROTARYACTUATOR_SYSVALS_CHAR_HANDLE;
          tempHandle.value.val = (uint8 *)&tempStruct;
          tempHandle.value.len = sizeof(tempStruct);  
          
          // Update Gatts Server
          CyBle_GattsWriteAttributeValue(&tempHandle, 0, &cyBle_connHandle, CYBLE_GATT_DB_LOCALLY_INITIATED);    
          // Send notificaiton if authentication is complete
          if(deviceConnected){CyBle_GattsNotification(cyBle_connHandle,&tempHandle);}
      }
       

         

      Once again, the notification delivers correctly, but reading the database does not reflect the update.

         

      Please let me know if you have any ideas.  Thanks in advance,

         

      Tom