- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you please have a look at the below project:
Project #007: BLE Peripheral and Broadcaster - Changing GAP Roles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you please have a look at the below project:
Project #007: BLE Peripheral and Broadcaster - Changing GAP Roles