This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

broadcast only when i want to inform nortification

Hi, all.

I'd like to broadcast only when i want to inform nortification.

flow like

  1. No advertising when application start.

  2. Check the events that there has been rising event of a pin. (use GPIOTE)

  3. If Yes, Start advertising.

  4. Stop advertising in 1sec. Repeat from 2.

Is it possible to use GPIOTE events even when not advertising? Or is there something better way?


nrf51822, SDK8.0, s110 using "ble_app_beacon" sample code.

Best Regards,

Parents
  • This should be straightforward. You can call sd_ble_gap_adv_start() to start advertising when the event that should trigger it occurs (a pin change using GPIOTE in your case). Then you can use a timer (I suggest that you use the application timer), and call sd_ble_gap_adv_stop() when the timer times out.

  • The BKPT instruction represents a breakpoint, so I guess it is you that halted the execution by setting a breakpoint? Anyway it is difficult to guess anything about your implementation without more details. It may be a good idea to do things in steps, so that you know how to advertise, use timers and use GPIOTE separately. Then combining it should be straightforward.

Reply
  • The BKPT instruction represents a breakpoint, so I guess it is you that halted the execution by setting a breakpoint? Anyway it is difficult to guess anything about your implementation without more details. It may be a good idea to do things in steps, so that you know how to advertise, use timers and use GPIOTE separately. Then combining it should be straightforward.

Children
No Data
Related