therealergo opened a new issue, #1729:
URL: https://github.com/apache/mynewt-nimble/issues/1729

   When the number of CCCD's exceeds `BLE_STORE_MAX_CCCDS`, 
`ble_store_delete_cccd(...)` and `ble_store_write_cccd(...)` will return error 
codes from the `BLE_HS_E...` range, such as `BLE_HS_ENOENT`, `BLE_HS_ENOMEM`, 
and `BLE_HS_ENOTSUP` (dependent on the code in `store_status_cb`).
   
   When an attempt is made to write to the descriptor, these error codes are 
then directly returned from `ble_gatts_clt_cfg_access(...)`. This causes them 
to be returned by the stack as the corresponding unrelated attribute errors. 
This causes strange unexpected attribute access errors such as 
`BLE_ATT_ERR_INSUFFICIENT_AUTHEN`, `BLE_ATT_ERR_REQ_NOT_SUPPORTED`, and 
`BLE_ATT_ERR_INSUFFICIENT_AUTHOR` when an overflow occurs.
   
   These unexpected errors can cause some strange follow-up behavior: For 
example, returning `BLE_ATT_ERR_INSUFFICIENT_AUTHEN` when connected to an iOS 
device causes that iOS device to re-attempt pairing, regardless of whether the 
current connection is already bonded and encrypted.
   
   `ble_gatts_clt_cfg_access(...)` should probably check for a non-zero return 
code and return e.g. `BLE_ATT_ERR_INSUFFICIENT_RES` in that case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to