Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Microphone Input Control Service (Microphone Input Control Service) More...
Data Structures | |
struct | bt_mics_register_param |
Register parameters structure for Microphone Input Control Service. More... | |
struct | bt_mics_included |
Microphone Input Control Service included services. More... | |
struct | bt_mics_cb |
Macros | |
#define | BT_MICS_AICS_CNT 0 |
#define | BT_MICS_ERR_MUTE_DISABLED 0x80 |
#define | BT_MICS_ERR_VAL_OUT_OF_RANGE 0x81 |
#define | BT_MICS_MUTE_UNMUTED 0x00 |
#define | BT_MICS_MUTE_MUTED 0x01 |
#define | BT_MICS_MUTE_DISABLED 0x02 |
Typedefs | |
typedef void(* | bt_mics_discover_cb) (struct bt_mics *mics, int err, uint8_t aics_count) |
Callback function for bt_mics_discover. More... | |
typedef void(* | bt_mics_mute_read_cb) (struct bt_mics *mics, int err, uint8_t mute) |
Callback function for Microphone Input Control Service mute. More... | |
typedef void(* | bt_mics_mute_write_cb) (struct bt_mics *mics, int err) |
Callback function for Microphone Input Control Service mute/unmute. More... | |
Functions | |
int | bt_mics_register (struct bt_mics_register_param *param, struct bt_mics **mics) |
Initialize the Microphone Input Control Service. More... | |
int | bt_mics_included_get (struct bt_mics *mics, struct bt_mics_included *included) |
Get Microphone Input Control Service included services. More... | |
int | bt_mics_client_conn_get (const struct bt_mics *mics, struct bt_conn **conn) |
Get the connection pointer of a client instance. More... | |
int | bt_mics_discover (struct bt_conn *conn, struct bt_mics **mics) |
Discover Microphone Input Control Service. More... | |
int | bt_mics_unmute (struct bt_mics *mics) |
Unmute the server. More... | |
int | bt_mics_mute (struct bt_mics *mics) |
Mute the server. More... | |
int | bt_mics_mute_disable (struct bt_mics *mics) |
Disable the mute functionality. More... | |
int | bt_mics_mute_get (struct bt_mics *mics) |
Read the mute state of a Microphone Input Control Service. More... | |
int | bt_mics_aics_state_get (struct bt_mics *mics, struct bt_aics *inst) |
Read the Audio Input Control Service input state. More... | |
int | bt_mics_aics_gain_setting_get (struct bt_mics *mics, struct bt_aics *inst) |
Read the Audio Input Control Service gain settings. More... | |
int | bt_mics_aics_type_get (struct bt_mics *mics, struct bt_aics *inst) |
Read the Audio Input Control Service input type. More... | |
int | bt_mics_aics_status_get (struct bt_mics *mics, struct bt_aics *inst) |
Read the Audio Input Control Service input status. More... | |
int | bt_mics_aics_unmute (struct bt_mics *mics, struct bt_aics *inst) |
Unmute the Audio Input Control Service input. More... | |
int | bt_mics_aics_mute (struct bt_mics *mics, struct bt_aics *inst) |
Mute the Audio Input Control Service input. More... | |
int | bt_mics_aics_manual_gain_set (struct bt_mics *mics, struct bt_aics *inst) |
Set Audio Input Control Service gain mode to manual. More... | |
int | bt_mics_aics_automatic_gain_set (struct bt_mics *mics, struct bt_aics *inst) |
Set Audio Input Control Service gain mode to automatic. More... | |
int | bt_mics_aics_gain_set (struct bt_mics *mics, struct bt_aics *inst, int8_t gain) |
Set Audio Input Control Service input gain. More... | |
int | bt_mics_aics_description_get (struct bt_mics *mics, struct bt_aics *inst) |
Read the Audio Input Control Service description. More... | |
int | bt_mics_aics_description_set (struct bt_mics *mics, struct bt_aics *inst, const char *description) |
Set the Audio Input Control Service description. More... | |
int | bt_mics_aics_deactivate (struct bt_mics *mics, struct bt_aics *inst) |
Deactivates a Audio Input Control Service instance. More... | |
int | bt_mics_aics_activate (struct bt_mics *mics, struct bt_aics *inst) |
Activates a Audio Input Control Service instance. More... | |
int | bt_mics_client_cb_register (struct bt_mics_cb *cb) |
Registers the callbacks used by Microphone Input Control Service client. More... | |
Microphone Input Control Service (Microphone Input Control Service)
[Experimental] Users should note that the APIs can change as a part of ongoing development.
#define BT_MICS_AICS_CNT 0 |
#include <include/bluetooth/audio/mics.h>
#define BT_MICS_ERR_MUTE_DISABLED 0x80 |
#include <include/bluetooth/audio/mics.h>
Application error codes
#define BT_MICS_ERR_VAL_OUT_OF_RANGE 0x81 |
#include <include/bluetooth/audio/mics.h>
#define BT_MICS_MUTE_DISABLED 0x02 |
#include <include/bluetooth/audio/mics.h>
#define BT_MICS_MUTE_MUTED 0x01 |
#include <include/bluetooth/audio/mics.h>
#define BT_MICS_MUTE_UNMUTED 0x00 |
#include <include/bluetooth/audio/mics.h>
Microphone Input Control Service mute states
#include <include/bluetooth/audio/mics.h>
Callback function for bt_mics_discover.
This callback is only used for the client.
mics | Microphone Input Control Service instance pointer. |
err | Error value. 0 on success, GATT error or errno on fail. |
aics_count | Number of Audio Input Control Service instances on peer device. |
#include <include/bluetooth/audio/mics.h>
Callback function for Microphone Input Control Service mute.
Called when the value is read, or if the value is changed by either the server or client.
mics | Microphone Input Control Service instance pointer. |
err | Error value. 0 on success, GATT error or errno on fail. For notifications, this will always be 0. |
mute | The mute setting of the Microphone Input Control Service. |
typedef void(* bt_mics_mute_write_cb) (struct bt_mics *mics, int err) |
#include <include/bluetooth/audio/mics.h>
Callback function for Microphone Input Control Service mute/unmute.
mics | Microphone Input Control Service instance pointer. |
err | Error value. 0 on success, GATT error or errno on fail. |
int bt_mics_aics_activate | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Activates a Audio Input Control Service instance.
Audio Input Control Services are activated by default, but this will allow the server to reactivate a Audio Input Control Service instance after it has been deactivated with bt_mics_aics_deactivate. This can only be done as the server.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_automatic_gain_set | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Set Audio Input Control Service gain mode to automatic.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_deactivate | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Deactivates a Audio Input Control Service instance.
Audio Input Control Services are activated by default, but this will allow the server to deactivate a Audio Input Control Service. This can only be done as the server.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_description_get | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Read the Audio Input Control Service description.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_description_set | ( | struct bt_mics * | mics, |
struct bt_aics * | inst, | ||
const char * | description | ||
) |
#include <include/bluetooth/audio/mics.h>
Set the Audio Input Control Service description.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
description | The description to set. |
int bt_mics_aics_gain_set | ( | struct bt_mics * | mics, |
struct bt_aics * | inst, | ||
int8_t | gain | ||
) |
#include <include/bluetooth/audio/mics.h>
Set Audio Input Control Service input gain.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
gain | The gain in dB to set (-128 to 127). |
int bt_mics_aics_gain_setting_get | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Read the Audio Input Control Service gain settings.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_manual_gain_set | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Set Audio Input Control Service gain mode to manual.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_mute | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Mute the Audio Input Control Service input.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_state_get | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Read the Audio Input Control Service input state.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_status_get | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Read the Audio Input Control Service input status.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_type_get | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Read the Audio Input Control Service input type.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_aics_unmute | ( | struct bt_mics * | mics, |
struct bt_aics * | inst | ||
) |
#include <include/bluetooth/audio/mics.h>
Unmute the Audio Input Control Service input.
mics | Microphone Input Control Service instance pointer. |
inst | Pointer to the Audio Input Control Service instance. |
int bt_mics_client_cb_register | ( | struct bt_mics_cb * | cb | ) |
#include <include/bluetooth/audio/mics.h>
Registers the callbacks used by Microphone Input Control Service client.
This can only be done as the client.
cb | The callback structure. |
int bt_mics_client_conn_get | ( | const struct bt_mics * | mics, |
struct bt_conn ** | conn | ||
) |
#include <include/bluetooth/audio/mics.h>
Get the connection pointer of a client instance.
Get the Bluetooth connection pointer of a Microphone Input Control Service client instance.
mics | Microphone Input Control Service client instance pointer. |
conn | Connection pointer. |
int bt_mics_discover | ( | struct bt_conn * | conn, |
struct bt_mics ** | mics | ||
) |
#include <include/bluetooth/audio/mics.h>
Discover Microphone Input 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_mics_discover_cb callback will notify when it is possible to start remote operations.
This shall only be done as the client.
conn | The connection to initialize the profile for. | |
[out] | mics | Valid remote instance object on success. |
int bt_mics_included_get | ( | struct bt_mics * | mics, |
struct bt_mics_included * | included | ||
) |
#include <include/bluetooth/audio/mics.h>
Get Microphone Input Control Service included services.
Returns a pointer to a struct that contains information about the Microphone Input Control Service included services instances, such as pointers to the Audio Input Control Service instances.
mics | Microphone Input Control Service instance pointer. | |
[out] | included | Pointer to store the result in. |
int bt_mics_mute | ( | struct bt_mics * | mics | ) |
#include <include/bluetooth/audio/mics.h>
Mute the server.
mics | Microphone Input Control Service instance pointer. |
int bt_mics_mute_disable | ( | struct bt_mics * | mics | ) |
#include <include/bluetooth/audio/mics.h>
Disable the mute functionality.
Can be reenabled by called bt_mics_mute or bt_mics_unmute. This can only be done as the server.
mics | Microphone Input Control Service instance pointer. |
int bt_mics_mute_get | ( | struct bt_mics * | mics | ) |
#include <include/bluetooth/audio/mics.h>
Read the mute state of a Microphone Input Control Service.
mics | Microphone Input Control Service instance pointer. |
int bt_mics_register | ( | struct bt_mics_register_param * | param, |
struct bt_mics ** | mics | ||
) |
#include <include/bluetooth/audio/mics.h>
Initialize the Microphone Input Control Service.
This will enable the service and make it discoverable by clients. This can only be done as the server.
param | Pointer to an initialization structure. | |
[out] | mics | Pointer to the registered Microphone Input Control Service. This will still be valid if the return value is -EALREADY. |
int bt_mics_unmute | ( | struct bt_mics * | mics | ) |
#include <include/bluetooth/audio/mics.h>
Unmute the server.
mics | Microphone Input Control Service instance pointer. |