Bluetooth: Audio: Rename struct bt_micp and cleanup

Rename struct bt_micp to bt_mic_ctlr as it is only
used ofr microphone controller now.

This also allow cleanup of the bt_micp struct, thus
removing the common internal micp_internal.h header file
and reducing the size of the implementation by not
using a union of the structs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-06-21 19:49:13 +02:00 committed by Carles Cufí
commit 28f6e37ba8
6 changed files with 299 additions and 341 deletions

View file

@ -1,54 +0,0 @@
/*
* Copyright (c) 2020-2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_
#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICP_INTERNAL_
#include <zephyr/types.h>
#include <zephyr/bluetooth/gatt.h>
#if defined(CONFIG_BT_MICP_MIC_DEV)
struct bt_micp_server {
uint8_t mute;
struct bt_micp_mic_dev_cb *cb;
struct bt_gatt_service *service_p;
struct bt_aics *aics_insts[CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT];
};
#endif /* CONFIG_BT_MICP_MIC_DEV */
#if defined(CONFIG_BT_MICP_MIC_CTLR)
struct bt_micp_mic_ctlr {
uint16_t start_handle;
uint16_t end_handle;
uint16_t mute_handle;
struct bt_gatt_subscribe_params mute_sub_params;
struct bt_gatt_discover_params mute_sub_disc_params;
bool busy;
uint8_t mute_val_buf[1]; /* Mute value is a single octet */
struct bt_gatt_write_params write_params;
struct bt_gatt_read_params read_params;
struct bt_gatt_discover_params discover_params;
struct bt_conn *conn;
uint8_t aics_inst_cnt;
struct bt_aics *aics[CONFIG_BT_MICP_MIC_CTLR_MAX_AICS_INST];
};
#endif /* CONFIG_BT_MICP_MIC_CTLR */
/* Struct used as a common type for the api */
struct bt_micp {
bool client_instance;
union {
#if defined(CONFIG_BT_MICP_MIC_DEV)
struct bt_micp_server srv;
#endif /* CONFIG_BT_MICP_MIC_DEV */
#if defined(CONFIG_BT_MICP_MIC_CTLR)
struct bt_micp_mic_ctlr cli;
#endif /* CONFIG_BT_MICP_MIC_CTLR */
};
};
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MICS_INTERNAL_ */