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: 4 Replies, Latest post by Dheeraj Dake on 24 May 2017 12:59 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
cypress_2027771's picture
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
131 posts


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.



Dheeraj Dake's picture
72 posts

I am trying to get the broadcaster and observer work at the same time. I made the changes you suggested but it doesn't work. You said to add code for scanning and advertising under CYBLE_EVT_STACK_ON case correct?

I did that and it didn't work. I then moved it under CYBLE_EVT_GAP_DEVICE_DISCONNECTED. It didn't work but when I commented out CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) API, the observer code worked and when I commented out the observer code the broadcaster code worked. But I couldn't get both to work at the same time. 

I have attached my project. See lines 90-94 in main.c

e.pratt_1639216's picture
481 posts

You can only dynamically update the advertisement packet when the BLESS state returns CYBLE_BLESS_STATE_EVENT_CLOSE, that could be the cause of not being able to both broadcast and observe simultaneously.

Dheeraj Dake's picture
72 posts

Hello Pratt, 
I modified dynamicAdvPayloadUpdate() to


in the project attached to my previous comment. It's still the same. Broadcast and observe doesn't work simultaneously. 

Log in to post new comments.