- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Community
I am trying to read attributes values local from my server in order to process a write value peer but when the sever runs the method Cy_BLE_GATTS_ReadAttributeValueLocal, the server/app stop and I dont give any cy_en_ble_gatt_err_code_t.
my code is the following
bool CheckRemainingTreatments(cy_stc_ble_gatts_write_cmd_req_param_t* writeReq)
{
cy_en_ble_gatt_err_code_t apiResult;
cy_stc_ble_gatt_handle_value_pair_t attributeInfo = { .attrHandle = CY_BLE_TREATMENT_REMAINING_TREAMENTS_CHAR_HANDLE,
.value.len = CY_BLE_REMAINING_TREATMENTS_SIZE};
apiResult = Cy_BLE_GATTS_ReadAttributeValueLocal(&writeReq->connHandle, &attributeInfo);
if (apiResult != CY_BLE_GATT_ERR_NONE)
{
DBG_PRINTF("Cy_BLE_GATTS_ReadAttributeValueLocal, error %0x \r\n", apiResult);
return false;
}
else
{
DBG_PRINTF("Treatements %p", attributeInfo.value.val);
return true;
}
}
Am I using correctly the ReadAttributeValueLocal() method? The PsOC is a 6 and Kit CY8CKIT-062-BLE
Thanks, regards
David
Solved! Go to Solution.
- Tags:
- psoc6 ble
- read values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello David,
Please define the Output Data buffer where you want to store the data. Please add the below code.
cy_stc_ble_gatt_handle_value_pair_t attributeInfo = { .attrHandle = CY_BLE_TREATMENT_REMAINING_TREAMENTS_CHAR_HANDLE,
.value.val=dataBuf, //Array where we want to store the data
.value.len = CY_BLE_REMAINING_TREATMENTS_SIZE};
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello David,
Please define the Output Data buffer where you want to store the data. Please add the below code.
cy_stc_ble_gatt_handle_value_pair_t attributeInfo = { .attrHandle = CY_BLE_TREATMENT_REMAINING_TREAMENTS_CHAR_HANDLE,
.value.val=dataBuf, //Array where we want to store the data
.value.len = CY_BLE_REMAINING_TREATMENTS_SIZE};
Thanks,
P Yugandhar.