1 Reply Latest reply on Apr 4, 2017 7:35 AM by ronald_2296921

    Written values over BLE dont "stick"

    ronald_2296921

      i'm pretty new to Psoc development so please forgive any obvious mistakes.
      i've been working on a project for the past few days. the values im writing with the CySmart applet dont seem to "stick."

         

      looking at some of the example projects i came up with the following.

         

      [code]
      case CYBLE_EVT_GATTS_WRITE_REQ:
                  wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
                  if(wrReqParam->handleValPair.attrHandle == CYBLE_MULTFIBER_TOOL_DEVICE_CHAR_HANDLE){
                      CYBLE_GATT_HANDLE_VALUE_PAIR_T hvp;
                      uint8 theValue[2];
                      theValue[0] = wrReqParam->handleValPair.value.val[0];
                      theValue[1] = wrReqParam->handleValPair.value.val[1];
                      hvp.attrHandle = CYBLE_MULTFIBER_TOOL_DEVICE_CHAR_HANDLE;
                      hvp.value.val = theValue;
                      hvp.value.len = 2;
                      /* Report data to BLE component for sending data when read by Central device */
                      CyBle_GattsWriteAttributeValue(&hvp, 0, &cyBle_connHandle, CYBLE_GATT_DB_PEER_INITIATED);
                      }
               
                  
                  CyBle_GattsWriteRsp(cyBle_connHandle);
                  break;

         

      [/code]

         

       

         

      i've got a similar setup for the write without response, but when i write a value via the CySmart Applet it reads as the default value: 00
      are there any glaring issues im overlooking?