/* Function for the GAP initialization. 
This function will setup all the necessary GAP (Generic Access Profile) parameters of the device. It also sets the permissions and appearance.  */
static uint32_t gap_params_init(void)
/* Function for the GAP initialization. 
This function will setup all the necessary GAP (Generic Access Profile) parameters of the device. It also sets the permissions and appearance.  */
static uint32_t gap_params_init(void)
{
    uint32_t                err_code;
    ble_gap_conn_params_t   gap_conn_params = {0};
    ble_gap_conn_sec_mode_t sec_mode;
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
    err_code = gap_address_change();
    VERIFY_SUCCESS(err_code);
    err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)DEVICE_NAME,
                                          strlen(DEVICE_NAME));
    VERIFY_SUCCESS(err_code);
    gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;
    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    return err_code;
}