Simultaneously advertise and scan

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
japac_1817436
Level 1
Level 1

I would like to simultaneously broadcast advertisement packets while scanning for broadcast messages from other devices.

   

The following threads seem to indicate that this is possible, however I am not sure how to program this behavior.

   

http://www.cypress.com/forum/psoc-4-ble/scanadvertise-vs-connectedbroadcasting

   

http://www.cypress.com/forum/psoc-4-ble/gap-profiles-broadcast-observer

   

Could anyone point me in the direction or provide some example code?

   

Specifically, I would like to broadcast data that includes dynamically updated user-specific data while scanning for advertisement packets from other devices (which implement the exact same broadcast+observer behavior).

   

My target device is CYBLE-212019-00.

   

Thanks,

   

Jaemann

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Jaemann,

   


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
 

View solution in original post

0 Likes
1 Reply
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Jaemann,

   


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
 

0 Likes