cancel
Showing results for 
Search instead for 
Did you mean: 

Ble application gets stuck when terminating scanning

WRosé.1
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
WRosé.1
Associate II

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

View solution in original post

2 REPLIES 2
WRosé.1
Associate II

And im doing it on the wb15 nucleo

WRosé.1
Associate II

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