How do put the CYBLE-012011 module in broadcaster and observer at the same time?

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

cross mob
DhDa_2432241
Level 5
Level 5
5 likes given First like received First like given

Hello,
I have CYBLE-012011 evaluation board and I want my BLE chip to perform the role of broadcaster and receiver at the same time. When the BLE starts, it will be in observer mode(continuously scanning). Now the BLE chip receive data over the UART and then upon receiving the data it should send the data as a beacon. 

I was able to set my BLE chip in broadcaster or receiver mode. But I was unable to do both at the same time. I followed instructions from this previous forum comment, but it didn't work. I have attached my project in the attachments.

   

Thanks
Dheeraj

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

Hi Dheeraj,

   

Attached is an example project for acting as Broadcaster and Observer at the same time.

   

Logic:

   

It is possible to do both broadcaster and observer at the same time.

   

In the BLE component, 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;

   

After this, call start scan API.

   

Call start advertising API also in stack on. Now the device will act both as broadcaster and observer.

   

 

   

Please go though it. You can adapt the logic for your application.

   

Thanks & Regards,
Anjana

View solution in original post

0 Likes
2 Replies
AnjanaM_61
Moderator
Moderator
Moderator
10 questions asked 5 comments on KBA First comment on KBA

Hi Dheeraj,

   

Attached is an example project for acting as Broadcaster and Observer at the same time.

   

Logic:

   

It is possible to do both broadcaster and observer at the same time.

   

In the BLE component, 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;

   

After this, call start scan API.

   

Call start advertising API also in stack on. Now the device will act both as broadcaster and observer.

   

 

   

Please go though it. You can adapt the logic for your application.

   

Thanks & Regards,
Anjana

0 Likes

Hello Anjana,
This is perfect. I was using CyBle_GapcStartScan(CYBLE_SCANNING_SLOW) instead of CyBle_GapcStartDiscovery(&cyBle_discoveryInfo). Now I was able to send a beacon as well as scan other devices.

Thank you
Dheeraj

0 Likes