- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I know how to sent a int over BLE, but now I want to sent a string but I can't seem to find out how.
This is how I sent a int, that i can read from my app:
for(;;)
{
/* https://www.youtube.com/watch?v=Aeip0hkc4YE*/
cy_stc_ble_gatt_handle_value_pair_t serviceHandle;
cy_stc_ble_gatt_value_t serviceData;
serviceData.val = (uint8*)data;
serviceData.len = 1;
serviceHandle.attrHandle = CY_BLE_CUSTOM_SERVICE_DEVICE_OUTBOUND_CHAR_HANDLE;
serviceHandle.value = serviceData;
Cy_BLE_GATTS_WriteAttributeValueLocal(&serviceHandle);
data[0]++;
CyDelay(1000);
}
This counts up every second and I can read it.
but if I want to sent a string how can I do that?? I tried somthing like this, but i only read the start letter 'M':
ValStr = "Mads Sander Hoegstrup";
serviceData.val = (uint8*) ValStr;
serviceData.len = 1;
serviceHandle.attrHandle = CY_BLE_CUSTOM_SERVICE_DEVICE_OUTBOUND_2_CHAR_HANDLE;
serviceHandle.value = serviceData;
Cy_BLE_GATTS_WriteAttributeValueLocal(&serviceHandle);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please check proper value for the Length to be packed(in bytes) in the cy_stc_ble_gatt_handle_value_pair_t structure .
Thanks,
P Yugandhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please check proper value for the Length to be packed(in bytes) in the cy_stc_ble_gatt_handle_value_pair_t structure .
Thanks,
P Yugandhar.