You are here

BLE scan report CYBLE_EVT_HCI_STATUS 12 | Cypress Semiconductor


Summary: 2 Replies, Latest post by forqzy_1626536 on 04 Aug 2016 05:32 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
forqzy_1626536's picture
16 posts

There is a error when I have two Central start at the same time try to scan and connect to two Peripheral.


#1. Two Central device start scan


  if the target mac address arrived then CyBle_GapcStopScan().

#3. After receive CYBLE_EVT_GAPC_SCAN_START_STOP try to connect.

   But if there are two Central, I always get state=scanning, then report HCI_STATUS 12.

Any idea?


Stop Scanning, waiting for Scanning event 
state: scanning


SmartPSoC's picture
Cypress Employee
68 posts

You should get  CYBLE_EVT_GAPC_SCAN_START_STOP with the event data of '0x01'  indicating success, before initiating a connection. This could be the reason for HCI error.


forqzy_1626536's picture
16 posts

Thanks for the reply.

With more investigation in this topic, here is more findings.

#1. When CYBLE_EVT_GAPC_SCAN_START_STOP received the event data is "0x01", then I try to init the connection

  In most situation it will report this HCI error.

#2. This is because the ble state still in CyBle_GetState() == CYBLE_STATE_SCANNING

  If the duplicate filtering is not selected, these scan result event still coming.

#3. So for temp solution, put the connect in the main loop, until the state not in CYBLE_STATE_SCANNING.


So what is the standard procedure for connect a new device?

#1. startscan CyBle_GapcStartScan

#2. processing the scan result CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT

#3. once find the target device, stop scan  CyBle_GapcStopScan

#4. connect when receive the CYBLE_EVT_GAPC_SCAN_START_STOP and event data=0x01?







Log in to post new comments.