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

BLE connection create parameters and connection parameters questions

Dear support

I am developing a generic central application intended to connect any BLE devices which is connectable. So I need to figure out which parameters are needed and make the them configurable. In Central multilink sample, there are two sets of parameters shown below:

	struct bt_conn_le_create_param create_param = {
		.options = BT_CONN_LE_OPT_NONE,
		.interval = INIT_INTERVAL,
		.window = INIT_WINDOW,
		.interval_coded = 0,
		.window_coded = 0,
		.timeout = 0,
	};
	struct bt_le_conn_param conn_param = {
		.interval_min = CONN_INTERVAL,
		.interval_max = CONN_INTERVAL,
		.latency = CONN_LATENCY,
		.timeout = CONN_TIMEOUT,
	};

The first one is create_param, and second one is conn_param, I read some explanation about the conn_param, but never find anything on create_param, could someone explain to me please? is INIT_INTERVAL and INIT_WINDOW important to make connection? shall I make it changeable by user?

Thank you.

Ping

  • Both conn_param and create_param are BLE connection parameters. You can find both here. create_param is just Initializing the parameters for the connection .You can establish a connection without this function

    About the parameters in the function create_param,

    interval: how long to wait between each scan, i.e after a scan is over and before the next scan starts.

    window: How long the scan should be for.

    timeout: This timeout determines the timeout from the last data exchange till a link is considered lost.

    And both interval_coded and window_coded works the same as interval and window but for long range connection. You can use the default values as shown here. An if you check the sample central_multilink you can see INIT_INTERVAL and INIT_WINDOW are the values set in the specific applications. 

    Kind Regards,

    Abhijith

  • Hi, Abhijith

    Thank you for reply.

    So, about create parameters, I can ignore it and just use the default one?

    How about the connection parameters? there are 4 of them, probably I can make at least 3 of them user configurable? they are interval max, latency and timeout.

    I am trying to connect to different devices use an application based on central multilink sample, and found that some apple devices are able to be connected and then later the connection is terminated by the peripherals with reason code of 0x13, I wonder what is the reason for that, does change connection parameter help?

    Thank you for your help.

    Ping

     

  • Hello Ping,

    Please take a look into this blog from Nordic which explains about the connection parameters and how to set each one accordingly. You can take a look into this section from the softdevice which explains about setting up interval and window parameters.

    connection is terminated by the peripherals with reason code of 0x13!

    Indicates the remote user terminated the connection for some reason. Are you trying with nRF connect mobile/desktop app if so can you share the connection log to get more idea on the disconnection reason.

    Kind Regards,

    Abhijith

Related