|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
| int bt_mcp_media_control_server_command | ( | const struct bt_mcs_cmd * | command | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Execute Command.
Execute a command in the Media Control Server. Commands may cause the media player to change its state
| command | The command to execute |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | command was NULL |
| int bt_mcp_media_control_server_get_ccid | ( | uint8_t * | ccid | ) |
#include <zephyr/bluetooth/audio/mcp.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.
| [out] | ccid | Variable to store the resulting CCID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | ccid was NULL |
| int bt_mcp_media_control_server_get_commands_supported | ( | uint32_t * | opcodes | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Commands Supported.
Read a bitmap containing the media player's supported command opcodes.
| [out] | opcodes | Variable to store the resulting supported opcodes in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | opcodes was NULL |
| int bt_mcp_media_control_server_get_current_group_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| -ENOENT | The player has not current group |
| int bt_mcp_media_control_server_get_current_track_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_get_icon_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| int bt_mcp_media_control_server_get_icon_url | ( | char * | url, |
| size_t | url_size ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Icon URL.
Get a URL to the media player's icon.
| [out] | url | Buffer to store the URL in |
| [in] | url_size | Size of the url buffer |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | url was NULL |
| -ENOMEM | url_size was lower than the length of the icon URL |
| int bt_mcp_media_control_server_get_media_state | ( | uint8_t * | state | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Media State.
Read the media player's state
| [out] | state | Variable to store the resulting state in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | state was NULL |
| int bt_mcp_media_control_server_get_next_track_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_get_parent_group_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_get_playback_speed | ( | int8_t * | speed | ) |
#include <zephyr/bluetooth/audio/mcp.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.
| [out] | speed | Variable to store the resulting speed in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | speed was NULL |
| int bt_mcp_media_control_server_get_player_name | ( | char * | name, |
| size_t | name_size ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Media Player Name.
| [out] | name | Buffer to store the name in |
| [in] | name_size | Size of the name buffer |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | name was NULL |
| -ENOMEM | name_size was lower than the length of the current player name |
| int bt_mcp_media_control_server_get_playing_order | ( | uint8_t * | order | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Playing Order.
| [out] | order | Variable to store the resulting playing order in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | order was NULL |
| int bt_mcp_media_control_server_get_playing_orders_supported | ( | uint16_t * | orders | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Playing Orders Supported.
Read a bitmap containing the media player's supported playing orders.
| [out] | orders | Variable to store the resulting playing orders supported in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | orders was NULL |
| int bt_mcp_media_control_server_get_search_results_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| int bt_mcp_media_control_server_get_seeking_speed | ( | int8_t * | speed | ) |
#include <zephyr/bluetooth/audio/mcp.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.
| [out] | speed | Variable to store the resulting speed in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | speed was NULL |
| int bt_mcp_media_control_server_get_track_duration | ( | int32_t * | duration | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Track Duration.
The duration of a track is measured in hundredths of a second.
| [out] | duration | Variable to store the resulting duration in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | duration was NULL |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_get_track_position | ( | int32_t * | position | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | position | Variable to store the resulting position in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | position was NULL |
| int bt_mcp_media_control_server_get_track_segments_id | ( | uint64_t * | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| [out] | id | Variable to store the resulting ID in |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was NULL |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_get_track_title | ( | char * | track_title, |
| size_t | track_title_size ) |
#include <zephyr/bluetooth/audio/mcp.h>
Read Track Title.
| [out] | track_title | Buffer to store the track title in |
| [in] | track_title_size | Size of the track_title buffer |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | track_title was NULL |
| -ENOMEM | track_title_size was lower than the length of the track_title |
| -ENOENT | The player has not current group or track |
| int bt_mcp_media_control_server_register | ( | void | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Register the Media Control Server.
This will register the Generic Media Control Service (GMCS).
| 0 | Success |
| -EBUSY | Registration already in progress |
| -EALREADY | Already registered |
| -ENOMEM | Could not allocate any more content control services |
| int bt_mcp_media_control_server_search_command | ( | const struct bt_mcs_search * | search | ) |
#include <zephyr/bluetooth/audio/mcp.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).
The search is processed synchronously. Retrieve the results object ID with bt_mcp_media_control_server_get_search_results_id() after this call returns.
Requires Object Transfer Service
| search | The search command to execute |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | search was NULL |
| int bt_mcp_media_control_server_set_current_group_id | ( | uint64_t | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| id | The id parameter to set (between BT_OTS_OBJ_ID_MIN and BT_OTS_OBJ_ID_MAX). |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was invalid |
| -ENOENT | The player has not current group |
| int bt_mcp_media_control_server_set_current_track_id | ( | uint64_t | id | ) |
#include <zephyr/bluetooth/audio/mcp.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
| id | The id parameter to set (between BT_OTS_OBJ_ID_MIN and BT_OTS_OBJ_ID_MAX). |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was invalid |
| int bt_mcp_media_control_server_set_next_track_id | ( | uint64_t | id | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Set Next Track Object ID.
Change the player's next track to the track given by the ID.
Requires Object Transfer Service
| id | The id parameter to set (between BT_OTS_OBJ_ID_MIN and BT_OTS_OBJ_ID_MAX). |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | id was invalid |
| int bt_mcp_media_control_server_set_playback_speed | ( | int8_t | speed | ) |
#include <zephyr/bluetooth/audio/mcp.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.)
| speed | The playback speed parameter to set |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| int bt_mcp_media_control_server_set_player_name | ( | const char * | name | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Set Media Player Name.
| name | The media player name to set |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -EINVAL | name was NULL |
| -ENOMEM | name is too large |
| int bt_mcp_media_control_server_set_playing_order | ( | uint8_t | order | ) |
#include <zephyr/bluetooth/audio/mcp.h>
Set Playing Order.
Set the media player's playing order
| order | The playing order to set |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| int bt_mcp_media_control_server_set_track_position | ( | int32_t | position | ) |
#include <zephyr/bluetooth/audio/mcp.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.
| position | The track position to set |
| 0 | Success |
| -ENODEV | Media player has not been initialized by bt_mcp_media_control_server_register() |
| -ENOENT | The player has not current group or track |