1 Reply Latest reply on Oct 19, 2015 12:19 AM by bmah

    Broadcast Advertising While in a Connection?

    user_450135171

      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