To make the scanner module more understandable and more streamlined, I reworked the update mechanism of the scanner. The scanner tracks now the parameters that were used to enable it and the reason why it is running. This facilitates state logic and allows other modules to "start the scanner", altough it is already running. This is mostly a refactoring and not a functional change. Added a test to verify the behavior. Signed-off-by: Jan Müller <jan.mueller@nordicsemi.no> add to task
15 lines
385 B
C
15 lines
385 B
C
/*
|
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/fff.h>
|
|
#include <zephyr/kernel.h>
|
|
|
|
/* List of fakes used by this unit tester */
|
|
#define SCAN_FFF_FAKES_LIST(FAKE) FAKE(bt_le_scan_set_enable)
|
|
|
|
DECLARE_FAKE_VALUE_FUNC(int, bt_le_scan_set_enable, uint8_t);
|
|
DECLARE_FAKE_VALUE_FUNC(bool, bt_le_scan_active_scanner_running);
|