Skip to main content
WRosé.1
Associate II
September 18, 2022
Solved

Ble application gets stuck when terminating scanning

I have a program that builds upon the p2p example.

The scanner starts when I press a button with

aci_gap_start_general_connection_establish_proc(HCI_SCAN_TYPE_ACTIVE, LE_Scan_Interval, LE_Scan_Window, PUBLIC_ADDR,0x00, 0);

If the button is held for 5 seconds after that I want to stop scanning

aci_gap_terminate_gap_proc(GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC)

But I will never get out of this function. It stops in

hci_cmd_resp_wait(HCI_TL_DEFAULT_TIMEOUT);

the termination will work when it is called from a

HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE callback.

Anyone has any clue of why this is?

This topic has been closed for replies.
WRosé.1
WRosé.1Best answer
Associate II
September 18, 2022

Solved: By issuing the commands directly on preess and not scheduling them they broke the stack.

2 replies

WRosé.1
WRosé.1Author
Associate II
September 18, 2022

And im doing it on the wb15 nucleo

WRosé.1
WRosé.1AuthorBest answer
Associate II
September 18, 2022

Solved: By issuing the commands directly on preess and not scheduling them they broke the stack.