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

Changing trasmission power with nRF51822 (Bluetooth Smart Beacon Kit)

Hello everybody.

I'm trying to modify the original firmware that comes with the nRF51822 to make it sweep all of the permitted levels of transmission power. I was able to change the default transmission power by calling the function sd_ble_gap_tx_power_set() from within the advertising_start loop.

What I'm trying to do now is force the beacon to sweep trough all of the permitted power levels while in advertising mode. Digging up the code I have found a declaration in beacon.h:

define APP_BEACON_ADV_TIMEOUT 0 /++< Time for which the device must be advertising in non-connectable mode (in seconds). 0 disables timeout */

My idea is to set a certain value for APP_BEACON_ADV_TIMEOUT, and my guess is that an interrupt will be generated when the timer expires and the device stops advertising. I need help intercepting this interrupt.

Thanks.

Parents
  • Hello, thank you for the in-depth reply.

    I followed your instructions, but instead of creating a new function like void adv_timeout_on_ble_evt() as you suggested, I stuffed my code inside the pre-existing on_ble_evt( ), inside the case BLE_GAP_EVT_TIMEOUT. I have set the timeout to 10 seconds, after which advertising_start()is called.

    For the sake of those who might read this in the future, there was a minor mispell in your code, in fact the correct macro is BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT and not BLE_GAP_TIMEOUT_SRC_ADVERTISING.

    Thank you both again for your time and expertise.

  • Yes, for SoftDevice S110 the correct macro is BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT. For SoftDevice S130/S132/S332 the macro is changed to BLE_GAP_TIMEOUT_SRC_ADVERTISING.

Reply Children
No Data
Related