1 Reply Latest reply on Aug 2, 2018 2:24 AM by sxsi

    Is there a way to enable/disable BLE connectivity dynamically?

    sean.mahnken_1944716

      We have a project where we'd like our BLE advertising device to only be connectable under certain circumstances (i.e. external stimuli).  Something along the lines of "push this button, and the device will be connectable for 30 seconds" would be perfect.  I'm sure there's an example of this someplace, but I'm having a difficult time identifying it.  Could anyone point me towards one?

        • 1. Re: Is there a way to enable/disable BLE connectivity dynamically?
          sxsi

          Hi,

           

          To make the peripheral device advertise for 30sec, you can change the timeout value in the BLE component customiser to 30 secs. Initially, the device will be in disconnected state. On switch press, an interrupt will be triggered which will make the peripheral device start connectable advertisement for 30 secs. If the device is in connected state and switch is pressed, then the device will be disconnected first and then start connectable advertisement again for 30 secs.

           

          I am attaching the project for your reference.

           

          -Sayani.