|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Media Control Service (MCS). More...
Data Structures | |
| struct | bt_mcs_cmd |
| Media player command. More... | |
| struct | bt_mcs_sci |
| Search control item. More... | |
| struct | bt_mcs_search |
| Search. More... | |
| struct | bt_mcs_cmd_ntf |
| Media command notification. More... | |
| struct | bt_mcs_cb |
| Callbacks when information about the player is requested via MCS. More... | |
Macros | |
| #define | BT_MCS_SEARCH_LEN_MIN 2 |
| Search control point minimum length. | |
| #define | BT_MCS_SEARCH_LEN_MAX 64 |
| Search control point maximum length. | |
| #define | BT_MCS_ERR_LONG_VAL_CHANGED 0x80U |
| A characteristic value has changed while a Read Long Value Characteristic sub-procedure is in progress. | |
| #define | BT_MCS_OPCODES_SUPPORTED_LEN 4U |
| Media control point supported opcodes length. | |
| #define | BT_MCS_SEARCH_SCI_LEN_MIN 1 |
| Search control point item (SCI) minimum length. | |
| #define | BT_MCS_SEARCH_PARAM_MAX 62 |
| Search parameters maximum length. | |
Functions | |
| struct bt_ots * | bt_mcs_get_ots (void) |
| Get the pointer of the Object Transfer Service used by the Media Control Service. | |
| int | bt_mcs_init (struct bt_ots_cb *ots_cbs) |
| Initialize MCS. | |
| int | bt_mcs_register_cb (struct bt_mcs_cb *cbs) |
| Register Media Control Service callbacks. | |
| void | bt_mcs_player_name_changed (void) |
| Player name changed callback. | |
| void | bt_mcs_icon_url_changed (void) |
| Player icon URL changed callback. | |
| void | bt_mcs_track_changed (void) |
| Track changed callback. | |
| void | bt_mcs_track_title_changed (void) |
| Track title callback. | |
| void | bt_mcs_track_position_changed (void) |
| Track position callback. | |
| void | bt_mcs_track_duration_changed (void) |
| Track duration callback. | |
| void | bt_mcs_playback_speed_changed (void) |
| Playback speed callback. | |
| void | bt_mcs_seeking_speed_changed (void) |
| Seeking speed callback. | |
| void | bt_mcs_current_track_id_changed (void) |
| Current track object ID callback. | |
| void | bt_mcs_next_track_id_changed (void) |
| Next track object ID callback. | |
| void | bt_mcs_parent_group_id_changed (void) |
| Parent group object ID callback. | |
| void | bt_mcs_current_group_id_changed (void) |
| Current group object ID callback. | |
| void | bt_mcs_playing_order_changed (void) |
| Playing order callback. | |
| void | bt_mcs_media_state_changed (void) |
| Media state callback. | |
| void | bt_mcs_commands_supported_changed (void) |
| Commands supported callback. | |
| void | bt_mcs_search_results_id_changed (void) |
| Search Results object ID callback. | |
| void | bt_mcs_command_complete (const struct bt_mcs_cmd_ntf *cmd_ntf) |
| Command callback. | |
| void | bt_mcs_search_complete (uint8_t result_code) |
| Search callback. | |
Playback speeds | |
The playback speed (s) is calculated by the value of 2 to the power of p divided by 64. All values from -128 to 127 allowed, only some examples defined. | |
| #define | BT_MCS_PLAYBACK_SPEED_MIN -128 |
| Minimum playback speed, resulting in 25 % speed. | |
| #define | BT_MCS_PLAYBACK_SPEED_QUARTER -128 |
| Quarter playback speed, resulting in 25 % speed. | |
| #define | BT_MCS_PLAYBACK_SPEED_HALF -64 |
| Half playback speed, resulting in 50 % speed. | |
| #define | BT_MCS_PLAYBACK_SPEED_UNITY 0 |
| Unity playback speed, resulting in 100 % speed. | |
| #define | BT_MCS_PLAYBACK_SPEED_DOUBLE 64 |
| Double playback speed, resulting in 200 % speed. | |
| #define | BT_MCS_PLAYBACK_SPEED_MAX 127 |
| Max playback speed, resulting in 395.7 % speed (nearly 400 %). | |
Seeking speed | |
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 | BT_MCS_SEEKING_SPEED_FACTOR_MAX 64 |
| Maximum seeking speed - Can be negated. | |
| #define | BT_MCS_SEEKING_SPEED_FACTOR_MIN 4 |
| Minimum seeking speed - Can be negated. | |
| #define | BT_MCS_SEEKING_SPEED_FACTOR_ZERO 0 |
| No seeking. | |
Playing orders | |
| #define | BT_MCS_PLAYING_ORDER_SINGLE_ONCE 0x01U |
| A single track is played once; there is no next track. | |
| #define | BT_MCS_PLAYING_ORDER_SINGLE_REPEAT 0x02U |
| A single track is played repeatedly; the next track is the current track. | |
| #define | BT_MCS_PLAYING_ORDER_INORDER_ONCE 0x03U |
| The tracks within a group are played once in track order. | |
| #define | BT_MCS_PLAYING_ORDER_INORDER_REPEAT 0x04U |
| The tracks within a group are played in track order repeatedly. | |
| #define | BT_MCS_PLAYING_ORDER_OLDEST_ONCE 0x05U |
| The tracks within a group are played once only from the oldest first. | |
| #define | BT_MCS_PLAYING_ORDER_OLDEST_REPEAT 0x06U |
| The tracks within a group are played from the oldest first repeatedly. | |
| #define | BT_MCS_PLAYING_ORDER_NEWEST_ONCE 0x07U |
| The tracks within a group are played once only from the newest first. | |
| #define | BT_MCS_PLAYING_ORDER_NEWEST_REPEAT 0x08U |
| The tracks within a group are played from the newest first repeatedly. | |
| #define | BT_MCS_PLAYING_ORDER_SHUFFLE_ONCE 0x09U |
| The tracks within a group are played in random order once. | |
| #define | BT_MCS_PLAYING_ORDER_SHUFFLE_REPEAT 0x0AU |
| 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 | BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE BIT(0U) |
| A single track is played once; there is no next track. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT BIT(1U) |
| A single track is played repeatedly; the next track is the current track. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE BIT(2U) |
| The tracks within a group are played once in track order. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT BIT(3U) |
| The tracks within a group are played in track order repeatedly. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE BIT(4U) |
| The tracks within a group are played once only from the oldest first. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT BIT(5U) |
| The tracks within a group are played from the oldest first repeatedly. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE BIT(6U) |
| The tracks within a group are played once only from the newest first. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT BIT(7U) |
| The tracks within a group are played from the newest first repeatedly. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE BIT(8U) |
| The tracks within a group are played in random order once. | |
| #define | BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT BIT(9U) |
| The tracks within a group are played in random order repeatedly. | |
Media states | |
| #define | BT_MCS_MEDIA_STATE_INACTIVE 0x00U |
| The current track is invalid, and no track has been selected. | |
| #define | BT_MCS_MEDIA_STATE_PLAYING 0x01U |
| The media player is playing the current track. | |
| #define | BT_MCS_MEDIA_STATE_PAUSED 0x02U |
| The current track is paused. | |
| #define | BT_MCS_MEDIA_STATE_SEEKING 0x03U |
| The current track is fast forwarding or fast rewinding. | |
Media control point opcodes | |
| #define | BT_MCS_OPC_PLAY 0x01U |
| Start playing the current track. | |
| #define | BT_MCS_OPC_PAUSE 0x02U |
| Pause playing the current track. | |
| #define | BT_MCS_OPC_FAST_REWIND 0x03U |
| Fast rewind the current track. | |
| #define | BT_MCS_OPC_FAST_FORWARD 0x04U |
| Fast forward the current track. | |
| #define | BT_MCS_OPC_STOP 0x05U |
| Stop current activity and return to the paused state and set the current track position to the start of the current track. | |
| #define | BT_MCS_OPC_MOVE_RELATIVE 0x10U |
| Set a new current track position relative to the current track position. | |
| #define | BT_MCS_OPC_PREV_SEGMENT 0x20U |
| Set the current track position to the starting position of the previous segment of the current track. | |
| #define | BT_MCS_OPC_NEXT_SEGMENT 0x21U |
| Set the current track position to the starting position of the next segment of the current track. | |
| #define | BT_MCS_OPC_FIRST_SEGMENT 0x22U |
| Set the current track position to the starting position of the first segment of the current track. | |
| #define | BT_MCS_OPC_LAST_SEGMENT 0x23U |
| Set the current track position to the starting position of the last segment of the current track. | |
| #define | BT_MCS_OPC_GOTO_SEGMENT 0x24U |
| Set the current track position to the starting position of the nth segment of the current track. | |
| #define | BT_MCS_OPC_PREV_TRACK 0x30U |
| Set the current track to the previous track based on the playing order. | |
| #define | BT_MCS_OPC_NEXT_TRACK 0x31U |
| Set the current track to the next track based on the playing order. | |
| #define | BT_MCS_OPC_FIRST_TRACK 0x32U |
| Set the current track to the first track based on the playing order. | |
| #define | BT_MCS_OPC_LAST_TRACK 0x33U |
| Set the current track to the last track based on the playing order. | |
| #define | BT_MCS_OPC_GOTO_TRACK 0x34U |
| Set the current track to the nth track based on the playing order. | |
| #define | BT_MCS_OPC_PREV_GROUP 0x40U |
| Set the current group to the previous group in the sequence of groups. | |
| #define | BT_MCS_OPC_NEXT_GROUP 0x41U |
| Set the current group to the next group in the sequence of groups. | |
| #define | BT_MCS_OPC_FIRST_GROUP 0x42U |
| Set the current group to the first group in the sequence of groups. | |
| #define | BT_MCS_OPC_LAST_GROUP 0x43U |
| Set the current group to the last group in the sequence of groups. | |
| #define | BT_MCS_OPC_GOTO_GROUP 0x44U |
| Set the current group to the nth group in the sequence of groups. | |
Media control point supported opcodes values | |
| #define | BT_MCS_OPC_SUP_PLAY BIT(0U) |
| Support the Play opcode. | |
| #define | BT_MCS_OPC_SUP_PAUSE BIT(1U) |
| Support the Pause opcode. | |
| #define | BT_MCS_OPC_SUP_FAST_REWIND BIT(2U) |
| Support the Fast Rewind opcode. | |
| #define | BT_MCS_OPC_SUP_FAST_FORWARD BIT(3U) |
| Support the Fast Forward opcode. | |
| #define | BT_MCS_OPC_SUP_STOP BIT(4U) |
| Support the Stop opcode. | |
| #define | BT_MCS_OPC_SUP_MOVE_RELATIVE BIT(5U) |
| Support the Move Relative opcode. | |
| #define | BT_MCS_OPC_SUP_PREV_SEGMENT BIT(6U) |
| Support the Previous Segment opcode. | |
| #define | BT_MCS_OPC_SUP_NEXT_SEGMENT BIT(7U) |
| Support the Next Segment opcode. | |
| #define | BT_MCS_OPC_SUP_FIRST_SEGMENT BIT(8U) |
| Support the First Segment opcode. | |
| #define | BT_MCS_OPC_SUP_LAST_SEGMENT BIT(9U) |
| Support the Last Segment opcode. | |
| #define | BT_MCS_OPC_SUP_GOTO_SEGMENT BIT(10U) |
| Support the Goto Segment opcode. | |
| #define | BT_MCS_OPC_SUP_PREV_TRACK BIT(11U) |
| Support the Previous Track opcode. | |
| #define | BT_MCS_OPC_SUP_NEXT_TRACK BIT(12U) |
| Support the Next Track opcode. | |
| #define | BT_MCS_OPC_SUP_FIRST_TRACK BIT(13U) |
| Support the First Track opcode. | |
| #define | BT_MCS_OPC_SUP_LAST_TRACK BIT(14U) |
| Support the Last Track opcode. | |
| #define | BT_MCS_OPC_SUP_GOTO_TRACK BIT(15U) |
| Support the Goto Track opcode. | |
| #define | BT_MCS_OPC_SUP_PREV_GROUP BIT(16U) |
| Support the Previous Group opcode. | |
| #define | BT_MCS_OPC_SUP_NEXT_GROUP BIT(17U) |
| Support the Next Group opcode. | |
| #define | BT_MCS_OPC_SUP_FIRST_GROUP BIT(18U) |
| Support the First Group opcode. | |
| #define | BT_MCS_OPC_SUP_LAST_GROUP BIT(19U) |
| Support the Last Group opcode. | |
| #define | BT_MCS_OPC_SUP_GOTO_GROUP BIT(20U) |
| Support the Goto Group opcode. | |
Media control point notification result codes | |
| #define | BT_MCS_OPC_NTF_SUCCESS 0x01U |
| Action requested by the opcode write was completed successfully. | |
| #define | BT_MCS_OPC_NTF_NOT_SUPPORTED 0x02U |
| An invalid or unsupported opcode was used for the Media Control Point write. | |
| #define | BT_MCS_OPC_NTF_PLAYER_INACTIVE 0x03U |
| 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 | BT_MCS_OPC_NTF_CANNOT_BE_COMPLETED 0x04U |
| The requested action of any Media Control Point write cannot be completed successfully because of a condition within the player. | |
Search control point type values | |
Reference: Media Control Service spec v1.0 section 3.20.2 | |
| #define | BT_MCS_SEARCH_TYPE_TRACK_NAME 0x01U |
| Search for Track Name. | |
| #define | BT_MCS_SEARCH_TYPE_ARTIST_NAME 0x02U |
| Search for Artist Name. | |
| #define | BT_MCS_SEARCH_TYPE_ALBUM_NAME 0x03U |
| Search for Album Name. | |
| #define | BT_MCS_SEARCH_TYPE_GROUP_NAME 0x04U |
| Search for Group Name. | |
| #define | BT_MCS_SEARCH_TYPE_EARLIEST_YEAR 0x05U |
| Search for Earliest Year. | |
| #define | BT_MCS_SEARCH_TYPE_LATEST_YEAR 0x06U |
| Search for Latest Year. | |
| #define | BT_MCS_SEARCH_TYPE_GENRE 0x07U |
| Search for Genre. | |
| #define | BT_MCS_SEARCH_TYPE_ONLY_TRACKS 0x08U |
| Search for Tracks only. | |
| #define | BT_MCS_SEARCH_TYPE_ONLY_GROUPS 0x09U |
| Search for Groups only. | |
Search notification result codes | |
Reference: Media Control Service spec v1.0 section 3.20.2 | |
| #define | BT_MCS_SCP_NTF_SUCCESS 0x01U |
| Search request was accepted; search has started. | |
| #define | BT_MCS_SCP_NTF_FAILURE 0x02U |
| Search request was invalid; no search started. | |
Group object object types | |
Reference: Media Control Service spec v1.0 section 4.4.1 | |
| #define | BT_MCS_GROUP_OBJECT_TRACK_TYPE 0x00U |
| Group object type is track. | |
| #define | BT_MCS_GROUP_OBJECT_GROUP_TYPE 0x01U |
| Group object type is group. | |
Media Control Service (MCS).
Definitions and types related to the Media Control Service and Media Control Profile specifications.
| #define BT_MCS_ERR_LONG_VAL_CHANGED 0x80U |
#include <zephyr/bluetooth/audio/mcs.h>
A characteristic value has changed while a Read Long Value Characteristic sub-procedure is in progress.
| #define BT_MCS_GROUP_OBJECT_GROUP_TYPE 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
Group object type is group.
| #define BT_MCS_GROUP_OBJECT_TRACK_TYPE 0x00U |
#include <zephyr/bluetooth/audio/mcs.h>
Group object type is track.
| #define BT_MCS_MEDIA_STATE_INACTIVE 0x00U |
#include <zephyr/bluetooth/audio/mcs.h>
The current track is invalid, and no track has been selected.
| #define BT_MCS_MEDIA_STATE_PAUSED 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
The current track is paused.
The media player has a current track, but it is not being played
| #define BT_MCS_MEDIA_STATE_PLAYING 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
The media player is playing the current track.
| #define BT_MCS_MEDIA_STATE_SEEKING 0x03U |
#include <zephyr/bluetooth/audio/mcs.h>
The current track is fast forwarding or fast rewinding.
| #define BT_MCS_OPC_FAST_FORWARD 0x04U |
#include <zephyr/bluetooth/audio/mcs.h>
Fast forward the current track.
| #define BT_MCS_OPC_FAST_REWIND 0x03U |
#include <zephyr/bluetooth/audio/mcs.h>
Fast rewind the current track.
| #define BT_MCS_OPC_FIRST_GROUP 0x42U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current group to the first group in the sequence of groups.
| #define BT_MCS_OPC_FIRST_SEGMENT 0x22U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track position to the starting position of the first segment of the current track.
| #define BT_MCS_OPC_FIRST_TRACK 0x32U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track to the first track based on the playing order.
| #define BT_MCS_OPC_GOTO_GROUP 0x44U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current group to the nth group in the sequence of groups.
| #define BT_MCS_OPC_GOTO_SEGMENT 0x24U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track position to the starting position of the nth segment of the current track.
| #define BT_MCS_OPC_GOTO_TRACK 0x34U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track to the nth track based on the playing order.
| #define BT_MCS_OPC_LAST_GROUP 0x43U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current group to the last group in the sequence of groups.
| #define BT_MCS_OPC_LAST_SEGMENT 0x23U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track position to the starting position of the last segment of the current track.
| #define BT_MCS_OPC_LAST_TRACK 0x33U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track to the last track based on the playing order.
| #define BT_MCS_OPC_MOVE_RELATIVE 0x10U |
#include <zephyr/bluetooth/audio/mcs.h>
Set a new current track position relative to the current track position.
| #define BT_MCS_OPC_NEXT_GROUP 0x41U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current group to the next group in the sequence of groups.
| #define BT_MCS_OPC_NEXT_SEGMENT 0x21U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track position to the starting position of the next segment of the current track.
| #define BT_MCS_OPC_NEXT_TRACK 0x31U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track to the next track based on the playing order.
| #define BT_MCS_OPC_NTF_CANNOT_BE_COMPLETED 0x04U |
#include <zephyr/bluetooth/audio/mcs.h>
The requested action of any Media Control Point write cannot be completed successfully because of a condition within the player.
| #define BT_MCS_OPC_NTF_NOT_SUPPORTED 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
An invalid or unsupported opcode was used for the Media Control Point write.
| #define BT_MCS_OPC_NTF_PLAYER_INACTIVE 0x03U |
#include <zephyr/bluetooth/audio/mcs.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.
| #define BT_MCS_OPC_NTF_SUCCESS 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
Action requested by the opcode write was completed successfully.
| #define BT_MCS_OPC_PAUSE 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
Pause playing the current track.
| #define BT_MCS_OPC_PLAY 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
Start playing the current track.
| #define BT_MCS_OPC_PREV_GROUP 0x40U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current group to the previous group in the sequence of groups.
| #define BT_MCS_OPC_PREV_SEGMENT 0x20U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track position to the starting position of the previous segment of the current track.
| #define BT_MCS_OPC_PREV_TRACK 0x30U |
#include <zephyr/bluetooth/audio/mcs.h>
Set the current track to the previous track based on the playing order.
| #define BT_MCS_OPC_STOP 0x05U |
#include <zephyr/bluetooth/audio/mcs.h>
Stop current activity and return to the paused state and set the current track position to the start of the current track.
| #define BT_MCS_OPC_SUP_FAST_FORWARD BIT(3U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Fast Forward opcode.
| #define BT_MCS_OPC_SUP_FAST_REWIND BIT(2U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Fast Rewind opcode.
| #define BT_MCS_OPC_SUP_FIRST_GROUP BIT(18U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the First Group opcode.
| #define BT_MCS_OPC_SUP_FIRST_SEGMENT BIT(8U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the First Segment opcode.
| #define BT_MCS_OPC_SUP_FIRST_TRACK BIT(13U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the First Track opcode.
| #define BT_MCS_OPC_SUP_GOTO_GROUP BIT(20U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Goto Group opcode.
| #define BT_MCS_OPC_SUP_GOTO_SEGMENT BIT(10U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Goto Segment opcode.
| #define BT_MCS_OPC_SUP_GOTO_TRACK BIT(15U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Goto Track opcode.
| #define BT_MCS_OPC_SUP_LAST_GROUP BIT(19U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Last Group opcode.
| #define BT_MCS_OPC_SUP_LAST_SEGMENT BIT(9U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Last Segment opcode.
| #define BT_MCS_OPC_SUP_LAST_TRACK BIT(14U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Last Track opcode.
| #define BT_MCS_OPC_SUP_MOVE_RELATIVE BIT(5U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Move Relative opcode.
| #define BT_MCS_OPC_SUP_NEXT_GROUP BIT(17U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Next Group opcode.
| #define BT_MCS_OPC_SUP_NEXT_SEGMENT BIT(7U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Next Segment opcode.
| #define BT_MCS_OPC_SUP_NEXT_TRACK BIT(12U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Next Track opcode.
| #define BT_MCS_OPC_SUP_PAUSE BIT(1U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Pause opcode.
| #define BT_MCS_OPC_SUP_PLAY BIT(0U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Play opcode.
| #define BT_MCS_OPC_SUP_PREV_GROUP BIT(16U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Previous Group opcode.
| #define BT_MCS_OPC_SUP_PREV_SEGMENT BIT(6U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Previous Segment opcode.
| #define BT_MCS_OPC_SUP_PREV_TRACK BIT(11U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Previous Track opcode.
| #define BT_MCS_OPC_SUP_STOP BIT(4U) |
#include <zephyr/bluetooth/audio/mcs.h>
Support the Stop opcode.
| #define BT_MCS_OPCODES_SUPPORTED_LEN 4U |
#include <zephyr/bluetooth/audio/mcs.h>
Media control point supported opcodes length.
| #define BT_MCS_PLAYBACK_SPEED_DOUBLE 64 |
#include <zephyr/bluetooth/audio/mcs.h>
Double playback speed, resulting in 200 % speed.
| #define BT_MCS_PLAYBACK_SPEED_HALF -64 |
#include <zephyr/bluetooth/audio/mcs.h>
Half playback speed, resulting in 50 % speed.
| #define BT_MCS_PLAYBACK_SPEED_MAX 127 |
#include <zephyr/bluetooth/audio/mcs.h>
Max playback speed, resulting in 395.7 % speed (nearly 400 %).
| #define BT_MCS_PLAYBACK_SPEED_MIN -128 |
#include <zephyr/bluetooth/audio/mcs.h>
Minimum playback speed, resulting in 25 % speed.
| #define BT_MCS_PLAYBACK_SPEED_QUARTER -128 |
#include <zephyr/bluetooth/audio/mcs.h>
Quarter playback speed, resulting in 25 % speed.
| #define BT_MCS_PLAYBACK_SPEED_UNITY 0 |
#include <zephyr/bluetooth/audio/mcs.h>
Unity playback speed, resulting in 100 % speed.
| #define BT_MCS_PLAYING_ORDER_INORDER_ONCE 0x03U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once in track order.
| #define BT_MCS_PLAYING_ORDER_INORDER_REPEAT 0x04U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in track order repeatedly.
| #define BT_MCS_PLAYING_ORDER_NEWEST_ONCE 0x07U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once only from the newest first.
| #define BT_MCS_PLAYING_ORDER_NEWEST_REPEAT 0x08U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played from the newest first repeatedly.
| #define BT_MCS_PLAYING_ORDER_OLDEST_ONCE 0x05U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once only from the oldest first.
| #define BT_MCS_PLAYING_ORDER_OLDEST_REPEAT 0x06U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played from the oldest first repeatedly.
| #define BT_MCS_PLAYING_ORDER_SHUFFLE_ONCE 0x09U |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in random order once.
| #define BT_MCS_PLAYING_ORDER_SHUFFLE_REPEAT 0x0AU |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in random order repeatedly.
| #define BT_MCS_PLAYING_ORDER_SINGLE_ONCE 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
A single track is played once; there is no next track.
| #define BT_MCS_PLAYING_ORDER_SINGLE_REPEAT 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
A single track is played repeatedly; the next track is the current track.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE BIT(2U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once in track order.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT BIT(3U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in track order repeatedly.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE BIT(6U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once only from the newest first.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT BIT(7U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played from the newest first repeatedly.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE BIT(4U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played once only from the oldest first.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT BIT(5U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played from the oldest first repeatedly.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE BIT(8U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in random order once.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT BIT(9U) |
#include <zephyr/bluetooth/audio/mcs.h>
The tracks within a group are played in random order repeatedly.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE BIT(0U) |
#include <zephyr/bluetooth/audio/mcs.h>
A single track is played once; there is no next track.
| #define BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT BIT(1U) |
#include <zephyr/bluetooth/audio/mcs.h>
A single track is played repeatedly; the next track is the current track.
| #define BT_MCS_SCP_NTF_FAILURE 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
Search request was invalid; no search started.
| #define BT_MCS_SCP_NTF_SUCCESS 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
Search request was accepted; search has started.
| #define BT_MCS_SEARCH_LEN_MAX 64 |
#include <zephyr/bluetooth/audio/mcs.h>
Search control point maximum length.
| #define BT_MCS_SEARCH_LEN_MIN 2 |
#include <zephyr/bluetooth/audio/mcs.h>
Search control point minimum length.
At least one search control item (SCI), consisting of the length octet and the type octet. (The * parameter field may be empty.)
| #define BT_MCS_SEARCH_PARAM_MAX 62 |
#include <zephyr/bluetooth/audio/mcs.h>
Search parameters maximum length.
| #define BT_MCS_SEARCH_SCI_LEN_MIN 1 |
#include <zephyr/bluetooth/audio/mcs.h>
Search control point item (SCI) minimum length.
An SCI length can be as little as one byte, for an SCI that has only the type field. (The SCI len is the length of type + param.)
| #define BT_MCS_SEARCH_TYPE_ALBUM_NAME 0x03U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Album Name.
| #define BT_MCS_SEARCH_TYPE_ARTIST_NAME 0x02U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Artist Name.
| #define BT_MCS_SEARCH_TYPE_EARLIEST_YEAR 0x05U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Earliest Year.
| #define BT_MCS_SEARCH_TYPE_GENRE 0x07U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Genre.
| #define BT_MCS_SEARCH_TYPE_GROUP_NAME 0x04U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Group Name.
| #define BT_MCS_SEARCH_TYPE_LATEST_YEAR 0x06U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Latest Year.
| #define BT_MCS_SEARCH_TYPE_ONLY_GROUPS 0x09U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Groups only.
| #define BT_MCS_SEARCH_TYPE_ONLY_TRACKS 0x08U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Tracks only.
| #define BT_MCS_SEARCH_TYPE_TRACK_NAME 0x01U |
#include <zephyr/bluetooth/audio/mcs.h>
Search for Track Name.
| #define BT_MCS_SEEKING_SPEED_FACTOR_MAX 64 |
#include <zephyr/bluetooth/audio/mcs.h>
Maximum seeking speed - Can be negated.
| #define BT_MCS_SEEKING_SPEED_FACTOR_MIN 4 |
#include <zephyr/bluetooth/audio/mcs.h>
Minimum seeking speed - Can be negated.
| #define BT_MCS_SEEKING_SPEED_FACTOR_ZERO 0 |
#include <zephyr/bluetooth/audio/mcs.h>
No seeking.
| void bt_mcs_command_complete | ( | const struct bt_mcs_cmd_ntf * | cmd_ntf | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Command callback.
To be called when a command has been sent, to notify whether the command was successfully performed or not. See the BT_MCS_OPC_NTF_* result code defines.
| cmd_ntf | The result of the command |
| void bt_mcs_commands_supported_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Commands supported callback.
To be called when the set of commands supported is changed
| void bt_mcs_current_group_id_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Current group object ID callback.
To be called when the ID of the current group is changed
| void bt_mcs_current_track_id_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.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).
| struct bt_ots * bt_mcs_get_ots | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Get the pointer of the Object Transfer Service used by the Media Control Service.
| void bt_mcs_icon_url_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Player icon URL changed callback.
To be called when the player's icon URL is changed.
| int bt_mcs_init | ( | struct bt_ots_cb * | ots_cbs | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Initialize MCS.
| ots_cbs | Pointer to callback structure for OTS. May be NULL. |
| void bt_mcs_media_state_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Media state callback.
To be called when the media state is changed
| void bt_mcs_next_track_id_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Next track object ID callback.
To be called when the ID of the current track is changes
| void bt_mcs_parent_group_id_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Parent group object ID callback.
To be called when the ID of the parent group is changed
| void bt_mcs_playback_speed_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Playback speed callback.
To be called when the playback speed is changed.
| void bt_mcs_player_name_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Player name changed callback.
To be called when the player's name is changed.
| void bt_mcs_playing_order_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Playing order callback.
To be called when the playing order is changed
| int bt_mcs_register_cb | ( | struct bt_mcs_cb * | cbs | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Register Media Control Service callbacks.
| cbs | Pointer to the callbacks |
| void bt_mcs_search_complete | ( | uint8_t | result_code | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Search callback.
To be called when a search has been set to notify whether the search was successfully performed or not. See the BT_MCS_SCP_NTF_* result code defines.
The actual results of the search, if successful, can be found in the search results object.
| result_code | The result (success or failure) of the search |
| void bt_mcs_search_results_id_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.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).
| void bt_mcs_seeking_speed_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Seeking speed callback.
To be called when the seeking speed is changed.
| void bt_mcs_track_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Track changed callback.
To be called when the player's current track is changed
| void bt_mcs_track_duration_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.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.
| void bt_mcs_track_position_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.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.
| void bt_mcs_track_title_changed | ( | void | ) |
#include <zephyr/bluetooth/audio/mcs.h>
Track title callback.
To be called when the player's current track is changed