scan and advertising

Hello,

I'm using nRF52833, pca10100..

My project combines the functions of scan and advertising.
Each UUID is different and they pair with a different device.

I initialize to use scan and advertising,

For advertising, I initialize under function, and then
gap_params_init();
services_init();
advertising_init();
conn_params_init();

I initialize under function for scan.
db_discovery_init();
lbs_c_init();
scan_init();

When scanning, it was not paired with other peripheral devices..

But I change the order
After initializing the scan function, I initialize the advertising function.
And then it was connected with peripheral.

For what reason did it connected?
At first, before changing the order, I do comment 'service_init' function and it connected, so what part of the function is the problem?
BR,
lyrics
Parents
  • Hi

    What kind of devices are these peripherals you're trying to connect to? I don't think it is because you initialize advertising that your scanning device is able to connect to them, but rather that you don't tell the device to connect to anything before you call the app_server_init() function. It's hard to say without seeing what any of these functions actually do, but that's my initial guess at least. 

    Best regards,

    Simon

Reply
  • Hi

    What kind of devices are these peripherals you're trying to connect to? I don't think it is because you initialize advertising that your scanning device is able to connect to them, but rather that you don't tell the device to connect to anything before you call the app_server_init() function. It's hard to say without seeing what any of these functions actually do, but that's my initial guess at least. 

    Best regards,

    Simon

Children
Related