You are here

Trying to read beacons and also broadcast, but no dual Broadcaster/Observer? | Cypress Semiconductor

Trying to read beacons and also broadcast, but no dual Broadcaster/Observer?

Summary: 1 Reply, Latest post by Anjana Muralidharan on 08 Nov 2016 03:23 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
cypress_2027771's picture
User
1 post

Hi all,

     I'm trying to use a PSoC 4 BLE module from the CY8CKIT-042-BLE-A (CY8C4248LQI-BL583) to read the signal strength of two non-connectable Bluetooth beacons which operate at 10Hz. I then want to do some on-device calculations, and send out a vector based on the signal strengths to another PSoC 4 module. 

 

     However, I can't figure out how to set up the Bluetooth so that it can both read advertisements and write them. I've tried numerous sample projects from the "100 Projects in 100 Days" put out by Cypress. For the "Day 10: Observer" project, it will read the beacons, but when I try to switch the GAP to anything but "Observer",  it stops working. There is no option for "Broadcaster and Observer" like there is for "Central and Peripheral". I have read that Central and Peripheral should have all the API's enabled, but that doesn't seem to be the case because it breaks the functionality of this code.

 

Additionally, "Day 11: Central and Observer" seems like it would be exactly what I need, but it won't read the beacons because they're non-connectable, and I don't understand what I need to change to get it to read them. 

 

Does anyone have any advice on how I can both read from non-connectable beacons and then re-broadcast an advertisement of my own? (it doesn't need to be connectable)

Anjana Muralidharan's picture
Cypress Employee
62 posts

Hi,

Yes, it is possible to do both broadcaster and observer at the same time. In the BLE component, You can put the device in to Central and Peripheral GAP role 

Broadcaster settings to be noted: Make the advertisement settings as : Discovery mode: Non discoverable Advertising: Non connectable undirected advertising

Observer settings to be noted: To make the central in observer mode, add the below code in the CYBLE_EVT_STACK_ON event. cyBle_discoveryInfo.discProcedure=CYBLE_GAPC_OBSER_PROCEDURE; (for making observation procedure) After this call start scan API. Call start advertising API also in stack on. Now the device will act both as broadcaster and observer.
 

Thanks,

Anjana

Log in to post new comments.