Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Media proxy module. More...

Data Structures

struct  mpl_cmd
 Media player command. More...
 
struct  mpl_cmd_ntf
 Media command notification. More...
 
struct  mpl_sci
 Search control item. More...
 
struct  mpl_search
 Search. More...
 
struct  media_proxy_ctrl_cbs
 Callbacks to a controller, from the media proxy. More...
 
struct  media_proxy_pl_calls
 Available calls in a player, that the media proxy can call. More...
 

Macros

#define MEDIA_PROXY_OPCODES_SUPPORTED_LEN   4
 Media player supported opcodes length.
 

Functions

int media_proxy_ctrl_register (struct media_proxy_ctrl_cbs *ctrl_cbs)
 Register a controller with the media_proxy.
 
int media_proxy_ctrl_discover_player (struct bt_conn *conn)
 Discover a remote media player.
 
int media_proxy_ctrl_get_player_name (struct media_player *player)
 Read Media Player Name.
 
int media_proxy_ctrl_get_icon_id (struct media_player *player)
 Read Icon Object ID.
 
int media_proxy_ctrl_get_icon_url (struct media_player *player)
 Read Icon URL.
 
int media_proxy_ctrl_get_track_title (struct media_player *player)
 Read Track Title.
 
int media_proxy_ctrl_get_track_duration (struct media_player *player)
 Read Track Duration.
 
int media_proxy_ctrl_get_track_position (struct media_player *player)
 Read Track Position.
 
int media_proxy_ctrl_set_track_position (struct media_player *player, int32_t position)
 Set Track Position.
 
int media_proxy_ctrl_get_playback_speed (struct media_player *player)
 Get Playback Speed.
 
int media_proxy_ctrl_set_playback_speed (struct media_player *player, int8_t speed)
 Set Playback Speed.
 
int media_proxy_ctrl_get_seeking_speed (struct media_player *player)
 Get Seeking Speed.
 
int media_proxy_ctrl_get_track_segments_id (struct media_player *player)
 Read Current Track Segments Object ID.
 
int media_proxy_ctrl_get_current_track_id (struct media_player *player)
 Read Current Track Object ID.
 
int media_proxy_ctrl_set_current_track_id (struct media_player *player, uint64_t id)
 Set Current Track Object ID.
 
int media_proxy_ctrl_get_next_track_id (struct media_player *player)
 Read Next Track Object ID.
 
int media_proxy_ctrl_set_next_track_id (struct media_player *player, uint64_t id)
 Set Next Track Object ID.
 
int media_proxy_ctrl_get_parent_group_id (struct media_player *player)
 Read Parent Group Object ID.
 
int media_proxy_ctrl_get_current_group_id (struct media_player *player)
 Read Current Group Object ID.
 
int media_proxy_ctrl_set_current_group_id (struct media_player *player, uint64_t id)
 Set Current Group Object ID.
 
int media_proxy_ctrl_get_playing_order (struct media_player *player)
 Read Playing Order.
 
int media_proxy_ctrl_set_playing_order (struct media_player *player, uint8_t order)
 Set Playing Order.
 
int media_proxy_ctrl_get_playing_orders_supported (struct media_player *player)
 Read Playing Orders Supported.
 
int media_proxy_ctrl_get_media_state (struct media_player *player)
 Read Media State.
 
int media_proxy_ctrl_send_command (struct media_player *player, const struct mpl_cmd *command)
 Send Command.
 
int media_proxy_ctrl_get_commands_supported (struct media_player *player)
 Read Commands Supported.
 
int media_proxy_ctrl_send_search (struct media_player *player, const struct mpl_search *search)
 Set Search.
 
int media_proxy_ctrl_get_search_results_id (struct media_player *player)
 Read Search Results Object ID.
 
uint8_t media_proxy_ctrl_get_content_ctrl_id (struct media_player *player)
 Read Content Control ID.
 
int media_proxy_pl_register (struct media_proxy_pl_calls *pl_calls)
 Register a player with the media proxy.
 
int media_proxy_pl_init (void)
 Initialize player.
 
struct bt_ots * bt_mcs_get_ots (void)
 Get the pointer of the Object Transfer Service used by the Media Control Service.
 
void media_proxy_pl_name_cb (const char *name)
 Player name changed callback.
 
void media_proxy_pl_icon_url_cb (const char *url)
 Player icon URL changed callback.
 
void media_proxy_pl_track_changed_cb (void)
 Track changed callback.
 
void media_proxy_pl_track_title_cb (char *title)
 Track title callback.
 
void media_proxy_pl_track_duration_cb (int32_t duration)
 Track duration callback.
 
void media_proxy_pl_track_position_cb (int32_t position)
 Track position callback.
 
void media_proxy_pl_playback_speed_cb (int8_t speed)
 Playback speed callback.
 
void media_proxy_pl_seeking_speed_cb (int8_t speed)
 Seeking speed callback.
 
void media_proxy_pl_current_track_id_cb (uint64_t id)
 Current track object ID callback.
 
void media_proxy_pl_next_track_id_cb (uint64_t id)
 Next track object ID callback.
 
void media_proxy_pl_parent_group_id_cb (uint64_t id)
 Parent group object ID callback.
 
void media_proxy_pl_current_group_id_cb (uint64_t id)
 Current group object ID callback.
 
void media_proxy_pl_playing_order_cb (uint8_t order)
 Playing order callback.
 
void media_proxy_pl_media_state_cb (uint8_t state)
 Media state callback.
 
void media_proxy_pl_command_cb (const struct mpl_cmd_ntf *cmd_ntf)
 Command callback.
 
void media_proxy_pl_commands_supported_cb (uint32_t opcodes)
 Commands supported callback.
 
void media_proxy_pl_search_cb (uint8_t result_code)
 Search callback.
 
void media_proxy_pl_search_results_id_cb (uint64_t id)
 Search Results object ID callback.
 

Playback speed parameters

All values from -128 to 127 allowed, only some defined

#define MEDIA_PROXY_PLAYBACK_SPEED_MIN   -128
 Minimum playback speed, resulting in 25 % speed.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_QUARTER   -128
 Quarter playback speed, resulting in 25 % speed.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_HALF   -64
 Half playback speed, resulting in 50 % speed.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_UNITY   0
 Unity playback speed, resulting in 100 % speed.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_DOUBLE   64
 Double playback speed, resulting in 200 % speed.
 
#define MEDIA_PROXY_PLAYBACK_SPEED_MAX   127
 Max playback speed, resulting in 395.7 % speed (nearly 400 %)
 

Seeking speed factors

The allowed values for seeking speed are the range -64 to -4 (endpoints included), the value 0, and the range 4 to 64 (endpoints included).

#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MAX   64
 Maximum seeking speed - Can be negated.
 
#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MIN   4
 Minimum seeking speed - Can be negated.
 
#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_ZERO   0
 No seeking.
 

Playing orders

#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_ONCE   0x01
 A single track is played once; there is no next track.
 
#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_REPEAT   0x02
 A single track is played repeatedly; the next track is the current track.
 
#define MEDIA_PROXY_PLAYING_ORDER_INORDER_ONCE   0x03
 The tracks within a group are played once in track order.
 
#define MEDIA_PROXY_PLAYING_ORDER_INORDER_REPEAT   0x04
 The tracks within a group are played in track order repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_ONCE   0x05
 The tracks within a group are played once only from the oldest first.
 
#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_REPEAT   0x06
 The tracks within a group are played from the oldest first repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_ONCE   0x07
 The tracks within a group are played once only from the newest first.
 
#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_REPEAT   0x08
 The tracks within a group are played from the newest first repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_ONCE   0x09
 The tracks within a group are played in random order once.
 
#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_REPEAT   0x0a
 The tracks within a group are played in random order repeatedly.
 

Playing orders supported

A bitmap, in the same order as the playing orders above.

Note that playing order 1 corresponds to bit 0, and so on.

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE   BIT(0)
 A single track is played once; there is no next track.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT   BIT(1)
 A single track is played repeatedly; the next track is the current track.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE   BIT(2)
 The tracks within a group are played once in track order.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT   BIT(3)
 The tracks within a group are played in track order repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE   BIT(4)
 The tracks within a group are played once only from the oldest first.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT   BIT(5)
 The tracks within a group are played from the oldest first repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE   BIT(6)
 The tracks within a group are played once only from the newest first.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT   BIT(7)
 The tracks within a group are played from the newest first repeatedly.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE   BIT(8)
 The tracks within a group are played in random order once.
 
#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT   BIT(9)
 The tracks within a group are played in random order repeatedly.
 

Media player states

#define MEDIA_PROXY_STATE_INACTIVE   0x00
 The current track is invalid, and no track has been selected.
 
#define MEDIA_PROXY_STATE_PLAYING   0x01
 The media player is playing the current track.
 
#define MEDIA_PROXY_STATE_PAUSED   0x02
 The current track is paused.
 
#define MEDIA_PROXY_STATE_SEEKING   0x03
 The current track is fast forwarding or fast rewinding.
 
#define MEDIA_PROXY_STATE_LAST   0x04
 Used internally as the last state value.
 

Media player command opcodes

#define MEDIA_PROXY_OP_PLAY   0x01
 Start playing the current track.
 
#define MEDIA_PROXY_OP_PAUSE   0x02
 Pause playing the current track.
 
#define MEDIA_PROXY_OP_FAST_REWIND   0x03
 Fast rewind the current track.
 
#define MEDIA_PROXY_OP_FAST_FORWARD   0x04
 Fast forward the current track.
 
#define MEDIA_PROXY_OP_STOP   0x05
 Stop current activity and return to the paused state and set the current track position to the start of the current track.
 
#define MEDIA_PROXY_OP_MOVE_RELATIVE   0x10
 Set a new current track position relative to the current track position.
 
#define MEDIA_PROXY_OP_PREV_SEGMENT   0x20
 Set the current track position to the starting position of the previous segment of the current track.
 
#define MEDIA_PROXY_OP_NEXT_SEGMENT   0x21
 Set the current track position to the starting position of the next segment of the current track.
 
#define MEDIA_PROXY_OP_FIRST_SEGMENT   0x22
 Set the current track position to the starting position of the first segment of the current track.
 
#define MEDIA_PROXY_OP_LAST_SEGMENT   0x23
 Set the current track position to the starting position of the last segment of the current track.
 
#define MEDIA_PROXY_OP_GOTO_SEGMENT   0x24
 Set the current track position to the starting position of the nth segment of the current track.
 
#define MEDIA_PROXY_OP_PREV_TRACK   0x30
 Set the current track to the previous track based on the playing order.
 
#define MEDIA_PROXY_OP_NEXT_TRACK   0x31
 Set the current track to the next track based on the playing order.
 
#define MEDIA_PROXY_OP_FIRST_TRACK   0x32
 Set the current track to the first track based on the playing order.
 
#define MEDIA_PROXY_OP_LAST_TRACK   0x33
 Set the current track to the last track based on the playing order.
 
#define MEDIA_PROXY_OP_GOTO_TRACK   0x34
 Set the current track to the nth track based on the playing order.
 
#define MEDIA_PROXY_OP_PREV_GROUP   0x40
 Set the current group to the previous group in the sequence of groups.
 
#define MEDIA_PROXY_OP_NEXT_GROUP   0x41
 Set the current group to the next group in the sequence of groups.
 
#define MEDIA_PROXY_OP_FIRST_GROUP   0x42
 Set the current group to the first group in the sequence of groups.
 
#define MEDIA_PROXY_OP_LAST_GROUP   0x43
 Set the current group to the last group in the sequence of groups.
 
#define MEDIA_PROXY_OP_GOTO_GROUP   0x44
 Set the current group to the nth group in the sequence of groups.
 
#define MEDIA_PROXY_OP_SUP_PLAY   BIT(0)
 Media player supported command opcodes.
 
#define MEDIA_PROXY_OP_SUP_PAUSE   BIT(1)
 Support the Pause opcode.
 
#define MEDIA_PROXY_OP_SUP_FAST_REWIND   BIT(2)
 Support the Fast Rewind opcode.
 
#define MEDIA_PROXY_OP_SUP_FAST_FORWARD   BIT(3)
 Support the Fast Forward opcode.
 
#define MEDIA_PROXY_OP_SUP_STOP   BIT(4)
 Support the Stop opcode.
 
#define MEDIA_PROXY_OP_SUP_MOVE_RELATIVE   BIT(5)
 Support the Move Relative opcode.
 
#define MEDIA_PROXY_OP_SUP_PREV_SEGMENT   BIT(6)
 Support the Previous Segment opcode.
 
#define MEDIA_PROXY_OP_SUP_NEXT_SEGMENT   BIT(7)
 Support the Next Segment opcode.
 
#define MEDIA_PROXY_OP_SUP_FIRST_SEGMENT   BIT(8)
 Support the First Segment opcode.
 
#define MEDIA_PROXY_OP_SUP_LAST_SEGMENT   BIT(9)
 Support the Last Segment opcode.
 
#define MEDIA_PROXY_OP_SUP_GOTO_SEGMENT   BIT(10)
 Support the Goto Segment opcode.
 
#define MEDIA_PROXY_OP_SUP_PREV_TRACK   BIT(11)
 Support the Previous Track opcode.
 
#define MEDIA_PROXY_OP_SUP_NEXT_TRACK   BIT(12)
 Support the Next Track opcode.
 
#define MEDIA_PROXY_OP_SUP_FIRST_TRACK   BIT(13)
 Support the First Track opcode.
 
#define MEDIA_PROXY_OP_SUP_LAST_TRACK   BIT(14)
 Support the Last Track opcode.
 
#define MEDIA_PROXY_OP_SUP_GOTO_TRACK   BIT(15)
 Support the Goto Track opcode.
 
#define MEDIA_PROXY_OP_SUP_PREV_GROUP   BIT(16)
 Support the Previous Group opcode.
 
#define MEDIA_PROXY_OP_SUP_NEXT_GROUP   BIT(17)
 Support the Next Group opcode.
 
#define MEDIA_PROXY_OP_SUP_FIRST_GROUP   BIT(18)
 Support the First Group opcode.
 
#define MEDIA_PROXY_OP_SUP_LAST_GROUP   BIT(19)
 Support the Last Group opcode.
 
#define MEDIA_PROXY_OP_SUP_GOTO_GROUP   BIT(20)
 Support the Goto Group opcode.
 

Media player command result codes

#define MEDIA_PROXY_CMD_SUCCESS   0x01
 Action requested by the opcode write was completed successfully.
 
#define MEDIA_PROXY_CMD_NOT_SUPPORTED   0x02
 An invalid or unsupported opcode was used for the Media Control Point write.
 
#define MEDIA_PROXY_CMD_PLAYER_INACTIVE   0x03
 The Media Player State characteristic value is Inactive when the opcode is received or the result of the requested action of the opcode results in the Media Player State characteristic being set to Inactive.
 
#define MEDIA_PROXY_CMD_CANNOT_BE_COMPLETED   0x04
 The requested action of any Media Control Point write cannot be completed successfully because of a condition within the player.
 

Search operation type values

#define MEDIA_PROXY_SEARCH_TYPE_TRACK_NAME   0x01
 Search for Track Name.
 
#define MEDIA_PROXY_SEARCH_TYPE_ARTIST_NAME   0x02
 Search for Artist Name.
 
#define MEDIA_PROXY_SEARCH_TYPE_ALBUM_NAME   0x03
 Search for Album Name.
 
#define MEDIA_PROXY_SEARCH_TYPE_GROUP_NAME   0x04
 Search for Group Name.
 
#define MEDIA_PROXY_SEARCH_TYPE_EARLIEST_YEAR   0x05
 Search for Earliest Year.
 
#define MEDIA_PROXY_SEARCH_TYPE_LATEST_YEAR   0x06
 Search for Latest Year.
 
#define MEDIA_PROXY_SEARCH_TYPE_GENRE   0x07
 Search for Genre.
 
#define MEDIA_PROXY_SEARCH_TYPE_ONLY_TRACKS   0x08
 Search for Tracks only.
 
#define MEDIA_PROXY_SEARCH_TYPE_ONLY_GROUPS   0x09
 Search for Groups only.
 

Search notification result codes

#define MEDIA_PROXY_SEARCH_SUCCESS   0x01
 Search request was accepted; search has started.
 
#define MEDIA_PROXY_SEARCH_FAILURE   0x02
 Search request was invalid; no search started.
 

Group object object types

#define MEDIA_PROXY_GROUP_OBJECT_TRACK_TYPE   0x00
 Group object type is track.
 
#define MEDIA_PROXY_GROUP_OBJECT_GROUP_TYPE   0x01
 Group object type is group.
 

Detailed Description

Media proxy module.

Since
3.0
Version
0.8.0

The media proxy module is the connection point between media players and media controllers.

A media player has (access to) media content and knows how to navigate and play this content. A media controller reads or gets information from a player and controls the player by setting player parameters and giving the player commands.

The media proxy module allows media player implementations to make themselves available to media controllers. And it allows controllers to access, and get updates from, any player.

The media proxy module allows both local and remote control of local player instances: A media controller may be a local application, or it may be a Media Control Service relaying requests from a remote Media Control Client. There may be either local or remote control, or both, or even multiple instances of each.

Macro Definition Documentation

◆ MEDIA_PROXY_CMD_CANNOT_BE_COMPLETED

#define MEDIA_PROXY_CMD_CANNOT_BE_COMPLETED   0x04

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

The requested action of any Media Control Point write cannot be completed successfully because of a condition within the player.

◆ MEDIA_PROXY_CMD_NOT_SUPPORTED

#define MEDIA_PROXY_CMD_NOT_SUPPORTED   0x02

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

An invalid or unsupported opcode was used for the Media Control Point write.

◆ MEDIA_PROXY_CMD_PLAYER_INACTIVE

#define MEDIA_PROXY_CMD_PLAYER_INACTIVE   0x03

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

The Media Player State characteristic value is Inactive when the opcode is received or the result of the requested action of the opcode results in the Media Player State characteristic being set to Inactive.

◆ MEDIA_PROXY_CMD_SUCCESS

#define MEDIA_PROXY_CMD_SUCCESS   0x01

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

Action requested by the opcode write was completed successfully.

◆ MEDIA_PROXY_GROUP_OBJECT_GROUP_TYPE

#define MEDIA_PROXY_GROUP_OBJECT_GROUP_TYPE   0x01

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

Group object type is group.

◆ MEDIA_PROXY_GROUP_OBJECT_TRACK_TYPE

#define MEDIA_PROXY_GROUP_OBJECT_TRACK_TYPE   0x00

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

Group object type is track.

◆ MEDIA_PROXY_OP_FAST_FORWARD

#define MEDIA_PROXY_OP_FAST_FORWARD   0x04

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

Fast forward the current track.

◆ MEDIA_PROXY_OP_FAST_REWIND

#define MEDIA_PROXY_OP_FAST_REWIND   0x03

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

Fast rewind the current track.

◆ MEDIA_PROXY_OP_FIRST_GROUP

#define MEDIA_PROXY_OP_FIRST_GROUP   0x42

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

Set the current group to the first group in the sequence of groups.

◆ MEDIA_PROXY_OP_FIRST_SEGMENT

#define MEDIA_PROXY_OP_FIRST_SEGMENT   0x22

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

Set the current track position to the starting position of the first segment of the current track.

◆ MEDIA_PROXY_OP_FIRST_TRACK

#define MEDIA_PROXY_OP_FIRST_TRACK   0x32

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

Set the current track to the first track based on the playing order.

◆ MEDIA_PROXY_OP_GOTO_GROUP

#define MEDIA_PROXY_OP_GOTO_GROUP   0x44

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

Set the current group to the nth group in the sequence of groups.

◆ MEDIA_PROXY_OP_GOTO_SEGMENT

#define MEDIA_PROXY_OP_GOTO_SEGMENT   0x24

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

Set the current track position to the starting position of the nth segment of the current track.

◆ MEDIA_PROXY_OP_GOTO_TRACK

#define MEDIA_PROXY_OP_GOTO_TRACK   0x34

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

Set the current track to the nth track based on the playing order.

◆ MEDIA_PROXY_OP_LAST_GROUP

#define MEDIA_PROXY_OP_LAST_GROUP   0x43

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

Set the current group to the last group in the sequence of groups.

◆ MEDIA_PROXY_OP_LAST_SEGMENT

#define MEDIA_PROXY_OP_LAST_SEGMENT   0x23

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

Set the current track position to the starting position of the last segment of the current track.

◆ MEDIA_PROXY_OP_LAST_TRACK

#define MEDIA_PROXY_OP_LAST_TRACK   0x33

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

Set the current track to the last track based on the playing order.

◆ MEDIA_PROXY_OP_MOVE_RELATIVE

#define MEDIA_PROXY_OP_MOVE_RELATIVE   0x10

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

Set a new current track position relative to the current track position.

◆ MEDIA_PROXY_OP_NEXT_GROUP

#define MEDIA_PROXY_OP_NEXT_GROUP   0x41

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

Set the current group to the next group in the sequence of groups.

◆ MEDIA_PROXY_OP_NEXT_SEGMENT

#define MEDIA_PROXY_OP_NEXT_SEGMENT   0x21

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

Set the current track position to the starting position of the next segment of the current track.

◆ MEDIA_PROXY_OP_NEXT_TRACK

#define MEDIA_PROXY_OP_NEXT_TRACK   0x31

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

Set the current track to the next track based on the playing order.

◆ MEDIA_PROXY_OP_PAUSE

#define MEDIA_PROXY_OP_PAUSE   0x02

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

Pause playing the current track.

◆ MEDIA_PROXY_OP_PLAY

#define MEDIA_PROXY_OP_PLAY   0x01

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

Start playing the current track.

◆ MEDIA_PROXY_OP_PREV_GROUP

#define MEDIA_PROXY_OP_PREV_GROUP   0x40

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

Set the current group to the previous group in the sequence of groups.

◆ MEDIA_PROXY_OP_PREV_SEGMENT

#define MEDIA_PROXY_OP_PREV_SEGMENT   0x20

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

Set the current track position to the starting position of the previous segment of the current track.

◆ MEDIA_PROXY_OP_PREV_TRACK

#define MEDIA_PROXY_OP_PREV_TRACK   0x30

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

Set the current track to the previous track based on the playing order.

◆ MEDIA_PROXY_OP_STOP

#define MEDIA_PROXY_OP_STOP   0x05

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

Stop current activity and return to the paused state and set the current track position to the start of the current track.

◆ MEDIA_PROXY_OP_SUP_FAST_FORWARD

#define MEDIA_PROXY_OP_SUP_FAST_FORWARD   BIT(3)

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

Support the Fast Forward opcode.

◆ MEDIA_PROXY_OP_SUP_FAST_REWIND

#define MEDIA_PROXY_OP_SUP_FAST_REWIND   BIT(2)

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

Support the Fast Rewind opcode.

◆ MEDIA_PROXY_OP_SUP_FIRST_GROUP

#define MEDIA_PROXY_OP_SUP_FIRST_GROUP   BIT(18)

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

Support the First Group opcode.

◆ MEDIA_PROXY_OP_SUP_FIRST_SEGMENT

#define MEDIA_PROXY_OP_SUP_FIRST_SEGMENT   BIT(8)

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

Support the First Segment opcode.

◆ MEDIA_PROXY_OP_SUP_FIRST_TRACK

#define MEDIA_PROXY_OP_SUP_FIRST_TRACK   BIT(13)

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

Support the First Track opcode.

◆ MEDIA_PROXY_OP_SUP_GOTO_GROUP

#define MEDIA_PROXY_OP_SUP_GOTO_GROUP   BIT(20)

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

Support the Goto Group opcode.

◆ MEDIA_PROXY_OP_SUP_GOTO_SEGMENT

#define MEDIA_PROXY_OP_SUP_GOTO_SEGMENT   BIT(10)

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

Support the Goto Segment opcode.

◆ MEDIA_PROXY_OP_SUP_GOTO_TRACK

#define MEDIA_PROXY_OP_SUP_GOTO_TRACK   BIT(15)

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

Support the Goto Track opcode.

◆ MEDIA_PROXY_OP_SUP_LAST_GROUP

#define MEDIA_PROXY_OP_SUP_LAST_GROUP   BIT(19)

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

Support the Last Group opcode.

◆ MEDIA_PROXY_OP_SUP_LAST_SEGMENT

#define MEDIA_PROXY_OP_SUP_LAST_SEGMENT   BIT(9)

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

Support the Last Segment opcode.

◆ MEDIA_PROXY_OP_SUP_LAST_TRACK

#define MEDIA_PROXY_OP_SUP_LAST_TRACK   BIT(14)

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

Support the Last Track opcode.

◆ MEDIA_PROXY_OP_SUP_MOVE_RELATIVE

#define MEDIA_PROXY_OP_SUP_MOVE_RELATIVE   BIT(5)

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

Support the Move Relative opcode.

◆ MEDIA_PROXY_OP_SUP_NEXT_GROUP

#define MEDIA_PROXY_OP_SUP_NEXT_GROUP   BIT(17)

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

Support the Next Group opcode.

◆ MEDIA_PROXY_OP_SUP_NEXT_SEGMENT

#define MEDIA_PROXY_OP_SUP_NEXT_SEGMENT   BIT(7)

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

Support the Next Segment opcode.

◆ MEDIA_PROXY_OP_SUP_NEXT_TRACK

#define MEDIA_PROXY_OP_SUP_NEXT_TRACK   BIT(12)

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

Support the Next Track opcode.

◆ MEDIA_PROXY_OP_SUP_PAUSE

#define MEDIA_PROXY_OP_SUP_PAUSE   BIT(1)

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

Support the Pause opcode.

◆ MEDIA_PROXY_OP_SUP_PLAY

#define MEDIA_PROXY_OP_SUP_PLAY   BIT(0)

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

Media player supported command opcodes.

Support the Play opcode

◆ MEDIA_PROXY_OP_SUP_PREV_GROUP

#define MEDIA_PROXY_OP_SUP_PREV_GROUP   BIT(16)

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

Support the Previous Group opcode.

◆ MEDIA_PROXY_OP_SUP_PREV_SEGMENT

#define MEDIA_PROXY_OP_SUP_PREV_SEGMENT   BIT(6)

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

Support the Previous Segment opcode.

◆ MEDIA_PROXY_OP_SUP_PREV_TRACK

#define MEDIA_PROXY_OP_SUP_PREV_TRACK   BIT(11)

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

Support the Previous Track opcode.

◆ MEDIA_PROXY_OP_SUP_STOP

#define MEDIA_PROXY_OP_SUP_STOP   BIT(4)

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

Support the Stop opcode.

◆ MEDIA_PROXY_OPCODES_SUPPORTED_LEN

#define MEDIA_PROXY_OPCODES_SUPPORTED_LEN   4

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

Media player supported opcodes length.

◆ MEDIA_PROXY_PLAYBACK_SPEED_DOUBLE

#define MEDIA_PROXY_PLAYBACK_SPEED_DOUBLE   64

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

Double playback speed, resulting in 200 % speed.

◆ MEDIA_PROXY_PLAYBACK_SPEED_HALF

#define MEDIA_PROXY_PLAYBACK_SPEED_HALF   -64

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

Half playback speed, resulting in 50 % speed.

◆ MEDIA_PROXY_PLAYBACK_SPEED_MAX

#define MEDIA_PROXY_PLAYBACK_SPEED_MAX   127

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

Max playback speed, resulting in 395.7 % speed (nearly 400 %)

◆ MEDIA_PROXY_PLAYBACK_SPEED_MIN

#define MEDIA_PROXY_PLAYBACK_SPEED_MIN   -128

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

Minimum playback speed, resulting in 25 % speed.

◆ MEDIA_PROXY_PLAYBACK_SPEED_QUARTER

#define MEDIA_PROXY_PLAYBACK_SPEED_QUARTER   -128

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

Quarter playback speed, resulting in 25 % speed.

◆ MEDIA_PROXY_PLAYBACK_SPEED_UNITY

#define MEDIA_PROXY_PLAYBACK_SPEED_UNITY   0

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

Unity playback speed, resulting in 100 % speed.

◆ MEDIA_PROXY_PLAYING_ORDER_INORDER_ONCE

#define MEDIA_PROXY_PLAYING_ORDER_INORDER_ONCE   0x03

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

The tracks within a group are played once in track order.

◆ MEDIA_PROXY_PLAYING_ORDER_INORDER_REPEAT

#define MEDIA_PROXY_PLAYING_ORDER_INORDER_REPEAT   0x04

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

The tracks within a group are played in track order repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDER_NEWEST_ONCE

#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_ONCE   0x07

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

The tracks within a group are played once only from the newest first.

◆ MEDIA_PROXY_PLAYING_ORDER_NEWEST_REPEAT

#define MEDIA_PROXY_PLAYING_ORDER_NEWEST_REPEAT   0x08

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

The tracks within a group are played from the newest first repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDER_OLDEST_ONCE

#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_ONCE   0x05

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

The tracks within a group are played once only from the oldest first.

◆ MEDIA_PROXY_PLAYING_ORDER_OLDEST_REPEAT

#define MEDIA_PROXY_PLAYING_ORDER_OLDEST_REPEAT   0x06

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

The tracks within a group are played from the oldest first repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_ONCE

#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_ONCE   0x09

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

The tracks within a group are played in random order once.

◆ MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_REPEAT

#define MEDIA_PROXY_PLAYING_ORDER_SHUFFLE_REPEAT   0x0a

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

The tracks within a group are played in random order repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDER_SINGLE_ONCE

#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_ONCE   0x01

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

A single track is played once; there is no next track.

◆ MEDIA_PROXY_PLAYING_ORDER_SINGLE_REPEAT

#define MEDIA_PROXY_PLAYING_ORDER_SINGLE_REPEAT   0x02

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

A single track is played repeatedly; the next track is the current track.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE   BIT(2)

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

The tracks within a group are played once in track order.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT   BIT(3)

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

The tracks within a group are played in track order repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE   BIT(6)

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

The tracks within a group are played once only from the newest first.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT   BIT(7)

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

The tracks within a group are played from the newest first repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE   BIT(4)

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

The tracks within a group are played once only from the oldest first.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT   BIT(5)

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

The tracks within a group are played from the oldest first repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE   BIT(8)

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

The tracks within a group are played in random order once.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT   BIT(9)

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

The tracks within a group are played in random order repeatedly.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE   BIT(0)

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

A single track is played once; there is no next track.

◆ MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT

#define MEDIA_PROXY_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT   BIT(1)

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

A single track is played repeatedly; the next track is the current track.

◆ MEDIA_PROXY_SEARCH_FAILURE

#define MEDIA_PROXY_SEARCH_FAILURE   0x02

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

Search request was invalid; no search started.

◆ MEDIA_PROXY_SEARCH_SUCCESS

#define MEDIA_PROXY_SEARCH_SUCCESS   0x01

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

Search request was accepted; search has started.

◆ MEDIA_PROXY_SEARCH_TYPE_ALBUM_NAME

#define MEDIA_PROXY_SEARCH_TYPE_ALBUM_NAME   0x03

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

Search for Album Name.

◆ MEDIA_PROXY_SEARCH_TYPE_ARTIST_NAME

#define MEDIA_PROXY_SEARCH_TYPE_ARTIST_NAME   0x02

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

Search for Artist Name.

◆ MEDIA_PROXY_SEARCH_TYPE_EARLIEST_YEAR

#define MEDIA_PROXY_SEARCH_TYPE_EARLIEST_YEAR   0x05

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

Search for Earliest Year.

◆ MEDIA_PROXY_SEARCH_TYPE_GENRE

#define MEDIA_PROXY_SEARCH_TYPE_GENRE   0x07

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

Search for Genre.

◆ MEDIA_PROXY_SEARCH_TYPE_GROUP_NAME

#define MEDIA_PROXY_SEARCH_TYPE_GROUP_NAME   0x04

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

Search for Group Name.

◆ MEDIA_PROXY_SEARCH_TYPE_LATEST_YEAR

#define MEDIA_PROXY_SEARCH_TYPE_LATEST_YEAR   0x06

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

Search for Latest Year.

◆ MEDIA_PROXY_SEARCH_TYPE_ONLY_GROUPS

#define MEDIA_PROXY_SEARCH_TYPE_ONLY_GROUPS   0x09

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

Search for Groups only.

◆ MEDIA_PROXY_SEARCH_TYPE_ONLY_TRACKS

#define MEDIA_PROXY_SEARCH_TYPE_ONLY_TRACKS   0x08

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

Search for Tracks only.

◆ MEDIA_PROXY_SEARCH_TYPE_TRACK_NAME

#define MEDIA_PROXY_SEARCH_TYPE_TRACK_NAME   0x01

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

Search for Track Name.

◆ MEDIA_PROXY_SEEKING_SPEED_FACTOR_MAX

#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MAX   64

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

Maximum seeking speed - Can be negated.

◆ MEDIA_PROXY_SEEKING_SPEED_FACTOR_MIN

#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_MIN   4

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

Minimum seeking speed - Can be negated.

◆ MEDIA_PROXY_SEEKING_SPEED_FACTOR_ZERO

#define MEDIA_PROXY_SEEKING_SPEED_FACTOR_ZERO   0

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

No seeking.

◆ MEDIA_PROXY_STATE_INACTIVE

#define MEDIA_PROXY_STATE_INACTIVE   0x00

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

The current track is invalid, and no track has been selected.

◆ MEDIA_PROXY_STATE_LAST

#define MEDIA_PROXY_STATE_LAST   0x04

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

Used internally as the last state value.

◆ MEDIA_PROXY_STATE_PAUSED

#define MEDIA_PROXY_STATE_PAUSED   0x02

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

The current track is paused.

The media player has a current track, but it is not being played

◆ MEDIA_PROXY_STATE_PLAYING

#define MEDIA_PROXY_STATE_PLAYING   0x01

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

The media player is playing the current track.

◆ MEDIA_PROXY_STATE_SEEKING

#define MEDIA_PROXY_STATE_SEEKING   0x03

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

The current track is fast forwarding or fast rewinding.

Function Documentation

◆ bt_mcs_get_ots()

struct bt_ots * bt_mcs_get_ots ( void )

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

Get the pointer of the Object Transfer Service used by the Media Control Service.

TODO: Find best location for this call, and move this one also

◆ media_proxy_ctrl_discover_player()

int media_proxy_ctrl_discover_player ( struct bt_conn * conn)

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

Discover a remote media player.

Discover a remote media player instance. The remote player instance will be discovered, and accessed, using Bluetooth, via the media control client and a remote media control service. This call will start a GATT discovery of the Media Control Service on the peer, and setup handles and subscriptions.

This shall be called once before any other actions can be executed for the remote player. The remote player instance will be returned in the discover_player() callback.

Parameters
connThe connection to do discovery for
Returns
0 if success, errno on failure

◆ media_proxy_ctrl_get_commands_supported()

int media_proxy_ctrl_get_commands_supported ( struct media_player * player)

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

Read Commands Supported.

Read a bitmap containing the media player's supported command opcodes.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_content_ctrl_id()

uint8_t media_proxy_ctrl_get_content_ctrl_id ( struct media_player * player)

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

Read Content Control ID.

The content control ID identifies a content control service on a device, and links it to the corresponding audio stream.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_current_group_id()

int media_proxy_ctrl_get_current_group_id ( struct media_player * player)

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

Read Current Group Object ID.

Get an ID (48 bit) that can be used to retrieve the Current Track Object from an Object Transfer Service

See the Media Control Service spec v1.0 sections 3.14 and 4.4 for a description of the Current Group Object.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_current_track_id()

int media_proxy_ctrl_get_current_track_id ( struct media_player * player)

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

Read Current Track Object ID.

Get an ID (48 bit) that can be used to retrieve the Current Track Object from an Object Transfer Service

See the Media Control Service spec v1.0 sections 3.11 and 4.3 for a description of the Current Track Object.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_icon_id()

int media_proxy_ctrl_get_icon_id ( struct media_player * player)

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

Read Icon Object ID.

Get an ID (48 bit) that can be used to retrieve the Icon Object from an Object Transfer Service

See the Media Control Service spec v1.0 sections 3.2 and 4.1 for a description of the Icon Object.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_icon_url()

int media_proxy_ctrl_get_icon_url ( struct media_player * player)

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

Read Icon URL.

Get a URL to the media player's icon.

Parameters
playerMedia player instance pointer

◆ media_proxy_ctrl_get_media_state()

int media_proxy_ctrl_get_media_state ( struct media_player * player)

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

Read Media State.

Read the media player's state

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_next_track_id()

int media_proxy_ctrl_get_next_track_id ( struct media_player * player)

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

Read Next Track Object ID.

Get an ID (48 bit) that can be used to retrieve the Next Track Object from an Object Transfer Service

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_parent_group_id()

int media_proxy_ctrl_get_parent_group_id ( struct media_player * player)

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

Read Parent Group Object ID.

Get an ID (48 bit) that can be used to retrieve the Parent Track Object from an Object Transfer Service

The parent group is the parent of the current group.

See the Media Control Service spec v1.0 sections 3.14 and 4.4 for a description of the Current Track Object.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_playback_speed()

int media_proxy_ctrl_get_playback_speed ( struct media_player * player)

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

Get Playback Speed.

The playback speed parameter is related to the actual playback speed as follows: actual playback speed = 2^(speed_parameter/64)

A speed parameter of 0 corresponds to unity speed playback (i.e. playback at "normal" speed). A speed parameter of -128 corresponds to playback at one fourth of normal speed, 127 corresponds to playback at almost four times the normal speed.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_player_name()

int media_proxy_ctrl_get_player_name ( struct media_player * player)

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

Read Media Player Name.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_playing_order()

int media_proxy_ctrl_get_playing_order ( struct media_player * player)

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

Read Playing Order.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_playing_orders_supported()

int media_proxy_ctrl_get_playing_orders_supported ( struct media_player * player)

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

Read Playing Orders Supported.

Read a bitmap containing the media player's supported playing orders.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_search_results_id()

int media_proxy_ctrl_get_search_results_id ( struct media_player * player)

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

Read Search Results Object ID.

Get an ID (48 bit) that can be used to retrieve the Search Results Object from an Object Transfer Service

The search results object is a group object. The search results object only exists if a successful search operation has been done.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_seeking_speed()

int media_proxy_ctrl_get_seeking_speed ( struct media_player * player)

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

Get Seeking Speed.

The seeking speed gives the speed with which the player is seeking. It is a factor, relative to real-time playback speed - a factor four means seeking happens at four times the real-time playback speed. Positive values are for forward seeking, negative values for backwards seeking.

The seeking speed is not settable - a non-zero seeking speed is the result of "fast rewind" of "fast forward" commands.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_track_duration()

int media_proxy_ctrl_get_track_duration ( struct media_player * player)

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

Read Track Duration.

The duration of a track is measured in hundredths of a second.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_track_position()

int media_proxy_ctrl_get_track_position ( struct media_player * player)

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

Read Track Position.

The position of the player (the playing position) is measured in hundredths of a second from the beginning of the track

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_track_segments_id()

int media_proxy_ctrl_get_track_segments_id ( struct media_player * player)

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

Read Current Track Segments Object ID.

Get an ID (48 bit) that can be used to retrieve the Current Track Segments Object from an Object Transfer Service

See the Media Control Service spec v1.0 sections 3.10 and 4.2 for a description of the Track Segments Object.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_get_track_title()

int media_proxy_ctrl_get_track_title ( struct media_player * player)

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

Read Track Title.

Parameters
playerMedia player instance pointer
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_register()

int media_proxy_ctrl_register ( struct media_proxy_ctrl_cbs * ctrl_cbs)

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

Register a controller with the media_proxy.

Parameters
ctrl_cbsCallbacks to the controller
Returns
0 if success, errno on failure

◆ media_proxy_ctrl_send_command()

int media_proxy_ctrl_send_command ( struct media_player * player,
const struct mpl_cmd * command )

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

Send Command.

Send a command to the media player. Commands may cause the media player to change its state May result in two callbacks - one for the actual sending of the command to the player, one for the result of the command from the player.

Parameters
playerMedia player instance pointer
commandThe command to send
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_send_search()

int media_proxy_ctrl_send_search ( struct media_player * player,
const struct mpl_search * search )

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

Set Search.

Write a search to the media player. If the search is successful, the search results will be available as a group object in the Object Transfer Service (OTS).

May result in up to three callbacks

  • one for the actual sending of the search to the player
  • one for the result code for the search from the player
  • if the search is successful, one for the search results object ID in the OTs

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
searchThe search to write
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_current_group_id()

int media_proxy_ctrl_set_current_group_id ( struct media_player * player,
uint64_t id )

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

Set Current Group Object ID.

Change the player's current group to the group given by the ID, and the current track to the first track in that group.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
idThe ID of a group object
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_current_track_id()

int media_proxy_ctrl_set_current_track_id ( struct media_player * player,
uint64_t id )

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

Set Current Track Object ID.

Change the player's current track to the track given by the ID. (Behaves similarly to the goto track command.)

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
idThe ID of a track object
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_next_track_id()

int media_proxy_ctrl_set_next_track_id ( struct media_player * player,
uint64_t id )

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

Set Next Track Object ID.

Change the player's next track to the track given by the ID.

Requires Object Transfer Service

Parameters
playerMedia player instance pointer
idThe ID of a track object
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_playback_speed()

int media_proxy_ctrl_set_playback_speed ( struct media_player * player,
int8_t speed )

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

Set Playback Speed.

See the get_playback_speed() function for an explanation of the playback speed parameter.

Note that the media player may not support all possible values of the playback speed parameter. If the value given is not supported, and is higher than the current value, the player should set the playback speed to the next higher supported value. (And correspondingly to the next lower supported value for given values lower than the current value.)

Parameters
playerMedia player instance pointer
speedThe playback speed parameter to set
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_playing_order()

int media_proxy_ctrl_set_playing_order ( struct media_player * player,
uint8_t order )

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

Set Playing Order.

Set the media player's playing order

Parameters
playerMedia player instance pointer
orderThe playing order to set
Returns
0 if success, errno on failure.

◆ media_proxy_ctrl_set_track_position()

int media_proxy_ctrl_set_track_position ( struct media_player * player,
int32_t position )

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

Set Track Position.

Set the playing position of the media player in the current track. The position is given in hundredths of a second, from the beginning of the track of the track for positive values, and (backwards) from the end of the track for negative values.

Parameters
playerMedia player instance pointer
positionThe track position to set
Returns
0 if success, errno on failure.

◆ media_proxy_pl_command_cb()

void media_proxy_pl_command_cb ( const struct mpl_cmd_ntf * cmd_ntf)

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

Command callback.

To be called when a command has been sent, to notify whether the command was successfully performed or not. See the MEDIA_PROXY_CMD_* result code defines.

Parameters
cmd_ntfThe result of the command

◆ media_proxy_pl_commands_supported_cb()

void media_proxy_pl_commands_supported_cb ( uint32_t opcodes)

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

Commands supported callback.

To be called when the set of commands supported is changed

Parameters
opcodesThe supported commands opcodes

◆ media_proxy_pl_current_group_id_cb()

void media_proxy_pl_current_group_id_cb ( uint64_t id)

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

Current group object ID callback.

To be called when the ID of the current group is changed

Parameters
idThe ID of the current group object in the OTS

◆ media_proxy_pl_current_track_id_cb()

void media_proxy_pl_current_track_id_cb ( uint64_t id)

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

Current track object ID callback.

To be called when the ID of the current track is changed (e.g. due to a track change).

Parameters
idThe ID of the current track object in the OTS

◆ media_proxy_pl_icon_url_cb()

void media_proxy_pl_icon_url_cb ( const char * url)

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

Player icon URL changed callback.

To be called when the player's icon URL is changed.

Parameters
urlThe URL of the player's icon

◆ media_proxy_pl_init()

int media_proxy_pl_init ( void )

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

Initialize player.

TODO: Move to player header file

◆ media_proxy_pl_media_state_cb()

void media_proxy_pl_media_state_cb ( uint8_t state)

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

Media state callback.

To be called when the media state is changed

Parameters
stateThe media player's state

◆ media_proxy_pl_name_cb()

void media_proxy_pl_name_cb ( const char * name)

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

Player name changed callback.

To be called when the player's name is changed.

Parameters
nameThe name of the player

◆ media_proxy_pl_next_track_id_cb()

void media_proxy_pl_next_track_id_cb ( uint64_t id)

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

Next track object ID callback.

To be called when the ID of the current track is changes

Parameters
idThe ID of the next track object in the OTS

◆ media_proxy_pl_parent_group_id_cb()

void media_proxy_pl_parent_group_id_cb ( uint64_t id)

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

Parent group object ID callback.

To be called when the ID of the parent group is changed

Parameters
idThe ID of the parent group object in the OTS

◆ media_proxy_pl_playback_speed_cb()

void media_proxy_pl_playback_speed_cb ( int8_t speed)

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

Playback speed callback.

To be called when the playback speed is changed.

Parameters
speedThe playback speed parameter

◆ media_proxy_pl_playing_order_cb()

void media_proxy_pl_playing_order_cb ( uint8_t order)

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

Playing order callback.

To be called when the playing order is changed

Parameters
orderThe playing order

◆ media_proxy_pl_register()

int media_proxy_pl_register ( struct media_proxy_pl_calls * pl_calls)

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

Register a player with the media proxy.

Register a player with the media proxy module, for use by media controllers.

The media proxy may call any non-NULL function pointers in the supplied media_proxy_pl_calls structure.

Parameters
pl_callsFunction pointers to the media player's calls
Returns
0 if success, errno on failure

◆ media_proxy_pl_search_cb()

void media_proxy_pl_search_cb ( uint8_t result_code)

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

Search callback.

To be called when a search has been set to notify whether the search was successfully performed or not. See the MEDIA_PROXY_SEARCH_* result code defines.

The actual results of the search, if successful, can be found in the search results object.

Parameters
result_codeThe result (success or failure) of the search

◆ media_proxy_pl_search_results_id_cb()

void media_proxy_pl_search_results_id_cb ( uint64_t id)

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

Search Results object ID callback.

To be called when the ID of the search results is changed (typically as the result of a new successful search).

Parameters
idThe ID of the search results object in the OTS

◆ media_proxy_pl_seeking_speed_cb()

void media_proxy_pl_seeking_speed_cb ( int8_t speed)

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

Seeking speed callback.

To be called when the seeking speed is changed.

Parameters
speedThe seeking speed factor

◆ media_proxy_pl_track_changed_cb()

void media_proxy_pl_track_changed_cb ( void )

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

Track changed callback.

To be called when the player's current track is changed

◆ media_proxy_pl_track_duration_cb()

void media_proxy_pl_track_duration_cb ( int32_t duration)

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

Track duration callback.

To be called when the current track's duration is changed (e.g. due to a track change)

The track duration is given in hundredths of a second.

Parameters
durationThe track duration

◆ media_proxy_pl_track_position_cb()

void media_proxy_pl_track_position_cb ( int32_t position)

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

Track position callback.

To be called when the media player's position in the track is changed, or when the player is paused or similar.

Exception: This callback should not be called when the position changes during regular playback, i.e. while the player is playing and playback happens at a constant speed.

The track position is given in hundredths of a second from the start of the track.

Parameters
positionThe media player's position in the track

◆ media_proxy_pl_track_title_cb()

void media_proxy_pl_track_title_cb ( char * title)

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

Track title callback.

To be called when the player's current track is changed

Parameters
titleThe title of the track