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

ble_nus_c.h error - implement UART service to central and peripheral example

Hi

I am trying to implement UART on nrf52832 ,  s132 central and peripheral code.I am getting the following error.

Description Resource Path Location Type
fatal error: ble_nus_c.h: No such file or directory main.c /central_and_peripheral/examples/ble_central_and_peripheral/experimental/ble_app_hrs_rscs_relay line 73 C/C++ Problem

thanks

  • Also i have tried to make the following chnages in becon to it adverise and then conncet 
    i have added the following in the code.

    static void conn_params_error_handler(uint32_t nrf_error)
    {
    APP_ERROR_HANDLER(nrf_error);
    }static void conn_params_error_handler(uint32_t nrf_error)
    {
    APP_ERROR_HANDLER(nrf_error);
    }

    static void gap_params_init(void)
    {
    uint32_t err_code;
    ble_gap_conn_sec_mode_t sec_mode;
    ble_gap_conn_params_t gap_conn_params;
    int8_t tx_power = 4;

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

    err_code = sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *)DEVICE_NAME,strlen(DEVICE_NAME));
    APP_ERROR_CHECK(err_code);

    //The +3dBm setting is only available on nRF52 series ICs.
    //Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, 3, and 4 dBm).
    err_code = sd_ble_gap_tx_power_set(tx_power);
    APP_ERROR_CHECK(err_code);

    memset(&gap_conn_params, 0, sizeof(gap_conn_params));

    gap_conn_params.min_conn_interval = MIN_CONNECTION_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONNECTION_INTERVAL;
    gap_conn_params.slave_latency = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout = SUPERVISION_TIMEOUT;

    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    APP_ERROR_CHECK(err_code);
    }

    static void conn_params_init(void)
    {
    uint32_t err_code;
    ble_conn_params_init_t cp_init;

    memset(&cp_init, 0, sizeof(cp_init));

    cp_init.p_conn_params = NULL;
    cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
    cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY;
    cp_init.max_conn_params_update_count = MAX_CONN_PARAMS_UPDATE_COUNT;
    cp_init.start_on_notify_cccd_handle = BLE_CONN_HANDLE_INVALID; // Start upon connection.
    cp_init.disconnect_on_fail = true;
    cp_init.evt_handler = NULL; // Ignore events.
    cp_init.error_handler = conn_params_error_handler;

    err_code = ble_conn_params_init(&cp_init);
    APP_ERROR_CHECK(err_code);
    }

    is this right?

    because when i check in the nrf app the device is not advertising

    what changes do i need to make for the device to be advertise and then when central detects it how to i connect to it?(at central end direct connection)

    or which example do i make the changes

Related