- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm getting an INVALID_PARAMETER sending notifications error I cannot explain. It only happens with some apps on an Android device. Other apps on the same device work fine. I've debugged up to the binary and it is being returned by the internal undocumented function: Cy_BLE_GATTS_Notification()
I thought it was related to MTU, but with both apps they report the same data length change.
CY_BLE_EVT_DATA_LENGTH_CHANGE (handl=0 RxO=251 RxT=2120 TxO=251 TxT=2120)
However, the one that works does emit CY_BLE_EVT_GATTS_XCNHG_MTU_REQ with 512, whereas the one that does not work, never sends that.
But the data I am trying to send os only 210 long , so I am at a loss why this error is occuring, and any hope of understanding it is hidden the binary.
Here are the parameters that work and don't work depending on the app that connects.
How can these be parameters be invalid?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Panometric
The error(CY_BLE_ERROR_INVALID_PARAMETER) will occurs if the parameter 'param' is NULL, 'connHandle' is invalid or if 'param->handleValPair.value.len' value is greater than (Effective GATT MTU-3).
If your client device supports only default MTU in that case client will not initiate an MTU exchange and server will not receive CY_BLE_EVT_GATTS_XCNHG_MTU_REQ event and you will get INVALID PARAMETER error from Cy_BLE_GATTS_SendNotification() api because we are sending here 210 bytes long data which is greater than default MTU.
You can go through the 'CE222046_Throughput_Measurement' code example in the PSoC Creator for reference.
Thanks & Regards
Pratiksha V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Panometric
Have you tried with CySmart Android app & Windows tool?. Are you facing this issue with this app?. With which android apps are you facing this issue??
Thanks & Regards
Pratiksha V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@PratikshaV Yes, Cysmart works OK, since it also negotiates the MTU and the app in question does not. I see now that the CY_BLE_EVT_DATA_LENGTH_CHANGE reports the connection MTU not the GATT MTU.
1. Can you confirm the invalid parameter is because of the GATT MTU?
2. Since this client did not make a GATT MTU change request, is there a way for the device to do it, or to know that it will not accept any more?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Panometric
The error(CY_BLE_ERROR_INVALID_PARAMETER) will occurs if the parameter 'param' is NULL, 'connHandle' is invalid or if 'param->handleValPair.value.len' value is greater than (Effective GATT MTU-3).
If your client device supports only default MTU in that case client will not initiate an MTU exchange and server will not receive CY_BLE_EVT_GATTS_XCNHG_MTU_REQ event and you will get INVALID PARAMETER error from Cy_BLE_GATTS_SendNotification() api because we are sending here 210 bytes long data which is greater than default MTU.
You can go through the 'CE222046_Throughput_Measurement' code example in the PSoC Creator for reference.
Thanks & Regards
Pratiksha V