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.

  • Hi Einar, thank you for reply.

    I made a code as you show, but I have a problem now.

    My app does not advertising when i enable the code app_gpiote_user_register().

    Stopping at BKPT 0xAB I checked on Keil debugger then.

    If disable GPIOTE (no use app_gpiote_user_register()), i can see advertising when i call sd_ble_gap_adv_start().

    I dont know what is the cause.

Reply
  • Hi Einar, thank you for reply.

    I made a code as you show, but I have a problem now.

    My app does not advertising when i enable the code app_gpiote_user_register().

    Stopping at BKPT 0xAB I checked on Keil debugger then.

    If disable GPIOTE (no use app_gpiote_user_register()), i can see advertising when i call sd_ble_gap_adv_start().

    I dont know what is the cause.

Children
No Data
Related