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

How can I short the time after I power on my BLE device with ble_app_hids_mouse?

It takes about 30s after I power my nrf51822 DK with ble_app_hids_mouse demo, how can I short it less than 10s ?

In the code there is a line "#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000, APP_TIMER_PRESCALER) /**< Time between each call to sd_ble_gap_conn_param_update after the first (30 seconds). */ "

I try to change 30000 to 10000 ,but it seems not work .

And I see the comment like this :

typedef struct
{
    ble_gap_conn_params_t *       p_conn_params;                    /**< Pointer to the connection parameters desired by the application. When calling ble_conn_params_init, if this parameter is set to NULL, the connection parameters will be fetched from host. */
    uint32_t                      first_conn_params_update_delay;   /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (in number of timer ticks). */
    uint32_t                      next_conn_params_update_delay;    /**< Time between each call to sd_ble_gap_conn_param_update after the first (in number of timer ticks). Recommended value 30 seconds as per BLUETOOTH SPECIFICATION Version 4.0. */
    uint8_t                       max_conn_params_update_count;     /**< Number of attempts before giving up the negotiation. */
    uint16_t                      start_on_notify_cccd_handle;      /**< If procedure is to be started when notification is started, set this to the handle of the corresponding CCCD. Set to BLE_GATT_HANDLE_INVALID if procedure is to be started on connect event. */
    bool                          disconnect_on_fail;               /**< Set to TRUE if a failed connection parameters update shall cause an automatic disconnection, set to FALSE otherwise. */
    ble_conn_params_evt_handler_t evt_handler;                      /**< Event handler to be called for handling events in the Battery Service. */
    ble_srv_error_handler_t       error_handler;                    /**< Function to be called in case of an error. */
} ble_conn_params_init_t;

Do I find the right params? Is there any other way to short the time ?

  • Hi,

    What takes 30s after power on? Is HID reports or connection itself?

    Note that the parameters you are looking at are for connection parameters to be updated once the link is established to be more suitable for HID mouse application.

  • It takes 30s from nrf51822 DK power on to Android or PC find my BLE device(hid mouse)

    But Lenovo N700 BLE mouse (nrf51822 SOC) just need 7s to be found.

    How can I achieve this? Why it takes so much time to be found in ble_app_hids_mouse demo?

    Look forward to your answer, think you!

  • Hi,

    SDK example uses aggressive advertising interval and should not take very long to discover unless the device had entered slow advertising. This happens if no connection is received within 30 seconds.

    APP_ADV_INTERVAL_FAST in SDK example determines advertising interval during first 30 seconds and is set to 0x0028, which is 25 milliseconds. You could further reduce the interval for 20 seconds by setting APP_ADV_INTERVAL_FAST to 0x0020.

    However, it is unlikely this advertising interval is causing the problem, can you ensure that the device is in fact in fast advertising mode when you observe this phenomena of taking very long for discovery?

    Aslo, it is still unclear if it is discovery at device level or service level that is taking very long time.

    Regards, Krishna

Related