zephyr/tests/bluetooth/controller/mock_ctrl/src/ull_scan.c
Carles Cufi 22f73992b2 Bluetooth: Rework the HCI header set
In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:

- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h

Fixes #58214.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-06-12 06:20:24 -04:00

93 lines
1.6 KiB
C

/*
* Copyright (c) 2016 Nordic Semiconductor ASA
* Copyright (c) 2016 Vinayak Kariappa Chettimada
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/types.h>
#include <zephyr/ztest.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/mem.h"
#include "util/memq.h"
#include "pdu_df.h"
#include "lll/pdu_vendor.h"
#include "pdu.h"
#include "lll.h"
#include "lll_scan.h"
#include "ull_scan_types.h"
#include "ull_scan_internal.h"
#define BT_CTLR_SCAN_MAX 1
static struct ll_scan_set ll_scan[BT_CTLR_SCAN_MAX];
uint8_t ll_scan_params_set(uint8_t type, uint16_t interval, uint16_t window, uint8_t own_addr_type,
uint8_t filter_policy)
{
struct ll_scan_set *scan;
scan = ull_scan_is_disabled_get(0);
if (!scan) {
return BT_HCI_ERR_CMD_DISALLOWED;
}
scan->own_addr_type = own_addr_type;
return 0;
}
struct ll_scan_set *ull_scan_set_get(uint8_t handle)
{
if (handle >= BT_CTLR_SCAN_MAX) {
return NULL;
}
return &ll_scan[handle];
}
struct ll_scan_set *ull_scan_is_enabled_get(uint8_t handle)
{
struct ll_scan_set *scan;
scan = ull_scan_set_get(handle);
if (!scan || !scan->is_enabled) {
return NULL;
}
return scan;
}
struct ll_scan_set *ull_scan_is_disabled_get(uint8_t handle)
{
struct ll_scan_set *scan;
scan = ull_scan_set_get(handle);
if (!scan || scan->is_enabled) {
return NULL;
}
return scan;
}
uint8_t ull_scan_enable(struct ll_scan_set *scan)
{
return 0;
}
uint32_t ull_scan_params_set(struct lll_scan *lll, uint8_t type,
uint16_t interval, uint16_t window,
uint8_t filter_policy)
{
return 0;
}
uint8_t ull_scan_disable(uint8_t handle, struct ll_scan_set *scan)
{
return 0;
}