Hello Nordic and fellow developers
While implementing bonding into an application based on S130 I found it necessary to test on the role of a given connection. Different parameters have to be filled out based on the role before calling functions like sd_ble_gap_sec_params_reply(), but what if something went wrong earlier on and the role is set to BLE_GAP_ROLE_INVALID? Which error code would be most appropriate? So far I am using NRF_ERROR_INVALID_STATE, but I am now pondering if a new error code like NRF_ERROR_INVALID_ROLE would be nice to have since this clearly isn't the only place we will be facing invalid roles in the future.