On Thu, Apr 20, 2017 at 09:43:12PM -0700, Jacob Rosenthal wrote:
> supervision_timeout = 300 appears to have done it! Any good way to find the
> existing params change just the 1 I actually want to change?

You can use ble_gap_conn_find() to determine the current connection
parameters.

> Maybe nrf51 devices should look up supervision_timeout and either send an
> error code or even request parameter update automatically?
> 
> static int
> bleprph_gap_event(struct ble_gap_event *event, void *arg)
> {
>     struct ble_gap_conn_desc desc;
>     int rc;
> 
>     switch (event->type) {
>     case BLE_GAP_EVENT_CONNECT:
>         struct ble_gap_upd_params params = {
>             .itvl_min = BLE_GAP_ADV_FAST_INTERVAL1_MIN,
>             .itvl_max = BLE_GAP_ADV_FAST_INTERVAL1_MAX,
>             .supervision_timeout = 300,
>             .min_ce_len = BLE_GAP_INITIAL_CONN_MIN_CE_LEN,
>             .max_ce_len = BLE_GAP_INITIAL_CONN_MAX_CE_LEN,
>         };
>         rc = ble_gap_update_params(event->connect.conn_handle, &params);
>         assert(rc == 0);
>         return 0;

Careful, you're specifying advertising interval values as connection
interval parameters.  Using ble_gap_conn_find() will take care of this.

Chris

Reply via email to