Broadcast Advertising While in a Connection?

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

cross mob
PaDo_1228851
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

After connecting a peripheral to a central I want the peripheral to continue advertising in non-connectable mode while still maintaining the connection with the one central.  My strategy thus far has been to change the advertising type to broadcast and starting advertising again after the stack sends a connected message.  My code for the event handler is below.  The program compiles and does not crash.  But once in connection with my smart phone (the central) I don't see any advertising on my pc running CySmart1.1.  When I break the connection with the central the peripheral starts advertising again just fine in connectable mode.  Any ideas how to accomplish this?

   

void eventHandler( uint32 eventCode, void *eventParam )

   

{

   

switch( eventCode )

   

{

   

case CYBLE_EVT_STACK_ON:

   

case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:

   

cyBle_discoveryModeInfo.discMode = CYBLE_GAPP_GEN_DISC_MODE;

   

CyBle_GappStartAdvertisement( CYBLE_ADVERTISING_FAST );

   

case CYBLE_EVT_GAP_DEVICE_CONNECTED:

   

cyBle_discoveryModeInfo.discMode = CYBLE_GAPP_NONE_DISC_BROADCAST_MODE;

   

CyBle_GappStartAdvertisement( CYBLE_ADVERTISING_FAST );

   

}

   

}

   

Thanks

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

Can you please have a look at the below project:

   

Project #007: BLE Peripheral and Broadcaster - Changing GAP Roles

   

http://www.cypress.com/blog/100-projects-100-days/project-007-ble-peripheral-and-broadcaster-changin...

   

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

Can you please have a look at the below project:

   

Project #007: BLE Peripheral and Broadcaster - Changing GAP Roles

   

http://www.cypress.com/blog/100-projects-100-days/project-007-ble-peripheral-and-broadcaster-changin...

   

0 Likes