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

pc_ble_driver_py takes a lot of time to discover services, characteristics, and descriptors

Hi everyone.

I'm using pc_ble_driver_py with nRF52840 USB dongle with burned connectivity_4.1.1_usb_with_s140_6.1.1.hex.

pc_ble_driver_py is modified by me to support BLE5.0 features.

It looks like everything works well, but timings spent on the discovering services, characteristics, and descriptors are too long (up to 25-30 seconds) and depend on PC used.

I have localized the place where most of the time spent, it is between sending the command via UART (ASIO library) to BLE dongle and waiting for the response.

I was trying to decrease connection interval, but discovery timings stay the same.

Also, I have tried to use pc_ble_driver DLL in bare C, but here timings are well.

Does this issue is known? Or do you have any suggestions on how to decrease discovery timings?

Thanks.

Parents
  • Hi,

    It is difficult to say what could cause the delay(s) without knowing more. Do you have a log or similar showing the flow that you can upload here together with your code? A sniffer trace could also be useful so that we can see what happens on air.

  • This is part of the combined log (python and DLL).

    [15815861981530002]			ADAPTER:		Start discriptor_discovery
    [15815861981530002]				DRIVER:		ble_gattc_desc_disc
    [15815861981530002]					SWIG DLL:		sd_ble_gattc_descriptors_discover
    [15815861981535250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler enter function
    [15815861981535250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite IN
    [15815861981535250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite OUT
    [15815861981535250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler enter function
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler enter function
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler asyncRead IN
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler asyncRead OUT
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler exit function
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler enter function
    [15815861981555619]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite IN
    [15815861981565250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite OUT
    [15815861981565250]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler enter function
    [15815861983924951]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler enter function
    [15815861983924951]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler asyncRead IN
    [15815861983929171]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler asyncRead OUT
    [15815861983929171]						DLL:	..\src\common\transport\uart_transport.cpp	readHandler exit function
    [15815861983929171]						DLL:    ..\src\common\transport\uart_transport.cpp  writeHandler enter function
    [15815861983920000]				DRIVER:		ble_event_handler BLEEvtID.gattc_evt_desc_disc_rsp
    [15815861983929171]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite IN
    [15815861983934942]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler asyncWrite OUT
    [15815861983929998]				DRIVER:		gattc_evt_desc_disc_rsp
    [15815861983934942]						DLL:	..\src\common\transport\uart_transport.cpp	writeHandler enter function
    [15815861984270000]			ADAPTER:		End discriptor_discovery

  • Timestamp here is in 0.0000 ms: 15815861981565250 -> 1581586198156,5250 ms

    Please take a look at the lines 15 and 16 (writeHandler enter function and readHandler enter function) this part is the most time-consuming.

Reply Children
No Data
Related