Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
micp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020-2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_
8#define ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_
9
22#include <stdint.h>
23
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#if defined(CONFIG_BT_MICP_MIC_DEV)
31#define BT_MICP_MIC_DEV_AICS_CNT CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT
32#else
33#define BT_MICP_MIC_DEV_AICS_CNT 0
34#endif /* CONFIG_BT_MICP_MIC_DEV */
35
37#define BT_MICP_ERR_MUTE_DISABLED 0x80
38
40#define BT_MICP_MUTE_UNMUTED 0x00
41#define BT_MICP_MUTE_MUTED 0x01
42#define BT_MICP_MUTE_DISABLED 0x02
43
45struct bt_micp_mic_ctlr;
46
49#if defined(CONFIG_BT_MICP_MIC_DEV_AICS)
52#endif /* CONFIG_BT_MICP_MIC_DEV_AICS */
53
56};
57
70 struct bt_aics **aics;
71};
72
84
98
109 void (*mute)(uint8_t mute);
110};
111
118
125
134
141
155 void (*mute)(struct bt_micp_mic_ctlr *mic_ctlr, int err, uint8_t mute);
156
165 void (*discover)(struct bt_micp_mic_ctlr *mic_ctlr, int err,
166 uint8_t aics_count);
167
174 void (*mute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err);
175
182 void (*unmute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err);
183
184#if defined(CONFIG_BT_MICP_MIC_CTLR_AICS)
186 struct bt_aics_cb aics_cb;
187#endif /* CONFIG_BT_MICP_MIC_CTLR_AICS */
188
190 sys_snode_t _node;
191};
192
207int bt_micp_mic_ctlr_included_get(struct bt_micp_mic_ctlr *mic_ctlr,
208 struct bt_micp_included *included);
209
220int bt_micp_mic_ctlr_conn_get(const struct bt_micp_mic_ctlr *mic_ctlr,
221 struct bt_conn **conn);
222
235struct bt_micp_mic_ctlr *bt_micp_mic_ctlr_get_by_conn(const struct bt_conn *conn);
236
250int bt_micp_mic_ctlr_discover(struct bt_conn *conn,
251 struct bt_micp_mic_ctlr **mic_ctlr);
252
260int bt_micp_mic_ctlr_unmute(struct bt_micp_mic_ctlr *mic_ctlr);
261
269int bt_micp_mic_ctlr_mute(struct bt_micp_mic_ctlr *mic_ctlr);
270
278int bt_micp_mic_ctlr_mute_get(struct bt_micp_mic_ctlr *mic_ctlr);
279
290#ifdef __cplusplus
291}
292#endif
293
298#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MICP_H_ */
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
Definition: micp.h:33
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
Definition: aics.h:256
Structure for initializing a Audio Input Control Service instance.
Definition: aics.h:68
Microphone Control Profile included services.
Definition: micp.h:66
struct bt_aics ** aics
Array of pointers to Audio Input Control Service instances.
Definition: micp.h:70
uint8_t aics_cnt
Number of Audio Input Control Service instances.
Definition: micp.h:68
Definition: micp.h:142
void(* unmute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err)
Callback function for Microphone Control Profile mute/unmute.
Definition: micp.h:182
void(* mute)(struct bt_micp_mic_ctlr *mic_ctlr, int err, uint8_t mute)
Callback function for Microphone Control Profile mute.
Definition: micp.h:155
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:165
void(* mute_written)(struct bt_micp_mic_ctlr *mic_ctlr, int err)
Callback function for Microphone Control Profile mute/unmute.
Definition: micp.h:174
Definition: micp.h:99
void(* mute)(uint8_t mute)
Callback function for Microphone Device mute.
Definition: micp.h:109
Register parameters structure for Microphone Control Service.
Definition: micp.h:48
struct bt_micp_mic_dev_cb * cb
Microphone Control Profile callback structure.
Definition: micp.h:55