Zephyr API Documentation
3.5.0
A Scalable Open Source RTOS
|
|
3.5.0 |
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_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_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_read_content_control_id_cb) (struct bt_conn *conn, int err, uint8_t ccid) |
Callback function for bt_mcc_read_content_control_id() | |
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_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_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_read_content_control_id (struct bt_conn *conn) |
Read Content Control ID. | |
Bluetooth Media Control Client (MCC) interface.
Updated to the Media Control Profile specification revision 1.0
[Experimental] Users should note that the APIs can change as a part of ongoing development.
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)
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
ntf | The command notification |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
ccid | The Content Control ID |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
icon_url | The URL of the Icon |
#include <zephyr/bluetooth/audio/mcc.h>
Callback function for bt_mcc_read_media_state()
Called when the media state is read or notified
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
state | The Media State |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
opcodes | The supported opcodes |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
speed | The Playback Speed |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
name | Player name |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
order | The playback order |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
orders | The playing orders supported (bitmap) |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
speed | The Seeking Speed |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
dur | The duration of the track |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
pos | The Track Position |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
title | The title of the track |
#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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
cmd | The command sent |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
speed | The Playback Speed set (or attempted to set) |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
order | The Playing Order set (or attempted to set) |
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
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
pos | The Track Position set (or attempted to set) |
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.
conn | The connection that was used to initialise the media control client |
err | Error value. 0 on success, GATT error or errno on fail |
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.
conn | Connection to the peer device |
subscribe | Whether to subscribe to notifications |
int bt_mcc_init | ( | struct bt_mcc_cb * | cb | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Initialize Media Control Client.
cb | Callbacks to be used |
int bt_mcc_read_content_control_id | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Content Control ID.
conn | Connection to the peer device |
int bt_mcc_read_icon_url | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Icon Object URL.
conn | Connection to the peer device |
int bt_mcc_read_media_state | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Media State.
conn | Connection to the peer device |
int bt_mcc_read_opcodes_supported | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Opcodes Supported.
conn | Connection to the peer device |
int bt_mcc_read_playback_speed | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Playback speed.
conn | Connection to the peer device |
int bt_mcc_read_player_name | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Media Player Name.
conn | Connection to the peer device |
int bt_mcc_read_playing_order | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Playing Order.
conn | Connection to the peer device |
int bt_mcc_read_playing_orders_supported | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Playing Orders Supported.
conn | Connection to the peer device |
int bt_mcc_read_seeking_speed | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Seeking speed.
conn | Connection to the peer device |
int bt_mcc_read_track_duration | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Track Duration.
conn | Connection to the peer device |
int bt_mcc_read_track_position | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Track Position.
conn | Connection to the peer device |
int bt_mcc_read_track_title | ( | struct bt_conn * | conn | ) |
#include <zephyr/bluetooth/audio/mcc.h>
Read Track Title.
conn | Connection to the peer device |
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.
conn | Connection to the peer device |
cmd | The command to send |
int bt_mcc_set_playback_speed | ( | struct bt_conn * | conn, |
int8_t | speed | ||
) |
#include <zephyr/bluetooth/audio/mcc.h>
Set Playback Speed.
conn | Connection to the peer device |
speed | Playback speed |
int bt_mcc_set_playing_order | ( | struct bt_conn * | conn, |
uint8_t | order | ||
) |
#include <zephyr/bluetooth/audio/mcc.h>
Set Playing Order.
conn | Connection to the peer device |
order | Playing order |
int bt_mcc_set_track_position | ( | struct bt_conn * | conn, |
int32_t | pos | ||
) |
#include <zephyr/bluetooth/audio/mcc.h>
Set Track position.
conn | Connection to the peer device |
pos | Track position |