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

HID advertise, Beacon advertise and scanner program at the same time

Hello,

I am using following component for my project, 1-nrf51822,2-SDK 11 3-S130, 4-BLE400 board, 5-Keil IDE. I am also using SDK 11.x HID example for my base program. My goal is to have a constant beacon (always ON), so I have used advertiser_beacon_timeslot.c with no issue. So basically, my program advertises HID service, in addition to beacon data, after connection and pairing, the beacon data still is on. After disconnect from HID service the beacon still is on. Also part of my requirement is to have a scanner program always ON as well, to detect other beacon data broadcast. So I decided to use scanner_beacon_timeslot.c program. When I add scanner, everything is failing, no more beacon or HID advertising. I was hoping that I can time slot 3 data in nrf51822, HID advertise, beacon data and scanner code. Is this doable? Can I time slot all 3 in nrf51822, S130?

here is part of my code:

gap_params_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();

beacon_adv_init();
scanner_init();

// Start execution.
timers_start();
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);

beacon_start();
scanner_start();

if I comment out scanner_start(), everything works OK,

Thanks in advance

Parents
  • It seems to me you can use the SoftDevice to do all this, and not use the timeslot. It doesn't alternate between HID and beacon advertisements automatically, but should be pretty easy to switch between them with a timer. Anyways, both ways works I guess.

    But are you sure you need to scan in the timeslot? Can't you just scan with the SoftDevice?

    If you must scan in timeslot, it is very difficult to say what isn't working here. Have you tried to debug? Are you getting any errors? See this for more information.

Reply
  • It seems to me you can use the SoftDevice to do all this, and not use the timeslot. It doesn't alternate between HID and beacon advertisements automatically, but should be pretty easy to switch between them with a timer. Anyways, both ways works I guess.

    But are you sure you need to scan in the timeslot? Can't you just scan with the SoftDevice?

    If you must scan in timeslot, it is very difficult to say what isn't working here. Have you tried to debug? Are you getting any errors? See this for more information.

Children
No Data
Related