I am declaring the variable in one of the hardware drivers files that are provided by the nordic semiconductor. The variable is not static. The variable inside the function changes its value automatically from zero to one as soon as it enters into the BLE_scan method function. I am not able to understand the reason why the value itself getting updated.