5 Replies Latest reply on May 12, 2016 10:14 PM by asharma_1613651

    BLE Gatt Characteristic value format

    lipens26_1483021

      Hello,

         

      I don't seem to understand the how the data types work in PSoC creator. In the settings of the BLE component there is an option to choose what format does the Characteristic value has. It is pretty easy to use the value in the code when data type is uint8, but I can't get it to work with sint16. 

         

      When server receives a write request it is easy to extract the value from  wrReq = (CYBLE_GATTS_WRITE_REQ_PARAM_T *)eventParam with the following line uint8 value = wrReq->handleValPair.value.val[0];

         

      But this wouldn't work with the sint16. How can I take the two bytes from the characteristic value and make it into a number that can be used to comparison and math operations in the code of the server. 

         

      Regards, Andris