BLE Gatt Characteristic value format | Cypress Semiconductor
BLE Gatt Characteristic value format
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;
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.