You need to run the device in central/client mode and excute the scan procedure.
In the scan result event(CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT), you can find the peer BD_ADDR and RSSI in structure cy_stc_ble_gapc_adv_report_param_t as follows:
/** Advertisement report parameter */
/** Advertisement event type
- Connectable undirected advertising = 0x00
- Connectable directed advertising = 0x01
- Scannable undirected advertising = 0x02
- Non connectable undirected advertising = 0x03
- Scan Response = 0x04
/** BD address type of the device advertising.
/** Public Device Address or Random Device Address for
each device that responded to scanning. */
/** length of the data for each device that responded to scanning */
/** Pointer to advertising or scan response data */
/** Rssi of the responding device.
* Range: -85 <= N <= 0
* Units: dBm */
I've created a Scanner project you might be interested in. It's designed to scan for ANY BLE advertisement packets and will display the information found in the packets including RSSI received.
If interested you will find it here: PSoC6 BLE Beacon and Scanner Projects Available in Code Sharing Forum
I Configured the bluetooth as central and in the main file I called the function :
and I can't even trigger the events:
void StackEventHandler(uint32 event, void* eventParam)
the event CY_BLE_EVT_GATT_CONNECT_IND is working so I assume that the problem is not the event handler
this are the BLE parameters:
what could be the problem?
When you are using your PSoC6 in "Broadcast Role (Beacon)" the SW normally starts off as ADVERT=OFF (Advertisement OFF). To turn on advertisement, select 'a' in the menu commands.
Once the advertisement is ON, you should see "NameMe" appear in the CYSMART app. Note: This is not a connectable service by design since it is only a Advertiser.
When you are using your PSoC6 in "Observer Role (Scanner)" the SW normally starts off as SCAN=OFF (Scanning OFF). To turn on scanning, select 's' in the menu commands. This will start the scanning looking for ALL advertisement packets.
If you want a fuller description of the contents of the advertisement packets seen, type 's'.
There are ways to filter the advertisement packets for
- Manufacturer ID
- Local ID
This will focus on the advertisements of interest.