Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Media Control Client (MCC)

Bluetooth Media Control Client (MCC) interface. More...

Data Structures

struct  bt_mcc_cb
 Media control client callbacks. More...
 

Typedefs

typedef void(* bt_mcc_discover_mcs_cb) (struct bt_conn *conn, int err)
 Callback function for bt_mcc_discover_mcs()
 
typedef void(* bt_mcc_read_player_name_cb) (struct bt_conn *conn, int err, const char *name)
 Callback function for bt_mcc_read_player_name()
 
typedef void(* bt_mcc_read_icon_obj_id_cb) (struct bt_conn *conn, int err, uint64_t icon_id)
 Callback function for bt_mcc_read_icon_obj_id()
 
typedef void(* bt_mcc_read_icon_url_cb) (struct bt_conn *conn, int err, const char *icon_url)
 Callback function for bt_mcc_read_icon_url()
 
typedef void(* bt_mcc_track_changed_ntf_cb) (struct bt_conn *conn, int err)
 Callback function for track changed notifications.
 
typedef void(* bt_mcc_read_track_title_cb) (struct bt_conn *conn, int err, const char *title)
 Callback function for bt_mcc_read_track_title()
 
typedef void(* bt_mcc_read_track_duration_cb) (struct bt_conn *conn, int err, int32_t dur)
 Callback function for bt_mcc_read_track_duration()
 
typedef void(* bt_mcc_read_track_position_cb) (struct bt_conn *conn, int err, int32_t pos)
 Callback function for bt_mcc_read_track_position()
 
typedef void(* bt_mcc_set_track_position_cb) (struct bt_conn *conn, int err, int32_t pos)
 Callback function for bt_mcc_set_track_position()
 
typedef void(* bt_mcc_read_playback_speed_cb) (struct bt_conn *conn, int err, int8_t speed)
 Callback function for bt_mcc_read_playback_speed()
 
typedef void(* bt_mcc_set_playback_speed_cb) (struct bt_conn *conn, int err, int8_t speed)
 Callback function for bt_mcc_set_playback_speed()
 
typedef void(* bt_mcc_read_seeking_speed_cb) (struct bt_conn *conn, int err, int8_t speed)
 Callback function for bt_mcc_read_seeking_speed()
 
typedef void(* bt_mcc_read_segments_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_segments_obj_id()
 
typedef void(* bt_mcc_read_current_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_current_track_obj_id()
 
typedef void(* bt_mcc_set_current_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_set_current_track_obj_id()
 
typedef void(* bt_mcc_read_next_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_next_track_obj_id_obj()
 
typedef void(* bt_mcc_set_next_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_set_next_track_obj_id()
 
typedef void(* bt_mcc_read_parent_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_parent_group_obj_id()
 
typedef void(* bt_mcc_read_current_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_current_group_obj_id()
 
typedef void(* bt_mcc_set_current_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t obj_id)
 Callback function for bt_mcc_set_current_group_obj_id()
 
typedef void(* bt_mcc_read_playing_order_cb) (struct bt_conn *conn, int err, uint8_t order)
 Callback function for bt_mcc_read_playing_order()
 
typedef void(* bt_mcc_set_playing_order_cb) (struct bt_conn *conn, int err, uint8_t order)
 Callback function for bt_mcc_set_playing_order()
 
typedef void(* bt_mcc_read_playing_orders_supported_cb) (struct bt_conn *conn, int err, uint16_t orders)
 Callback function for bt_mcc_read_playing_orders_supported()
 
typedef void(* bt_mcc_read_media_state_cb) (struct bt_conn *conn, int err, uint8_t state)
 Callback function for bt_mcc_read_media_state()
 
typedef void(* bt_mcc_send_cmd_cb) (struct bt_conn *conn, int err, const struct mpl_cmd *cmd)
 Callback function for bt_mcc_send_cmd()
 
typedef void(* bt_mcc_cmd_ntf_cb) (struct bt_conn *conn, int err, const struct mpl_cmd_ntf *ntf)
 Callback function for command notifications.
 
typedef void(* bt_mcc_read_opcodes_supported_cb) (struct bt_conn *conn, int err, uint32_t opcodes)
 Callback function for bt_mcc_read_opcodes_supported()
 
typedef void(* bt_mcc_send_search_cb) (struct bt_conn *conn, int err, const struct mpl_search *search)
 Callback function for bt_mcc_send_search()
 
typedef void(* bt_mcc_search_ntf_cb) (struct bt_conn *conn, int err, uint8_t result_code)
 Callback function for search notifications.
 
typedef void(* bt_mcc_read_search_results_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)
 Callback function for bt_mcc_read_search_results_obj_id()
 
typedef void(* bt_mcc_read_content_control_id_cb) (struct bt_conn *conn, int err, uint8_t ccid)
 Callback function for bt_mcc_read_content_control_id()
 
typedef void(* bt_mcc_otc_obj_selected_cb) (struct bt_conn *conn, int err)
 Callback function for object selected.
 
typedef void(* bt_mcc_otc_obj_metadata_cb) (struct bt_conn *conn, int err)
 Callback function for bt_mcc_otc_read_object_metadata()
 
typedef void(* bt_mcc_otc_read_icon_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_icon_object()
 
typedef void(* bt_mcc_otc_read_track_segments_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_track_segments_object()
 
typedef void(* bt_mcc_otc_read_current_track_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_current_track_object()
 
typedef void(* bt_mcc_otc_read_next_track_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_next_track_object()
 
typedef void(* bt_mcc_otc_read_parent_group_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_parent_group_object()
 
typedef void(* bt_mcc_otc_read_current_group_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)
 Callback function for bt_mcc_otc_read_current_group_object()
 

Functions

int bt_mcc_init (struct bt_mcc_cb *cb)
 Initialize Media Control Client.
 
int bt_mcc_discover_mcs (struct bt_conn *conn, bool subscribe)
 Discover Media Control Service.
 
int bt_mcc_read_player_name (struct bt_conn *conn)
 Read Media Player Name.
 
int bt_mcc_read_icon_obj_id (struct bt_conn *conn)
 Read Icon Object ID.
 
int bt_mcc_read_icon_url (struct bt_conn *conn)
 Read Icon Object URL.
 
int bt_mcc_read_track_title (struct bt_conn *conn)
 Read Track Title.
 
int bt_mcc_read_track_duration (struct bt_conn *conn)
 Read Track Duration.
 
int bt_mcc_read_track_position (struct bt_conn *conn)
 Read Track Position.
 
int bt_mcc_set_track_position (struct bt_conn *conn, int32_t pos)
 Set Track position.
 
int bt_mcc_read_playback_speed (struct bt_conn *conn)
 Read Playback speed.
 
int bt_mcc_set_playback_speed (struct bt_conn *conn, int8_t speed)
 Set Playback Speed.
 
int bt_mcc_read_seeking_speed (struct bt_conn *conn)
 Read Seeking speed.
 
int bt_mcc_read_segments_obj_id (struct bt_conn *conn)
 Read Track Segments Object ID.
 
int bt_mcc_read_current_track_obj_id (struct bt_conn *conn)
 Read Current Track Object ID.
 
int bt_mcc_set_current_track_obj_id (struct bt_conn *conn, uint64_t id)
 Set Current Track Object ID.
 
int bt_mcc_read_next_track_obj_id (struct bt_conn *conn)
 Read Next Track Object ID.
 
int bt_mcc_set_next_track_obj_id (struct bt_conn *conn, uint64_t id)
 Set Next Track Object ID.
 
int bt_mcc_read_current_group_obj_id (struct bt_conn *conn)
 Read Current Group Object ID.
 
int bt_mcc_set_current_group_obj_id (struct bt_conn *conn, uint64_t id)
 Set Current Group Object ID.
 
int bt_mcc_read_parent_group_obj_id (struct bt_conn *conn)
 Read Parent Group Object ID.
 
int bt_mcc_read_playing_order (struct bt_conn *conn)
 Read Playing Order.
 
int bt_mcc_set_playing_order (struct bt_conn *conn, uint8_t order)
 Set Playing Order.
 
int bt_mcc_read_playing_orders_supported (struct bt_conn *conn)
 Read Playing Orders Supported.
 
int bt_mcc_read_media_state (struct bt_conn *conn)
 Read Media State.
 
int bt_mcc_send_cmd (struct bt_conn *conn, const struct mpl_cmd *cmd)
 Send a command.
 
int bt_mcc_read_opcodes_supported (struct bt_conn *conn)
 Read Opcodes Supported.
 
int bt_mcc_send_search (struct bt_conn *conn, const struct mpl_search *search)
 Send a Search command.
 
int bt_mcc_read_search_results_obj_id (struct bt_conn *conn)
 Search Results Group Object ID.
 
int bt_mcc_read_content_control_id (struct bt_conn *conn)
 Read Content Control ID.
 
int bt_mcc_otc_read_object_metadata (struct bt_conn *conn)
 Read the current object metadata.
 
int bt_mcc_otc_read_icon_object (struct bt_conn *conn)
 Read the Icon Object.
 
int bt_mcc_otc_read_track_segments_object (struct bt_conn *conn)
 Read the Track Segments Object.
 
int bt_mcc_otc_read_current_track_object (struct bt_conn *conn)
 Read the Current Track Object.
 
int bt_mcc_otc_read_next_track_object (struct bt_conn *conn)
 Read the Next Track Object.
 
int bt_mcc_otc_read_current_group_object (struct bt_conn *conn)
 Read the Current Group Object.
 
int bt_mcc_otc_read_parent_group_object (struct bt_conn *conn)
 Read the Parent Group Object.
 
struct bt_ots_clientbt_mcc_otc_inst (struct bt_conn *conn)
 Look up MCC OTC instance.
 

Detailed Description

Bluetooth Media Control Client (MCC) interface.

Updated to the Media Control Profile specification revision 1.0

Since
3.0
Version
0.8.0

Typedef Documentation

◆ bt_mcc_cmd_ntf_cb

typedef void(* bt_mcc_cmd_ntf_cb) (struct bt_conn *conn, int err, const struct mpl_cmd_ntf *ntf)

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

Callback function for command notifications.

Called when the media control point is notified

Notifications for commands (i.e. for writes to the media control point) use a different parameter structure than what is used for sending commands (writing to the media control point)

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
ntfThe command notification

◆ bt_mcc_discover_mcs_cb

typedef void(* bt_mcc_discover_mcs_cb) (struct bt_conn *conn, int err)

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

Callback function for bt_mcc_discover_mcs()

Called when a media control server is discovered

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail

◆ bt_mcc_otc_obj_metadata_cb

typedef void(* bt_mcc_otc_obj_metadata_cb) (struct bt_conn *conn, int err)

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

Callback function for bt_mcc_otc_read_object_metadata()

Called when object metadata is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail

◆ bt_mcc_otc_obj_selected_cb

typedef void(* bt_mcc_otc_obj_selected_cb) (struct bt_conn *conn, int err)

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

Callback function for object selected.

Called when an object is selected

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail

◆ bt_mcc_otc_read_current_group_object_cb

typedef void(* bt_mcc_otc_read_current_group_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_current_group_object()

Called when the current group object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_otc_read_current_track_object_cb

typedef void(* bt_mcc_otc_read_current_track_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_current_track_object()

Called when the current track object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_otc_read_icon_object_cb

typedef void(* bt_mcc_otc_read_icon_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_icon_object()

Called when the icon object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_otc_read_next_track_object_cb

typedef void(* bt_mcc_otc_read_next_track_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_next_track_object()

Called when the next track object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_otc_read_parent_group_object_cb

typedef void(* bt_mcc_otc_read_parent_group_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_parent_group_object()

Called when the parent group object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_otc_read_track_segments_object_cb

typedef void(* bt_mcc_otc_read_track_segments_object_cb) (struct bt_conn *conn, int err, struct net_buf_simple *buf)

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

Callback function for bt_mcc_otc_read_track_segments_object()

Called when the track segments object is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
bufBuffer containing the object contents

If err is EMSGSIZE, the object contents have been truncated.

◆ bt_mcc_read_content_control_id_cb

typedef void(* bt_mcc_read_content_control_id_cb) (struct bt_conn *conn, int err, uint8_t ccid)

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

Callback function for bt_mcc_read_content_control_id()

Called when the content control ID is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
ccidThe Content Control ID

◆ bt_mcc_read_current_group_obj_id_cb

typedef void(* bt_mcc_read_current_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_current_group_obj_id()

Called when the current group object ID is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Current Group Object ID (UINT48)

◆ bt_mcc_read_current_track_obj_id_cb

typedef void(* bt_mcc_read_current_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_current_track_obj_id()

Called when the current track object ID is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Current Track Object ID (UINT48)

◆ bt_mcc_read_icon_obj_id_cb

typedef void(* bt_mcc_read_icon_obj_id_cb) (struct bt_conn *conn, int err, uint64_t icon_id)

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

Callback function for bt_mcc_read_icon_obj_id()

Called when the icon object ID is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
icon_idThe ID of the Icon Object. This is a UINT48 in a uint64_t

◆ bt_mcc_read_icon_url_cb

typedef void(* bt_mcc_read_icon_url_cb) (struct bt_conn *conn, int err, const char *icon_url)

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

Callback function for bt_mcc_read_icon_url()

Called when the icon URL is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
icon_urlThe URL of the Icon

◆ bt_mcc_read_media_state_cb

typedef void(* bt_mcc_read_media_state_cb) (struct bt_conn *conn, int err, uint8_t state)

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

Callback function for bt_mcc_read_media_state()

Called when the media state is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
stateThe Media State

◆ bt_mcc_read_next_track_obj_id_cb

typedef void(* bt_mcc_read_next_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_next_track_obj_id_obj()

Called when the next track object ID is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Next Track Object ID (UINT48)

◆ bt_mcc_read_opcodes_supported_cb

typedef void(* bt_mcc_read_opcodes_supported_cb) (struct bt_conn *conn, int err, uint32_t opcodes)

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

Callback function for bt_mcc_read_opcodes_supported()

Called when the supported opcodes (commands) are read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
opcodesThe supported opcodes

◆ bt_mcc_read_parent_group_obj_id_cb

typedef void(* bt_mcc_read_parent_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_parent_group_obj_id()

Called when the parent group object ID is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Parent Group Object ID (UINT48)

◆ bt_mcc_read_playback_speed_cb

typedef void(* bt_mcc_read_playback_speed_cb) (struct bt_conn *conn, int err, int8_t speed)

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

Callback function for bt_mcc_read_playback_speed()

Called when the playback speed is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
speedThe Playback Speed

◆ bt_mcc_read_player_name_cb

typedef void(* bt_mcc_read_player_name_cb) (struct bt_conn *conn, int err, const char *name)

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

Callback function for bt_mcc_read_player_name()

Called when the player name is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
namePlayer name

◆ bt_mcc_read_playing_order_cb

typedef void(* bt_mcc_read_playing_order_cb) (struct bt_conn *conn, int err, uint8_t order)

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

Callback function for bt_mcc_read_playing_order()

Called when the playing order is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
orderThe playback order

◆ bt_mcc_read_playing_orders_supported_cb

typedef void(* bt_mcc_read_playing_orders_supported_cb) (struct bt_conn *conn, int err, uint16_t orders)

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

Callback function for bt_mcc_read_playing_orders_supported()

Called when the supported playing orders are read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
ordersThe playing orders supported (bitmap)

◆ bt_mcc_read_search_results_obj_id_cb

typedef void(* bt_mcc_read_search_results_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_search_results_obj_id()

Called when the search results object ID is read or notified

Note that the Search Results Object ID value may be zero, in case the characteristic does not exist on the server. (This will be the case if there has not been a successful search.)

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Search Results Object ID (UINT48)

◆ bt_mcc_read_seeking_speed_cb

typedef void(* bt_mcc_read_seeking_speed_cb) (struct bt_conn *conn, int err, int8_t speed)

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

Callback function for bt_mcc_read_seeking_speed()

Called when the seeking speed is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
speedThe Seeking Speed

◆ bt_mcc_read_segments_obj_id_cb

typedef void(* bt_mcc_read_segments_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_read_segments_obj_id()

Called when the track segments object ID is read

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Track Segments Object ID (UINT48)

◆ bt_mcc_read_track_duration_cb

typedef void(* bt_mcc_read_track_duration_cb) (struct bt_conn *conn, int err, int32_t dur)

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

Callback function for bt_mcc_read_track_duration()

Called when the track duration is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
durThe duration of the track

◆ bt_mcc_read_track_position_cb

typedef void(* bt_mcc_read_track_position_cb) (struct bt_conn *conn, int err, int32_t pos)

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

Callback function for bt_mcc_read_track_position()

Called when the track position is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
posThe Track Position

◆ bt_mcc_read_track_title_cb

typedef void(* bt_mcc_read_track_title_cb) (struct bt_conn *conn, int err, const char *title)

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

Callback function for bt_mcc_read_track_title()

Called when the track title is read or notified

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
titleThe title of the track

◆ bt_mcc_search_ntf_cb

typedef void(* bt_mcc_search_ntf_cb) (struct bt_conn *conn, int err, uint8_t result_code)

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

Callback function for search notifications.

Called when the search control point is notified

Notifications for searches (i.e. for writes to the search control point) use a different parameter structure than what is used for sending searches (writing to the search control point)

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
result_codeThe search notification

◆ bt_mcc_send_cmd_cb

typedef void(* bt_mcc_send_cmd_cb) (struct bt_conn *conn, int err, const struct mpl_cmd *cmd)

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

Callback function for bt_mcc_send_cmd()

Called when a command is sent, i.e. when the media control point is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
cmdThe command sent

◆ bt_mcc_send_search_cb

typedef void(* bt_mcc_send_search_cb) (struct bt_conn *conn, int err, const struct mpl_search *search)

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

Callback function for bt_mcc_send_search()

Called when a search is sent, i.e. when the search control point is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
searchThe search set (or attempted to set)

◆ bt_mcc_set_current_group_obj_id_cb

typedef void(* bt_mcc_set_current_group_obj_id_cb) (struct bt_conn *conn, int err, uint64_t obj_id)

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

Callback function for bt_mcc_set_current_group_obj_id()

Called when the current group object ID is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
obj_idThe Object ID (UINT48) set (or attempted to set)

◆ bt_mcc_set_current_track_obj_id_cb

typedef void(* bt_mcc_set_current_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_set_current_track_obj_id()

Called when the current track object ID is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Object ID (UINT48) set (or attempted to set)

◆ bt_mcc_set_next_track_obj_id_cb

typedef void(* bt_mcc_set_next_track_obj_id_cb) (struct bt_conn *conn, int err, uint64_t id)

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

Callback function for bt_mcc_set_next_track_obj_id()

Called when the next track object ID is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
idThe Object ID (UINT48) set (or attempted to set)

◆ bt_mcc_set_playback_speed_cb

typedef void(* bt_mcc_set_playback_speed_cb) (struct bt_conn *conn, int err, int8_t speed)

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

Callback function for bt_mcc_set_playback_speed()

Called when the playback speed is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
speedThe Playback Speed set (or attempted to set)

◆ bt_mcc_set_playing_order_cb

typedef void(* bt_mcc_set_playing_order_cb) (struct bt_conn *conn, int err, uint8_t order)

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

Callback function for bt_mcc_set_playing_order()

Called when the playing order is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
orderThe Playing Order set (or attempted to set)

◆ bt_mcc_set_track_position_cb

typedef void(* bt_mcc_set_track_position_cb) (struct bt_conn *conn, int err, int32_t pos)

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

Callback function for bt_mcc_set_track_position()

Called when the track position is set

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail
posThe Track Position set (or attempted to set)

◆ bt_mcc_track_changed_ntf_cb

typedef void(* bt_mcc_track_changed_ntf_cb) (struct bt_conn *conn, int err)

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

Callback function for track changed notifications.

Called when a track change is notified.

The track changed characteristic is a special case. It can not be read or set, it can only be notified.

Parameters
connThe connection that was used to initialise the media control client
errError value. 0 on success, GATT error or errno on fail

Function Documentation

◆ bt_mcc_discover_mcs()

int bt_mcc_discover_mcs ( struct bt_conn *  conn,
bool  subscribe 
)

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

Discover Media Control Service.

Discover Media Control Service (MCS) on the server given by the connection Optionally subscribe to notifications.

Shall be called once, after media control client initialization and before using other media control client functionality.

Parameters
connConnection to the peer device
subscribeWhether to subscribe to notifications
Returns
0 if success, errno on failure.

◆ bt_mcc_init()

int bt_mcc_init ( struct bt_mcc_cb cb)

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

Initialize Media Control Client.

Parameters
cbCallbacks to be used
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_inst()

struct bt_ots_client * bt_mcc_otc_inst ( struct bt_conn *  conn)

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

Look up MCC OTC instance.

Parameters
connThe connection to the MCC server.
Returns
Pointer to a MCC OTC instance if found else NULL.

◆ bt_mcc_otc_read_current_group_object()

int bt_mcc_otc_read_current_group_object ( struct bt_conn *  conn)

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

Read the Current Group Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_current_track_object()

int bt_mcc_otc_read_current_track_object ( struct bt_conn *  conn)

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

Read the Current Track Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_icon_object()

int bt_mcc_otc_read_icon_object ( struct bt_conn *  conn)

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

Read the Icon Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_next_track_object()

int bt_mcc_otc_read_next_track_object ( struct bt_conn *  conn)

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

Read the Next Track Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_object_metadata()

int bt_mcc_otc_read_object_metadata ( struct bt_conn *  conn)

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

Read the current object metadata.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_parent_group_object()

int bt_mcc_otc_read_parent_group_object ( struct bt_conn *  conn)

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

Read the Parent Group Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_otc_read_track_segments_object()

int bt_mcc_otc_read_track_segments_object ( struct bt_conn *  conn)

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

Read the Track Segments Object.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_content_control_id()

int bt_mcc_read_content_control_id ( struct bt_conn *  conn)

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

Read Content Control ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_current_group_obj_id()

int bt_mcc_read_current_group_obj_id ( struct bt_conn *  conn)

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

Read Current Group Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_current_track_obj_id()

int bt_mcc_read_current_track_obj_id ( struct bt_conn *  conn)

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

Read Current Track Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_icon_obj_id()

int bt_mcc_read_icon_obj_id ( struct bt_conn *  conn)

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

Read Icon Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_icon_url()

int bt_mcc_read_icon_url ( struct bt_conn *  conn)

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

Read Icon Object URL.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_media_state()

int bt_mcc_read_media_state ( struct bt_conn *  conn)

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

Read Media State.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_next_track_obj_id()

int bt_mcc_read_next_track_obj_id ( struct bt_conn *  conn)

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

Read Next Track Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_opcodes_supported()

int bt_mcc_read_opcodes_supported ( struct bt_conn *  conn)

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

Read Opcodes Supported.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_parent_group_obj_id()

int bt_mcc_read_parent_group_obj_id ( struct bt_conn *  conn)

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

Read Parent Group Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_playback_speed()

int bt_mcc_read_playback_speed ( struct bt_conn *  conn)

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

Read Playback speed.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_player_name()

int bt_mcc_read_player_name ( struct bt_conn *  conn)

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

Read Media Player Name.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_playing_order()

int bt_mcc_read_playing_order ( struct bt_conn *  conn)

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

Read Playing Order.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_playing_orders_supported()

int bt_mcc_read_playing_orders_supported ( struct bt_conn *  conn)

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

Read Playing Orders Supported.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_search_results_obj_id()

int bt_mcc_read_search_results_obj_id ( struct bt_conn *  conn)

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

Search Results Group Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_seeking_speed()

int bt_mcc_read_seeking_speed ( struct bt_conn *  conn)

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

Read Seeking speed.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_segments_obj_id()

int bt_mcc_read_segments_obj_id ( struct bt_conn *  conn)

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

Read Track Segments Object ID.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_track_duration()

int bt_mcc_read_track_duration ( struct bt_conn *  conn)

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

Read Track Duration.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_track_position()

int bt_mcc_read_track_position ( struct bt_conn *  conn)

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

Read Track Position.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_read_track_title()

int bt_mcc_read_track_title ( struct bt_conn *  conn)

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

Read Track Title.

Parameters
connConnection to the peer device
Returns
0 if success, errno on failure.

◆ bt_mcc_send_cmd()

int bt_mcc_send_cmd ( struct bt_conn *  conn,
const struct mpl_cmd cmd 
)

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

Send a command.

Write a command (e.g. "play", "pause") to the server's media control point.

Parameters
connConnection to the peer device
cmdThe command to send
Returns
0 if success, errno on failure.

◆ bt_mcc_send_search()

int bt_mcc_send_search ( struct bt_conn *  conn,
const struct mpl_search search 
)

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

Send a Search command.

Write a search to the server's search control point.

Parameters
connConnection to the peer device
searchThe search
Returns
0 if success, errno on failure.

◆ bt_mcc_set_current_group_obj_id()

int bt_mcc_set_current_group_obj_id ( struct bt_conn *  conn,
uint64_t  id 
)

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

Set Current Group Object ID.

Set the Current Group to the group given by the id parameter

Parameters
connConnection to the peer device
idObject Transfer Service ID (UINT48) of the group to set as the current group
Returns
0 if success, errno on failure.

◆ bt_mcc_set_current_track_obj_id()

int bt_mcc_set_current_track_obj_id ( struct bt_conn *  conn,
uint64_t  id 
)

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

Set Current Track Object ID.

Set the Current Track to the track given by the id parameter

Parameters
connConnection to the peer device
idObject Transfer Service ID (UINT48) of the track to set as the current track
Returns
0 if success, errno on failure.

◆ bt_mcc_set_next_track_obj_id()

int bt_mcc_set_next_track_obj_id ( struct bt_conn *  conn,
uint64_t  id 
)

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

Set Next Track Object ID.

Set the Next Track to the track given by the id parameter

Parameters
connConnection to the peer device
idObject Transfer Service ID (UINT48) of the track to set as the next track
Returns
0 if success, errno on failure.

◆ bt_mcc_set_playback_speed()

int bt_mcc_set_playback_speed ( struct bt_conn *  conn,
int8_t  speed 
)

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

Set Playback Speed.

Parameters
connConnection to the peer device
speedPlayback speed
Returns
0 if success, errno on failure.

◆ bt_mcc_set_playing_order()

int bt_mcc_set_playing_order ( struct bt_conn *  conn,
uint8_t  order 
)

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

Set Playing Order.

Parameters
connConnection to the peer device
orderPlaying order
Returns
0 if success, errno on failure.

◆ bt_mcc_set_track_position()

int bt_mcc_set_track_position ( struct bt_conn *  conn,
int32_t  pos 
)

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

Set Track position.

Parameters
connConnection to the peer device
posTrack position
Returns
0 if success, errno on failure.