zephyr/tests/bluetooth/host/cs/mocks/conn.c
Ryan Chu c9240cc99f bluetooth: host: Report status of Channel Sounding complete events
If the HCI status of a complete event is not BT_HCI_ERR_SUCCESS,
the remaining parameters could be invalid.

In this case, the params is passed as NULL pointer to the callbacks.
- LE CS Read Remote Supported Capabilities Complete event
- LE CS Read Remote FAE Table Complete event
- LE CS Config Complete event
- LE CS Security Enable Complete event
- LE CS Procedure Enable Complete event

This change avoids forwarding the invalid fileds to the applications.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2025-04-01 16:26:58 +02:00

25 lines
1.1 KiB
C

/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "mocks/conn.h"
#include <zephyr/kernel.h>
DEFINE_FAKE_VOID_FUNC(bt_conn_unref, struct bt_conn *);
DEFINE_FAKE_VALUE_FUNC(struct bt_conn *, bt_conn_lookup_handle, uint16_t, enum bt_conn_type);
DEFINE_FAKE_VOID_FUNC(notify_remote_cs_capabilities, struct bt_conn *,
uint8_t, struct bt_conn_le_cs_capabilities *);
DEFINE_FAKE_VOID_FUNC(notify_remote_cs_fae_table, struct bt_conn *,
uint8_t, struct bt_conn_le_cs_fae_table *);
DEFINE_FAKE_VOID_FUNC(notify_cs_config_created, struct bt_conn *,
uint8_t, struct bt_conn_le_cs_config *);
DEFINE_FAKE_VOID_FUNC(notify_cs_config_removed, struct bt_conn *, uint8_t);
DEFINE_FAKE_VOID_FUNC(notify_cs_subevent_result, struct bt_conn *,
struct bt_conn_le_cs_subevent_result *);
DEFINE_FAKE_VOID_FUNC(notify_cs_security_enable_available, struct bt_conn *, uint8_t);
DEFINE_FAKE_VOID_FUNC(notify_cs_procedure_enable_available, struct bt_conn *,
uint8_t, struct bt_conn_le_cs_procedure_enable_complete *);