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

How to make advertising timeout variable

I want nrf51822 to switch between 2 different advertising timeout. One will set advertising timeout with 20s, another will keep advertising.

Currently, I use following code to set advertising timeout. It can't be changed.

"#define APP_ADV_TIMEOUT_IN_SECONDS 20 "

And I try to change APP_ADV_TIMEOUT_IN_SECONDS with a variable parameter. Like:

"uint32_t APP_ADV_TIMEOUT_IN_SECONDS=20"

But it fails. (Didn't run to main() )

Please help me to solve this problem or any other idea? Thank you.

Parents Reply Children
No Data
Related