- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to write a uint16 value to the a GATT Server attribute
The attribute is set to unit16 in the Service Configuration. However, this crashes the GATT DB as the PSoC module becomes unresponsive and I have to reset it.
if (CY_BLE_LEDSERV_TIMESTAMP_CHAR_HANDLE == writeReqParameter->handleValPair.attrHandle)
{
cy_stc_ble_gatt_handle_value_pair_t timeHandle;
timeHandle.attrHandle = CY_BLE_LEDSERV_TIMESTAMP_CHAR_HANDLE;
printf("0x%x\r\n", writeReqParameter->handleValPair.value.val[0]);
printf("0x%x\r\n", writeReqParameter->handleValPair.value.val[1]);
timeHandle.value.val[0] = writeReqParameter->handleValPair.value.val[0];
timeHandle.value.val[1] = writeReqParameter->handleValPair.value.val[1];
timeHandle.value.len = 2;
Cy_BLE_GATTS_WriteAttributeValueLocal(&timeHandle);
Cy_BLE_GATTS_WriteRsp(writeReqParameter->connHandle);
}
May I understand what am I doing wrong?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okaaay...I modified it, but this was not my main problem. Anyway, I solved the problem...Basically I can point to the uint64 value with a uint8 *. A warning will be issued, but it still works if sizes are handled carefully
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Cy_BLE_GATTS_WriteAttributeValuePeer() function should be used to write to the value field of the specified attribute in the GATT database of a GATT Server by a peer device. Please refer to the KBA link for more information Updating an Attribute’s Value in GATT DB of a BLE GATT Server in PSoC 6 BLE – KBA228425
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okaaay...I modified it, but this was not my main problem. Anyway, I solved the problem...Basically I can point to the uint64 value with a uint8 *. A warning will be issued, but it still works if sizes are handled carefully