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

Why UART still undergoes connection after setting to scannable/non-connectable state

Hi so I ran this example:

https://devzone.nordicsemi.com/f/nordic-q-a/40476/unable-to-convert-to-long-range-after-looking-at-umpteen-examples--/157426#157426 

When I went to ble_advertising.c file and searched for ble_advertising_init

Under the line 502 and made edits to ensure it looks like this. (see below for photo)

p_advertising->adv_params.primary_phy = BLE_GAP_PHY_CODED;

p_advertising->adv_params.secondary_phy = BLE_GAP_PHY_CODED;

p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; //by right this means the advertising packet is advertising but connection does not occur, however despite changing this to a nonconnectable/scannable state, the central and peripheral still connects

I do not why it still connects even after setting it to p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED;

  • Hi.

     

    p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; //by right this means the advertising packet is advertising but connection does not occur, however despite changing this to a nonconnectable/scannable state, the central and peripheral still connects

     Strange. Is the Connected event generated in the ble handler? How do you verify that it actually connects?

    regards

    Jared 

  • The debug terminal & Putty terminal just prints something along the line of "UART connected". I think a good verification that it was connected was that I was able to send messages using Putty from peripheral to central, vice versa.

  • Hi,

    Sorry for the late reply, I was Out of Office.

    Regarding your question, the parameters set in the advertising_init.c is just initial default parameters used as a starting point. The parameters will be changed accordingly to what is set in the main file when starting the advertisement. Meaning if you want to change the advertisement type then do it before you call the ble_advertising_init() and the change will take effect right before you start advertising.

    regards

    Jared 

Related