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

Send different advertising data

Hai team,

iam using sdk_12 and ble_app_beacon ,i want to send different advertising packets in one frequency interval. let us consider example : iam using frequency interval 4 and i want to advertise some numbers [0,1,2,3] along with default advertising packets in ble_app_beacon.

i studied about radio notification { ble_radio_notification_init(.....) } and i called this function in main like this[ ble_radio_notification_init(3,NRF_RADIO_NOTIFICATION_DISTANCE_800US, fun);] and whatever i wrote on function is repeating . my question is how can i send the different adverting data ?? which function is used ??

Parents
  • Dear mani,

    Yes, ble_radio_notification library is the best way if you only perform single broadcasting/advertising activity. Your ble_radio_notification_evt_handler function (which for whatever reason you named fun in your example above) will be called before and after each radio event (which typically consists of at least three Tx packets - each on one adv. channel - and can contain also SCAN_REQ/SCAN_RSP exchange if your ADV_xxx packets are scannable). Simply check boolean parameter of the call and act accordingly (if you want to set the data before the event or once it's done). You can typically call any of these functions which influence advertising packets:

    • sd_ble_gap_adv_data_set
    • sd_ble_gap_tx_power_set

    Remember that you cannot call other functions which mess up with Soft Device (stack) state machine so don't even think about advertising start/stop or other things. It also has limitation that you cannot change adv. type, interval, timeout, channel mask (which of 3 adv. channels will be used) or any other parameter which can be only set during start. If you need to change these then you basically need to go with another stack or write your own broadcasting layer and avoid BLE stack completely (this is feasible for GAP Broadcaster only and there are examples in nRF5 SDK).

  • Thanks for information sir. it helps me a lot .

Reply Children
No Data
Related