How to find out connection interval

6 posts / 0 new
Last post
gcblair
Offline
Last seen:4 years 9 months ago
Master
Joined:2014-09-08 10:21
How to find out connection interval

Hi,

我怎么能找出connection interval is after a connection has been made?

On Android 4.3 I see a big performance difference compared to Android 5.0 when using write with no response.
I would like to see if the connection interval is the reason for this

Thanks

TR_Dialog
Offline
Last seen:1 month 3 weeks ago
Staff
Joined:2014-06-30 23:52
Hi,

Hi,

I can think of two ways to do this:

1) Use a sniffer

2) You set a breakpoint in app_connection_func, and check the argument.

Thanks,

TR_DIALOG

gcblair
Offline
Last seen:4 years 9 months ago
Master
Joined:2014-09-08 10:21
Hi,

Hi,

Thanks! app_connection_func was exactly what I was looking for

mabraun
Offline
Last seen:3年5个月前
Joined:2015-11-16 15:57
Hi,

Hi,

I'm also trying to find out what the connection interval has been set to after a connection has been made. I want to use the breakpoint-solution, but I'm not able to find "app_connection_func". Did that change with SDK5? (I am using SDK5).

Follow-up questions:
- I would also like to find out how many packets will be sent per connection interval. Is there a similar approach?
- I understand that those parameters (connection interval, number of packets per connection invertal) are set by the central device (so in most cases the smartphone). Am I correct in assuming that those parameters are chosen by the OS (i.e. Android/iOS)? So even if I am developing a smartphone app to communicate withmy BLE peripheral, I cannot set those parameters myself, but have to hope that the OS makes a good decision? (I know that the BLE peripheral can suggest connection intervals, but afaik the central device doesn't have to respect those suggestions.)

Thank you!

MT_dialog
Offline
Last seen:1 month 1 week ago
Staff
Joined:2015-06-08 11:34
Hi mabraun,

Hi mabraun,

You can find the connection interval that is suggested by the peripheral in the user_config.h file in the user_gapm_conf struct. To find the function that is called as soon as a connection request is indicated you can follow the registered function at .app_on_connection in the user_app_callbacks struct in the user_callback_config.h file.

The packets that are send during a connection interval is diffent in each device and it depends mostly on the central regardless that the da can send up to 10 packets per connection interval.

Yes the connection parameters are indicated by the device but are being set by the host and eventually by the OS and its up to the OS (android/iOS) if its going to accept or reject those parameters and not the app, but this might change in a linux enviroment.

Thanks MT_dialog

mabraun
Offline
Last seen:3年5个月前
Joined:2015-11-16 15:57
Great, thanks for your help!

Great, thanks for your help!

Topic locked