Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Microphone Control Profile (MICP)

Microphone Control Profile (MICP) More...

Data Structures

struct  bt_micp_mic_dev_register_param
 Register parameters structure for Microphone Control Service. More...
 
struct  bt_micp_included
 Microphone Control Profile included services. More...
 
struct  bt_micp_mic_dev_cb
 Struct to hold the Microphone Device callbacks. More...
 
struct  bt_micp_mic_ctlr_cb
 Struct to hold the Microphone Controller callbacks. More...
 

Macros

#define BT_MICP_MIC_DEV_AICS_CNT   0
 Defines the maximum number of Microphone Control Service instances for the Microphone Control Profile Microphone Device.
 

Functions

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_dev_included_get (struct bt_micp_included *included)
 Get Microphone Device included services.
 
int bt_micp_mic_dev_unmute (void)
 Unmute the Microphone Device.
 
int bt_micp_mic_dev_mute (void)
 Mute the Microphone Device.
 
int bt_micp_mic_dev_mute_disable (void)
 Disable the mute functionality on the Microphone Device.
 
int bt_micp_mic_dev_mute_get (void)
 Read the mute state on 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_conn_get (const struct bt_micp_mic_ctlr *mic_ctlr, struct bt_conn **conn)
 Get the connection pointer of a Microphone Controller instance.
 
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.
 
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_ctlr_unmute (struct bt_micp_mic_ctlr *mic_ctlr)
 Unmute a remote Microphone Device.
 
int bt_micp_mic_ctlr_mute (struct bt_micp_mic_ctlr *mic_ctlr)
 Mute a remote Microphone Device.
 
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_ctlr_cb_register (struct bt_micp_mic_ctlr_cb *cb)
 Registers the callbacks used by Microphone Controller.
 

Application error codes

#define BT_MICP_ERR_MUTE_DISABLED   0x80
 Mute/unmute commands are disabled.
 

Microphone Control Profile mute states

#define BT_MICP_MUTE_UNMUTED   0x00
 The microphone state is unmuted.
 
#define BT_MICP_MUTE_MUTED   0x01
 The microphone state is muted.
 
#define BT_MICP_MUTE_DISABLED   0x02
 The microphone state is disabled and cannot be muted or unmuted.
 

Detailed Description

Microphone Control Profile (MICP)

Since
2.7
Version
0.8.0

Macro Definition Documentation

◆ BT_MICP_ERR_MUTE_DISABLED

#define BT_MICP_ERR_MUTE_DISABLED   0x80

#include <include/zephyr/bluetooth/audio/micp.h>

Mute/unmute commands are disabled.

◆ BT_MICP_MIC_DEV_AICS_CNT

#define BT_MICP_MIC_DEV_AICS_CNT   0

#include <include/zephyr/bluetooth/audio/micp.h>

Defines the maximum number of Microphone Control Service instances for the Microphone Control Profile Microphone Device.

◆ BT_MICP_MUTE_DISABLED

#define BT_MICP_MUTE_DISABLED   0x02

#include <include/zephyr/bluetooth/audio/micp.h>

The microphone state is disabled and cannot be muted or unmuted.

◆ BT_MICP_MUTE_MUTED

#define BT_MICP_MUTE_MUTED   0x01

#include <include/zephyr/bluetooth/audio/micp.h>

The microphone state is muted.

◆ BT_MICP_MUTE_UNMUTED

#define BT_MICP_MUTE_UNMUTED   0x00

#include <include/zephyr/bluetooth/audio/micp.h>

The microphone state is unmuted.

Function Documentation

◆ bt_micp_mic_ctlr_cb_register()

int bt_micp_mic_ctlr_cb_register ( struct bt_micp_mic_ctlr_cb cb)

#include <include/zephyr/bluetooth/audio/micp.h>

Registers the callbacks used by Microphone Controller.

This can only be done as the client.

Parameters
cbThe callback structure.
Returns
0 if success, errno on failure.

◆ bt_micp_mic_ctlr_conn_get()

int bt_micp_mic_ctlr_conn_get ( const struct bt_micp_mic_ctlr *  mic_ctlr,
struct bt_conn **  conn 
)

#include <include/zephyr/bluetooth/audio/micp.h>

Get the connection pointer of a Microphone Controller instance.

Get the Bluetooth connection pointer of a Microphone Controller instance.

Parameters
mic_ctlrMicrophone Controller instance pointer.
connConnection pointer.
Returns
0 if success, errno on failure.

◆ bt_micp_mic_ctlr_discover()

int bt_micp_mic_ctlr_discover ( struct bt_conn *  conn,
struct bt_micp_mic_ctlr **  mic_ctlr 
)

#include <include/zephyr/bluetooth/audio/micp.h>

Discover Microphone Control Service.

This will start a GATT discovery and setup handles and subscriptions. This shall be called once before any other actions can be executed for the peer device, and the bt_micp_mic_ctlr_cb::discover callback will notify when it is possible to start remote operations.

  • Parameters
    connThe connection to initialize the profile for.
    [out]mic_ctlrValid remote instance object on success.
    Returns
    0 on success, GATT error value on fail.

◆ bt_micp_mic_ctlr_get_by_conn()

struct bt_micp_mic_ctlr * bt_micp_mic_ctlr_get_by_conn ( const struct bt_conn *  conn)

#include <include/zephyr/bluetooth/audio/micp.h>

Get the volume controller from a connection pointer.

Get the Volume Control Profile Volume Controller pointer from a connection pointer. Only volume controllers that have been initiated via bt_micp_mic_ctlr_discover() can be retrieved.

Parameters
connConnection pointer.
Return values
Pointerto a Microphone Control Profile Microphone Controller instance
NULLif conn is NULL or if the connection has not done discovery yet

◆ bt_micp_mic_ctlr_included_get()

int bt_micp_mic_ctlr_included_get ( struct bt_micp_mic_ctlr *  mic_ctlr,
struct bt_micp_included included 
)

#include <include/zephyr/bluetooth/audio/micp.h>

Get Microphone Control Profile included services.

Returns a pointer to a struct that contains information about the Microphone Control Profile included services instances, such as pointers to the Audio Input Control Service instances.

Requires that

CONFIG_BT_MICP_MIC_CTLR_AICS 

is enabled.

Parameters
mic_ctlrMicrophone Controller instance pointer.
[out]includedPointer to store the result in.
Returns
0 if success, errno on failure.

◆ bt_micp_mic_ctlr_mute()

int bt_micp_mic_ctlr_mute ( struct bt_micp_mic_ctlr *  mic_ctlr)

#include <include/zephyr/bluetooth/audio/micp.h>

Mute a remote Microphone Device.

Parameters
mic_ctlrMicrophone Controller instance pointer.
Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_ctlr_mute_get()

int bt_micp_mic_ctlr_mute_get ( struct bt_micp_mic_ctlr *  mic_ctlr)

#include <include/zephyr/bluetooth/audio/micp.h>

Read the mute state of a remote Microphone Device.

Parameters
mic_ctlrMicrophone Controller instance pointer.
Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_ctlr_unmute()

int bt_micp_mic_ctlr_unmute ( struct bt_micp_mic_ctlr *  mic_ctlr)

#include <include/zephyr/bluetooth/audio/micp.h>

Unmute a remote Microphone Device.

Parameters
mic_ctlrMicrophone Controller instance pointer.
Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_dev_included_get()

int bt_micp_mic_dev_included_get ( struct bt_micp_included included)

#include <include/zephyr/bluetooth/audio/micp.h>

Get Microphone Device included services.

Returns a pointer to a struct that contains information about the Microphone Device included Audio Input Control Service instances.

Requires that

CONFIG_BT_MICP_MIC_DEV_AICS 

is enabled.

Parameters
includedPointer to store the result in.
Returns
0 if success, errno on failure.

◆ bt_micp_mic_dev_mute()

int bt_micp_mic_dev_mute ( void  )

#include <include/zephyr/bluetooth/audio/micp.h>

Mute the Microphone Device.

Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_dev_mute_disable()

int bt_micp_mic_dev_mute_disable ( void  )

#include <include/zephyr/bluetooth/audio/micp.h>

Disable the mute functionality on the Microphone Device.

Can be reenabled by called bt_micp_mic_dev_mute or bt_micp_mic_dev_unmute.

Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_dev_mute_get()

int bt_micp_mic_dev_mute_get ( void  )

#include <include/zephyr/bluetooth/audio/micp.h>

Read the mute state on the Microphone Device.

Returns
0 on success, GATT error value on fail.

◆ bt_micp_mic_dev_register()

int bt_micp_mic_dev_register ( struct bt_micp_mic_dev_register_param param)

#include <include/zephyr/bluetooth/audio/micp.h>

Initialize the Microphone Control Profile Microphone Device.

This will enable the Microphone Control Service instance and make it discoverable by Microphone Controllers.

Parameters
paramPointer to an initialization structure.
Returns
0 if success, errno on failure.

◆ bt_micp_mic_dev_unmute()

int bt_micp_mic_dev_unmute ( void  )

#include <include/zephyr/bluetooth/audio/micp.h>

Unmute the Microphone Device.

Returns
0 on success, GATT error value on fail.