This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

disable encryption uart ble code

Hi Folks, I am playing with uart ble example described in this link (devzone.nordicsemi.com/.../).

However, I would like to disable encryption on BLE link. I was trying to modify the c code of this example but I couldn't disable BLE encryption

Could you please advice me to disable encryption ?

Parents
  • Usually the question is on how to enable encryption :)

    I'm not sure what SDK and SoftDevice you are using, but you should handle the BLE_GAP_EVT_SEC_PARAMS_REQUEST event. Something like:

        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;
    
Reply
  • Usually the question is on how to enable encryption :)

    I'm not sure what SDK and SoftDevice you are using, but you should handle the BLE_GAP_EVT_SEC_PARAMS_REQUEST event. Something like:

        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;
    
Children
Related