- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need any example how work with Write Long Characteristic Value.
My device receive :
CYBLE_EVT_GATTS_WRITE_CMD_REQ
CYBLE_EVT_GATTS_PREP_WRITE_REQ
CYBLE_EVT_GATTS_EXEC_WRITE_REQ
What to do ? How response to this events ?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please find the attached example project for Write long characteristics.
Thanks,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see you answer only on case CYBLE_EVT_GATTS_EXEC_WRITE_REQ.
What about CYBLE_EVT_GATTS_WRITE_CMD_REQ and CYBLE_EVT_GATTS_PREP_WRITE_REQ ?
No need to send any handshake to this requests ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
No need for sending any response in CYBLE_EVT_GATTS_PREP_WRITE_REQ.
You have to give the response in CYBLE_EVT_GATTS_EXEC_WRITE_REQ only.
CYBLE_EVT_GATTS_WRITE_CMD_REQ is used when you do a write without response.
Thanks,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have 2 long characteristics in my profile. How can I receive information about current characteristic I receive ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can check which characteristic handle has been enabled and can verify the current characteristic received.
-Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. I ask it because in your code it`s hardcoded :
write_characteristic.attrHandle=CYBLE_RW_SERVICE_WRITE_LONG_CHARACTERISTIC_CHAR_HANDLE;
How I can get it from eventParam ?
2. As I understand it receive all data in one time ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In datasheet :
The CYBLE_EVT_GATTS_EXEC_WRITE_REQ event has the following parameter structure: typedef struct { CYBLE_CONN_HANDLE_T connHandle; CYBLE_GATT_HANDLE_VALUE_OFFSET_ PARAM_T * baseAddr; uint8 prepWriteReqCount; uint8 execWriteFlag; CYBLE_GATT_DB_ATTR_HANDLE_T attrHandle; uint8 gattErrorCode; } CYBLE_GATTS_EXEC_WRITE_REQ_T
in generated BLE_1_StackGattServer.h exist explanation :
/** Attribute Handle at which error occurred. This is an o/p param */
CYBLE_GATT_DB_ATTR_HANDLE_T attrHandle;
I send different characteristic and see that it always same !
How receive characteristic handle ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this is right code :
attrHandle = execwriteReqparam->baseAddr->handleValuePair.attrHandle;
write_characteristic.attrHandle=attrHandle;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I sent long value I receive CYBLE_GATT_ERR_CODE_T = 13 .
I can`t find what it mean. Anybody help please !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 means "A write operation exceeds the maximum length of the attribute"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What to do with this error ? Seems to me that smartphone use long write method but send not 20 bytes but all data..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure you are comparing the eventParam handle with the handle you are looking for to make sure you are working on data for the correct Long_Write_Request; Also, double check the length of the data by reading the eventParam length byte to see how much data is with the message/data.