Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
micp.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2020-2024 Nordic Semiconductor ASA
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11
12#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_
13#define ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_
14
27#include <stdint.h>
28
31#include <zephyr/sys/slist.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
41#if defined(CONFIG_BT_MICP_MIC_DEV)
42#define BT_MICP_MIC_DEV_AICS_CNT CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT
43#else
44#define BT_MICP_MIC_DEV_AICS_CNT 0
45#endif /* CONFIG_BT_MICP_MIC_DEV */
46
52#define BT_MICP_ERR_MUTE_DISABLED 0x80
60#define BT_MICP_MUTE_UNMUTED 0x00
62#define BT_MICP_MUTE_MUTED 0x01
64#define BT_MICP_MUTE_DISABLED 0x02
68struct bt_micp_mic_ctlr;
69
72#if defined(CONFIG_BT_MICP_MIC_DEV_AICS) || defined(__DOXYGEN__)
75#endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
76
79};
80
93 struct bt_aics **aics;
94};
95
107
121
137 void (*mute)(uint8_t mute);
138};
139
146
153
162
169
188 void (*mute)(struct bt_micp_mic_ctlr *mic_ctlr, int err, uint8_t mute);
189
198 void (*discover)(struct bt_micp_mic_ctlr *mic_ctlr, int err,
199 uint8_t aics_count);
200
207 void (*mute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err);
208
215 void (*unmute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err);
216
217#if defined(CONFIG_BT_MICP_MIC_CTLR_AICS)
219 struct bt_aics_cb aics_cb;
220#endif /* CONFIG_BT_MICP_MIC_CTLR_AICS */
221
223 sys_snode_t _node;
224};
225
240int bt_micp_mic_ctlr_included_get(struct bt_micp_mic_ctlr *mic_ctlr,
241 struct bt_micp_included *included);
242
253int bt_micp_mic_ctlr_conn_get(const struct bt_micp_mic_ctlr *mic_ctlr,
254 struct bt_conn **conn);
255
268struct bt_micp_mic_ctlr *bt_micp_mic_ctlr_get_by_conn(const struct bt_conn *conn);
269
283int bt_micp_mic_ctlr_discover(struct bt_conn *conn,
284 struct bt_micp_mic_ctlr **mic_ctlr);
285
293int bt_micp_mic_ctlr_unmute(struct bt_micp_mic_ctlr *mic_ctlr);
294
302int bt_micp_mic_ctlr_mute(struct bt_micp_mic_ctlr *mic_ctlr);
303
311int bt_micp_mic_ctlr_mute_get(struct bt_micp_mic_ctlr *mic_ctlr);
312
323#ifdef __cplusplus
324}
325#endif
326
331#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_ */
Bluetooth Audio Input Control Service APIs.
Bluetooth connection handling.
int bt_micp_mic_dev_included_get(struct bt_micp_included *included)
Get Microphone Device included services.
int bt_micp_mic_ctlr_cb_register(struct bt_micp_mic_ctlr_cb *cb)
Registers the callbacks used by Microphone Controller.
int bt_micp_mic_dev_unmute(void)
Unmute the Microphone Device.
int bt_micp_mic_ctlr_included_get(struct bt_micp_mic_ctlr *mic_ctlr, struct bt_micp_included *included)
Get Microphone Control Profile included services.
int bt_micp_mic_ctlr_discover(struct bt_conn *conn, struct bt_micp_mic_ctlr **mic_ctlr)
Discover Microphone Control Service.
int bt_micp_mic_dev_mute_get(void)
Read the mute state on the Microphone Device.
int bt_micp_mic_ctlr_mute(struct bt_micp_mic_ctlr *mic_ctlr)
Mute a remote Microphone Device.
#define BT_MICP_MIC_DEV_AICS_CNT
Defines the maximum number of Microphone Control Service instances for the Microphone Control Profile...
Definition micp.h:44
int bt_micp_mic_dev_mute(void)
Mute the Microphone Device.
int bt_micp_mic_ctlr_conn_get(const struct bt_micp_mic_ctlr *mic_ctlr, struct bt_conn **conn)
Get the connection pointer of a Microphone Controller instance.
int bt_micp_mic_ctlr_mute_get(struct bt_micp_mic_ctlr *mic_ctlr)
Read the mute state of a remote Microphone Device.
int bt_micp_mic_dev_mute_disable(void)
Disable the mute functionality on the Microphone Device.
int bt_micp_mic_dev_register(struct bt_micp_mic_dev_register_param *param)
Initialize the Microphone Control Profile Microphone Device.
int bt_micp_mic_ctlr_unmute(struct bt_micp_mic_ctlr *mic_ctlr)
Unmute a remote Microphone Device.
struct bt_micp_mic_ctlr * bt_micp_mic_ctlr_get_by_conn(const struct bt_conn *conn)
Get the volume controller from a connection pointer.
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Struct to hold callbacks for the Audio Input Control Service.
Definition aics.h:327
Structure for initializing a Audio Input Control Service instance.
Definition aics.h:132
Microphone Control Profile included services.
Definition micp.h:89
struct bt_aics ** aics
Array of pointers to Audio Input Control Service instances.
Definition micp.h:93
uint8_t aics_cnt
Number of Audio Input Control Service instances.
Definition micp.h:91
Struct to hold the Microphone Controller callbacks.
Definition micp.h:175
void(* unmute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err)
Callback function for Microphone Control Profile mute/unmute.
Definition micp.h:215
void(* mute)(struct bt_micp_mic_ctlr *mic_ctlr, int err, uint8_t mute)
Callback function for Microphone Control Profile mute.
Definition micp.h:188
void(* discover)(struct bt_micp_mic_ctlr *mic_ctlr, int err, uint8_t aics_count)
Callback function for bt_micp_mic_ctlr_discover().
Definition micp.h:198
void(* mute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err)
Callback function for Microphone Control Profile mute/unmute.
Definition micp.h:207
Struct to hold the Microphone Device callbacks.
Definition micp.h:127
void(* mute)(uint8_t mute)
Callback function for Microphone Device mute.
Definition micp.h:137
Register parameters structure for Microphone Control Service.
Definition micp.h:71
struct bt_aics_register_param aics_param[0]
Register parameter structure for Audio Input Control Services.
Definition micp.h:74
struct bt_micp_mic_dev_cb * cb
Microphone Control Profile callback structure.
Definition micp.h:78