This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Enable event lenght extension on sdk 1.7.0

Hi,

I am trying to enable event length extension on uart example provided on the sdk. I look for information on how to done it and i found links like that:

https://devzone.nordicsemi.com/f/nordic-q-a/22698/setting-gap-connection-event-length---ble-hrs-c-demo

https://devzone.nordicsemi.com/f/nordic-q-a/39787/verifying-connection-event-length-extension-and-data-length-extension

But on sdk 1.7.0 i am not able to do it because of there are many dependences that i can't find. On addition, is necessary to reproduce the code of links have an sttack declared and initialized on main.c, and this isn't occur on uart peripheral example.

Please if somebody could explain to me step by step what requirements i need to enable this event length extension? And there are some Kconfig to do it directly?? or is necessary to initialize the stack dinamically on main.c and pass the configuration necessary? 

I know that on nrf528xx-ble-throughput-demo this is done, butim not able to reproduce t on the actual sdk.

I will be very gratefull, 

regards.

Parents Reply Children
  • Sorry for the misunderstanding, i am using nRF Connect for Desktop v3.9.1, wth NCS 1.7.0.

    Regarding data length extension, check out the example nrf/samples/bluetooth/throughput, which uses a data length of 251

    I am not speaking about DATA length extension, I want to know a way to have control on the EVENT length extension that softdevice uses to allocae every peripheral on it schedule. On another words, if is there some method to have control on Event length extension, to fix a constant time to every peripheral connection.

    On addition i want to know where and how enable the event length extension.

    The aim of this is have total control on number of packets per every ble connection interval.

    regards.

  • On another words, i need to know how to modify NRF_SDH_BLE_GAP_EVENT_LENGTH

    on the actual ncs, because of i can't find any k_config for this.

    Thank you.

  • Sorry for being too quick and not answering your question. Let's try again

    Regarding the event length, see the comment in softdevice_controller/include/sdc_hci_vs.h:

    * When Extended Connection Events are disabled, the maximum connection event length is set by @ref
    * sdc_hci_cmd_vs_event_length_set().
    * When Extended Connection Events are enabled, the controller will extend the connection event as
    * much as possible, if:
    * - Either of the peers has more data to send.
    * See also: Core v5.1, Vol 6, Part B, Section 4.5.6
    * - There are no conflicts with other concurrent links.
    *
    * A connection event can not be extended beyond the connection interval.

    So, if you enable extended connection events (dynamic eventh length), the maximum event length is set by the connection interval. To set the connection interval check out the example nrf/samples/bluetooth/throughput and this case: https://devzone.nordicsemi.com/f/nordic-q-a/69473/ncs-connection-interval-changing-to-config_bt_peripheral_pref_max_int-after-5s

    If you disable extended connection events (constant eventh length), the maximum event length is set by the event length, which can be set through the config CONFIG_SDC_MAX_CONN_EVENT_LEN_DEFAULT

    To enable/disable extended connection events, send the HCI command SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND from the BLE host to the BLE controller, which will trigger the function sdc_hci_cmd_vs_conn_event_extend()

    This ticket explains event length/event length extension in great details

    Best regards,

    Simon

  • Hi,

    that was an usefull information, i appreciate it. But I am not able to implement a way to enable/disable extended connection events.

            sdc_hci_cmd_vs_conn_event_extend_t x={0};
    
            erri=sdc_hci_cmd_vs_conn_event_extend(&x);
            
            if(erri)printk("FALLO CON EVT LEN");
            else printk("OK EVT LEN");

    I am trying this, and the function is returning 0 always, inclusive when i pass a 2 on the argument.

    Could you tell me what is the propper way to 

    send the HCI command SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND from the BLE host to the BLE

    I am trying to follow this ticket:

    This ticket

    But on the actual ncs 1.7.0 i am not able to reproduce it. I am working with nrf52840.

    Thank you for the help and regards.

  • Hi,

    I see a similar implementation on another example, could you check that this is correct?

    static int EvtLen(void)
    {       
            int err;
    	struct net_buf *buf;
    	sdc_hci_cmd_vs_conn_event_extend_t *evt_enable;
    
    	buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND,
    				sizeof(*evt_enable));
    	if (!buf) {
    		printk("Could not allocate LLPM command buffer\n");
    		return -ENOMEM;
    	}
            evt_enable = net_buf_add(buf, sizeof(*evt_enable));
    	evt_enable->enable = 2;
    
    	err = bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_CONN_EVENT_EXTEND, buf, NULL);
    	if (err) {
    		printk("Error enabling EVENT %d\n", err);
    		return err;
    	}
    
    	printk("EVENT mode enabled\n");
    	return 0;
    }

Related