This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to implement gatts characteristic broadcast?

Hi,

I try to make characteristic broadcasting through advertisement data packets.

Added these codes below, but no yet work. Is there any example for this work ?

    char_md.char_props.broadcast = 1;
   ........
    sd_ble_gatts_characteristic_add();

Thanks!

Parents
  • Hi Yelun,

    broadcasting service data needs to be done manually by the app, by placing the data in the advertising packets.

    char_md.char_props.broadcast = 1;
    

    that bit is just to let the peer write to it to enable and disable that advertising it's like notifications. The peer can enable and disable them, but once enabled the app still needs to call sd_ble_gatts_hvx() it's not done automatically by the stack.

Reply
  • Hi Yelun,

    broadcasting service data needs to be done manually by the app, by placing the data in the advertising packets.

    char_md.char_props.broadcast = 1;
    

    that bit is just to let the peer write to it to enable and disable that advertising it's like notifications. The peer can enable and disable them, but once enabled the app still needs to call sd_ble_gatts_hvx() it's not done automatically by the stack.

Children
Related