2 Replies Latest reply on Aug 11, 2015 10:34 AM by user_516327008

    Reading Characteristic value other than uint8

    user_516327008

      I'm making a project in which the client reads a few values from the server when the server characteristics are updated.

         

      From what I understand, this is how to read characteristic values:

         

      case CYBLE_EVT_GATTS_WRITE_REQ:
              /* This event is generated when the connected Central */
              /* device sends a Write request. */
              /* The parameter 'eventParam' contains the data written */
              
                  wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
                  
                  if (CYBLE_DELAY_SERVICE_DELAY_INFO_CHAR_HANDLE ==
                                              wrReqParam->handleValPair.attrHandle)
                  {
                      Array[0] =
                                  wrReqParam->handleValPair.value.val[0];
                      Array[1] = 
                                  wrReqParam->handleValPair.value.val[1];
                      
                      uint16value = wrReqParam->handleValPair.value.val;
                                  
                  }
                  
                  CyBle_GattsWriteRsp(cyBle_connHandle);
              break;

         

      This words fine for the array, but when i use a uint16 it won't allow it, as "handleValPair.value.val" is a uint8. If someone could help me with this or point me in the direction of a good example of how to read/write characteristic values it would be much appreciated. Thanks in advance.