Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mcs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 - 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCS_H_
8#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCS_H_
9
25#include <sys/util.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31
36#define BT_MCS_PLAYBACK_SPEED_MIN -128
37#define BT_MCS_PLAYBACK_SPEED_QUARTER -128
38#define BT_MCS_PLAYBACK_SPEED_HALF -64
39#define BT_MCS_PLAYBACK_SPEED_UNITY 0
40#define BT_MCS_PLAYBACK_SPEED_DOUBLE 64
41#define BT_MCS_PLAYBACK_SPEED_MAX 127
42
49#define BT_MCS_SEEKING_SPEED_FACTOR_MAX 64
50#define BT_MCS_SEEKING_SPEED_FACTOR_MIN 4
51#define BT_MCS_SEEKING_SPEED_FACTOR_ZERO 0
52
54#define BT_MCS_PLAYING_ORDER_SINGLE_ONCE 0X01
55#define BT_MCS_PLAYING_ORDER_SINGLE_REPEAT 0x02
56#define BT_MCS_PLAYING_ORDER_INORDER_ONCE 0x03
57#define BT_MCS_PLAYING_ORDER_INORDER_REPEAT 0x04
58#define BT_MCS_PLAYING_ORDER_OLDEST_ONCE 0x05
59#define BT_MCS_PLAYING_ORDER_OLDEST_REPEAT 0x06
60#define BT_MCS_PLAYING_ORDER_NEWEST_ONCE 0x07
61#define BT_MCS_PLAYING_ORDER_NEWEST_REPEAT 0x08
62#define BT_MCS_PLAYING_ORDER_SHUFFLE_ONCE 0x09
63#define BT_MCS_PLAYING_ORDER_SHUFFLE_REPEAT 0x0a
64
70#define BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_ONCE BIT(0)
71#define BT_MCS_PLAYING_ORDERS_SUPPORTED_SINGLE_REPEAT BIT(1)
72#define BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE BIT(2)
73#define BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT BIT(3)
74#define BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_ONCE BIT(4)
75#define BT_MCS_PLAYING_ORDERS_SUPPORTED_OLDEST_REPEAT BIT(5)
76#define BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_ONCE BIT(6)
77#define BT_MCS_PLAYING_ORDERS_SUPPORTED_NEWEST_REPEAT BIT(7)
78#define BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_ONCE BIT(8)
79#define BT_MCS_PLAYING_ORDERS_SUPPORTED_SHUFFLE_REPEAT BIT(9)
80
82#define BT_MCS_MEDIA_STATE_INACTIVE 0x00
83#define BT_MCS_MEDIA_STATE_PLAYING 0x01
84#define BT_MCS_MEDIA_STATE_PAUSED 0x02
85#define BT_MCS_MEDIA_STATE_SEEKING 0x03
86#define BT_MCS_MEDIA_STATE_LAST 0x04
87
89#define BT_MCS_OPC_PLAY 0x01
90#define BT_MCS_OPC_PAUSE 0x02
91#define BT_MCS_OPC_FAST_REWIND 0x03
92#define BT_MCS_OPC_FAST_FORWARD 0x04
93#define BT_MCS_OPC_STOP 0x05
94
95#define BT_MCS_OPC_MOVE_RELATIVE 0x10
96
97#define BT_MCS_OPC_PREV_SEGMENT 0x20
98#define BT_MCS_OPC_NEXT_SEGMENT 0x21
99#define BT_MCS_OPC_FIRST_SEGMENT 0x22
100#define BT_MCS_OPC_LAST_SEGMENT 0x23
101#define BT_MCS_OPC_GOTO_SEGMENT 0x24
102
103#define BT_MCS_OPC_PREV_TRACK 0x30
104#define BT_MCS_OPC_NEXT_TRACK 0x31
105#define BT_MCS_OPC_FIRST_TRACK 0x32
106#define BT_MCS_OPC_LAST_TRACK 0x33
107#define BT_MCS_OPC_GOTO_TRACK 0x34
108
109#define BT_MCS_OPC_PREV_GROUP 0x40
110#define BT_MCS_OPC_NEXT_GROUP 0x41
111#define BT_MCS_OPC_FIRST_GROUP 0x42
112#define BT_MCS_OPC_LAST_GROUP 0x43
113#define BT_MCS_OPC_GOTO_GROUP 0x44
114
116#define BT_MCS_OPCODES_SUPPORTED_LEN 4
117
119#define BT_MCS_OPC_SUP_PLAY BIT(0)
120#define BT_MCS_OPC_SUP_PAUSE BIT(1)
121#define BT_MCS_OPC_SUP_FAST_REWIND BIT(2)
122#define BT_MCS_OPC_SUP_FAST_FORWARD BIT(3)
123#define BT_MCS_OPC_SUP_STOP BIT(4)
124
125#define BT_MCS_OPC_SUP_MOVE_RELATIVE BIT(5)
126
127#define BT_MCS_OPC_SUP_PREV_SEGMENT BIT(6)
128#define BT_MCS_OPC_SUP_NEXT_SEGMENT BIT(7)
129#define BT_MCS_OPC_SUP_FIRST_SEGMENT BIT(8)
130#define BT_MCS_OPC_SUP_LAST_SEGMENT BIT(9)
131#define BT_MCS_OPC_SUP_GOTO_SEGMENT BIT(10)
132
133#define BT_MCS_OPC_SUP_PREV_TRACK BIT(11)
134#define BT_MCS_OPC_SUP_NEXT_TRACK BIT(12)
135#define BT_MCS_OPC_SUP_FIRST_TRACK BIT(13)
136#define BT_MCS_OPC_SUP_LAST_TRACK BIT(14)
137#define BT_MCS_OPC_SUP_GOTO_TRACK BIT(15)
138
139#define BT_MCS_OPC_SUP_PREV_GROUP BIT(16)
140#define BT_MCS_OPC_SUP_NEXT_GROUP BIT(17)
141#define BT_MCS_OPC_SUP_FIRST_GROUP BIT(18)
142#define BT_MCS_OPC_SUP_LAST_GROUP BIT(19)
143#define BT_MCS_OPC_SUP_GOTO_GROUP BIT(20)
144
146#define BT_MCS_OPC_NTF_SUCCESS 0x01
147#define BT_MCS_OPC_NTF_NOT_SUPPORTED 0x02
148#define BT_MCS_OPC_NTF_PLAYER_INACTIVE 0x03
149#define BT_MCS_OPC_NTF_CANNOT_BE_COMPLETED 0x04
150
152/* Reference: Media Control Service spec v1.0 section 3.20.2 */
153#define BT_MCS_SEARCH_TYPE_TRACK_NAME 0x01
154#define BT_MCS_SEARCH_TYPE_ARTIST_NAME 0x02
155#define BT_MCS_SEARCH_TYPE_ALBUM_NAME 0x03
156#define BT_MCS_SEARCH_TYPE_GROUP_NAME 0x04
157#define BT_MCS_SEARCH_TYPE_EARLIEST_YEAR 0x05
158#define BT_MCS_SEARCH_TYPE_LATEST_YEAR 0x06
159#define BT_MCS_SEARCH_TYPE_GENRE 0x07
160#define BT_MCS_SEARCH_TYPE_ONLY_TRACKS 0x08
161#define BT_MCS_SEARCH_TYPE_ONLY_GROUPS 0x09
162
164#define SEARCH_LEN_MIN 2 /* At least one search control item (SCI),
165 * consisting of the length octet and the type
166 * octet. (The parameter field may be empty.)
167 */
169#define SEARCH_SCI_LEN_MIN 1 /* An SCI length can be as little as one byte,
170 * for an SCI that has only the type field.
171 * (The SCI len is the length of type + param.)
172 */
173
174#define SEARCH_LEN_MAX 64 /* Max total length of search, defined by spec */
176#define SEARCH_PARAM_MAX 62 /* A search may have a single search control item
177 * consisting of length, type and parameter
178 */
181/* Reference: Media Control Service spec v1.0 section 3.20.2 */
182#define BT_MCS_SCP_NTF_SUCCESS 0x01
183#define BT_MCS_SCP_NTF_FAILURE 0x02
184
185/* Group object object types */
186/* Reference: Media Control Service spec v1.0 section 4.4.1 */
187#define BT_MCS_GROUP_OBJECT_TRACK_TYPE 0x00
188#define BT_MCS_GROUP_OBJECT_GROUP_TYPE 0x01
189
190
191#ifdef __cplusplus
192}
193#endif
194
199#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_MCS_H_ */
Misc utilities.