Bluetooth: Audio: Separate Kconfig for MPL
Separate out the Kconfig for the media player. Also removes some unused MCS configs. The media player has been using MCS configs, while it should be the other way around. Also, this will make it easier to move the media player elsewhere, as has been discussed. Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This commit is contained in:
parent
8c01c69779
commit
e3a7ed4766
10 changed files with 283 additions and 205 deletions
|
@ -36,9 +36,14 @@ zephyr_library_sources_ifdef(CONFIG_BT_MCC mcc.c)
|
|||
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_MCS mcs.c)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_MCS mpl.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_MPL mpl.c)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_MCS media_proxy.c)
|
||||
if (CONFIG_BT_MCS OR CONFIG_BT_MPL)
|
||||
# TODO: Remove dependencies between mpl.c and mcs.c
|
||||
zephyr_library_sources(media_proxy.c)
|
||||
zephyr_library_sources(mpl.c)
|
||||
zephyr_library_sources(mcs.c)
|
||||
endif()
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_ASCS ascs.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_PACS pacs.c)
|
||||
|
|
|
@ -34,5 +34,6 @@ rsource "Kconfig.csis"
|
|||
rsource "Kconfig.mcs"
|
||||
rsource "Kconfig.bass"
|
||||
rsource "Kconfig.has"
|
||||
rsource "Kconfig.mpl"
|
||||
|
||||
endif # BT_AUDIO
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Bluetooth Audio - Media control configuration options
|
||||
|
||||
#
|
||||
# Copyright (c) 2020 Nordic Semiconductor
|
||||
# Copyright (c) 2020-2022 Nordic Semiconductor
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
@ -17,20 +17,6 @@ config BT_MCS
|
|||
|
||||
if BT_MCS
|
||||
|
||||
config BT_MCS_MEDIA_PLAYER_NAME
|
||||
string "Media Player Name"
|
||||
default "Player0"
|
||||
help
|
||||
Use this option to set the name of the media player.
|
||||
|
||||
config BT_MCS_ICON_URL
|
||||
string "Media player Icon URL"
|
||||
default "http://server.some.where/path/icon.png"
|
||||
help
|
||||
Use this option to set the URL of the Media Player Icon.
|
||||
|
||||
#### Debug logs ################################################################
|
||||
|
||||
config BT_DEBUG_MCS
|
||||
bool "Media Control Service debug"
|
||||
help
|
||||
|
@ -142,14 +128,6 @@ config BT_MCS_TRACK_TITLE_MAX
|
|||
Sets the maximum number of bytes (including the null termination) of
|
||||
the title of any track in the media player.
|
||||
|
||||
config BT_MCS_GROUP_TITLE_MAX
|
||||
int "Max length of the title of a group of tracks"
|
||||
default BT_MCS_TRACK_TITLE_MAX
|
||||
range 1 255
|
||||
help
|
||||
Sets the maximum number of bytes (including the null termination) of
|
||||
the title of any track in the media player.
|
||||
|
||||
config BT_MCS_SEGMENT_NAME_MAX
|
||||
int "Max length of the name of a track segment"
|
||||
default 25
|
||||
|
@ -158,39 +136,6 @@ config BT_MCS_SEGMENT_NAME_MAX
|
|||
Sets the the maximum number of bytes (including the null termination)
|
||||
of the name of any track segment in the media player.
|
||||
|
||||
config BT_MCS_ICON_BITMAP_SIZE
|
||||
int "Media player Icon bitmap object size"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of the icon object.
|
||||
|
||||
config BT_MCS_TRACK_SEG_MAX_SIZE
|
||||
int "Maximum size for a track segment object"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of a track segment object.
|
||||
|
||||
config BT_MCS_TRACK_MAX_SIZE
|
||||
int "Maximum size for a track object"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of a track object.
|
||||
|
||||
config BT_MCS_GROUP_MAX_SIZE
|
||||
int "Maximum size for a group object"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of a group object.
|
||||
|
||||
config BT_MCS_MAX_OBJ_SIZE
|
||||
int "Total memory size to use for storing the content of objects"
|
||||
default 127
|
||||
range 0 65536
|
||||
help
|
||||
Sets the total memory size (in octets) to use for storing the content of objects.
|
||||
This is used for the total memory pool buffer size from which memory
|
||||
is allocated when sending object content.
|
||||
|
||||
config BT_DEBUG_MEDIA_PROXY
|
||||
bool "Media Proxy debug"
|
||||
help
|
||||
|
|
115
subsys/bluetooth/audio/Kconfig.mpl
Normal file
115
subsys/bluetooth/audio/Kconfig.mpl
Normal file
|
@ -0,0 +1,115 @@
|
|||
# Bluetooth Audio - Media player configuration options
|
||||
|
||||
#
|
||||
# Copyright (c) 2022 Nordic Semiconductor
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
config BT_MPL
|
||||
bool "Support for media player"
|
||||
select BT_CCID
|
||||
select EXPERIMENTAL
|
||||
help
|
||||
Enables support for media player
|
||||
Note that the provided media player is a sample that only provides a
|
||||
mock-up with no actual media being played.
|
||||
For real media playback, the sample must be extended, hooked up to a
|
||||
real media player or replaced with a real media player.
|
||||
|
||||
if BT_MPL
|
||||
|
||||
config BT_MPL_MEDIA_PLAYER_NAME
|
||||
string "Media Player Name"
|
||||
default "Player0"
|
||||
help
|
||||
Use this option to set the name of the media player.
|
||||
|
||||
config BT_MPL_MEDIA_PLAYER_NAME_MAX
|
||||
int "Max length of media player name"
|
||||
default 20
|
||||
range 1 255
|
||||
help
|
||||
Sets the maximum number of bytes (including the null termination) of
|
||||
the name of the media player.
|
||||
|
||||
config BT_MPL_ICON_URL
|
||||
string "Media player Icon URL"
|
||||
default "http://server.some.where/path/icon.png"
|
||||
help
|
||||
Use this option to set the URL of the Media Player Icon.
|
||||
|
||||
config BT_MPL_ICON_URL_MAX
|
||||
int "Max length of media player icon URL"
|
||||
default 30
|
||||
range 1 255
|
||||
help
|
||||
Sets the maximum number of bytes (including the null termination) of
|
||||
the media player icon URL.
|
||||
|
||||
config BT_MPL_TRACK_TITLE_MAX
|
||||
int "Max length of the title of a track"
|
||||
default 25
|
||||
range 1 255
|
||||
help
|
||||
Sets the maximum number of bytes (including the null termination) of
|
||||
the title of any track in the media player.
|
||||
|
||||
config BT_MPL_SEGMENT_NAME_MAX
|
||||
int "Max length of the name of a track segment"
|
||||
default 25
|
||||
range 1 255
|
||||
help
|
||||
Sets the the maximum number of bytes (including the null termination)
|
||||
of the name of any track segment in the media player.
|
||||
|
||||
config BT_MPL_GROUP_TITLE_MAX
|
||||
int "Max length of the title of a group of tracks"
|
||||
default BT_MPL_TRACK_TITLE_MAX
|
||||
range 1 255
|
||||
help
|
||||
Sets the maximum number of bytes (including the null termination) of
|
||||
the title of any group in the media player.
|
||||
|
||||
config BT_MPL_OBJECTS
|
||||
bool "Support for media player objects"
|
||||
depends on BT_OTS
|
||||
# TODO: Temporarily depends also on BT_MCS, to avoid issues with the
|
||||
# bt_mcs_get_ots() call
|
||||
depends on BT_MCS
|
||||
help
|
||||
Enables support for objects in the media player
|
||||
Objects are used to give/get more information about e.g. media tracks.
|
||||
Requires the Object Transfer Service
|
||||
|
||||
if BT_MPL_OBJECTS
|
||||
|
||||
config BT_MPL_MAX_OBJ_SIZE
|
||||
int "Total memory size to use for storing the content of objects"
|
||||
default 127
|
||||
range 0 65536
|
||||
help
|
||||
Sets the total memory size (in octets) to use for storing the content of objects.
|
||||
This is used for the total memory pool buffer size from which memory
|
||||
is allocated when sending object content.
|
||||
|
||||
config BT_MPL_ICON_BITMAP_SIZE
|
||||
int "Media player Icon bitmap object size"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of the icon object.
|
||||
|
||||
config BT_MPL_TRACK_MAX_SIZE
|
||||
int "Maximum size for a track object"
|
||||
default 127
|
||||
help
|
||||
This option sets the maximum size (in octets) of a track object.
|
||||
|
||||
endif # BT_MPL_OBJECTS
|
||||
|
||||
config BT_DEBUG_MPL
|
||||
bool "Media player debug"
|
||||
help
|
||||
Enables debug logs for the media player
|
||||
|
||||
endif # BT_MPL
|
|
@ -14,7 +14,7 @@
|
|||
#include "media_proxy_internal.h"
|
||||
#include "mpl_internal.h"
|
||||
|
||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_MCS)
|
||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_MPL)
|
||||
#define LOG_MODULE_NAME bt_mpl
|
||||
#include "common/log.h"
|
||||
#include "ccid_internal.h"
|
||||
|
@ -225,8 +225,8 @@ static struct mpl_group group_p = {
|
|||
};
|
||||
|
||||
static struct mpl_mediaplayer pl = {
|
||||
.name = CONFIG_BT_MCS_MEDIA_PLAYER_NAME,
|
||||
.icon_url = CONFIG_BT_MCS_ICON_URL,
|
||||
.name = CONFIG_BT_MPL_MEDIA_PLAYER_NAME,
|
||||
.icon_url = CONFIG_BT_MPL_ICON_URL,
|
||||
.group = &group_1,
|
||||
.track_pos = 0,
|
||||
.state = BT_MCS_MEDIA_STATE_PAUSED,
|
||||
|
@ -236,14 +236,14 @@ static struct mpl_mediaplayer pl = {
|
|||
.playing_orders_supported = BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_ONCE |
|
||||
BT_MCS_PLAYING_ORDERS_SUPPORTED_INORDER_REPEAT,
|
||||
.opcodes_supported = 0x001fffff, /* All opcodes */
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
.search_results_id = 0,
|
||||
.calls = { 0 },
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
.next_track_set = false
|
||||
};
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
|
||||
/* The types of objects we keep in the Object Transfer Service */
|
||||
enum mpl_objects {
|
||||
|
@ -287,7 +287,7 @@ static struct obj_t obj = {
|
|||
.busy = false,
|
||||
.add_track = NULL,
|
||||
.add_group = NULL,
|
||||
.content = NET_BUF_SIMPLE(CONFIG_BT_MCS_MAX_OBJ_SIZE)
|
||||
.content = NET_BUF_SIMPLE(CONFIG_BT_MPL_MAX_OBJ_SIZE)
|
||||
};
|
||||
|
||||
/* Set up content buffer for the icon object */
|
||||
|
@ -303,8 +303,8 @@ static int setup_icon_object(void)
|
|||
|
||||
/* Size may be larger than what fits in 8 bits, use 16-bit for index */
|
||||
for (index = 0, k = 0;
|
||||
index < MIN(CONFIG_BT_MCS_MAX_OBJ_SIZE,
|
||||
CONFIG_BT_MCS_ICON_BITMAP_SIZE);
|
||||
index < MIN(CONFIG_BT_MPL_MAX_OBJ_SIZE,
|
||||
CONFIG_BT_MPL_ICON_BITMAP_SIZE);
|
||||
index++, k++) {
|
||||
net_buf_simple_add_u8(obj.content, k);
|
||||
}
|
||||
|
@ -366,8 +366,8 @@ static uint32_t setup_track_object(struct mpl_track *track)
|
|||
|
||||
/* Size may be larger than what fits in 8 bits, use 16-bit for index */
|
||||
for (index = 0, k = 0;
|
||||
index < MIN(CONFIG_BT_MCS_MAX_OBJ_SIZE,
|
||||
CONFIG_BT_MCS_TRACK_MAX_SIZE);
|
||||
index < MIN(CONFIG_BT_MPL_MAX_OBJ_SIZE,
|
||||
CONFIG_BT_MPL_TRACK_MAX_SIZE);
|
||||
index++, k++) {
|
||||
net_buf_simple_add_u8(obj.content, k);
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ static ssize_t on_object_send(struct bt_ots *ots, struct bt_conn *conn,
|
|||
}
|
||||
obj.busy = true;
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
char t[BT_OTS_OBJ_ID_STR_LEN];
|
||||
(void)bt_ots_obj_id_to_str(id, t, sizeof(t));
|
||||
BT_DBG("Object Id %s, offset %lu, length %zu", log_strdup(t),
|
||||
|
@ -844,7 +844,7 @@ static ssize_t on_object_send(struct bt_ots *ots, struct bt_conn *conn,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
if (len > obj.content->len - offset) {
|
||||
BT_DBG("Requested len too large");
|
||||
}
|
||||
|
@ -862,7 +862,7 @@ static struct bt_ots_cb ots_cbs = {
|
|||
.obj_deleted = on_obj_deleted,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
|
||||
/* TODO: It must be possible to replace the do_prev_segment(), do_prev_track */
|
||||
|
@ -966,18 +966,18 @@ static bool do_prev_track(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool track_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID before: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->track->prev != NULL) {
|
||||
pl->group->track = pl->group->track->prev;
|
||||
track_changed = true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID after: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return track_changed;
|
||||
}
|
||||
|
@ -987,18 +987,18 @@ static bool do_next_track_normal_order(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool track_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID before: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->track->next != NULL) {
|
||||
pl->group->track = pl->group->track->next;
|
||||
track_changed = true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID after: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return track_changed;
|
||||
}
|
||||
|
@ -1032,9 +1032,9 @@ static bool do_first_track(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool track_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID before: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->track->prev != NULL) {
|
||||
pl->group->track = pl->group->track->prev;
|
||||
|
@ -1044,9 +1044,9 @@ static bool do_first_track(struct mpl_mediaplayer *pl)
|
|||
pl->group->track = pl->group->track->prev;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID after: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return track_changed;
|
||||
}
|
||||
|
@ -1055,9 +1055,9 @@ static bool do_last_track(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool track_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID before: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->track->next != NULL) {
|
||||
pl->group->track = pl->group->track->next;
|
||||
|
@ -1067,9 +1067,9 @@ static bool do_last_track(struct mpl_mediaplayer *pl)
|
|||
pl->group->track = pl->group->track->next;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID after: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return track_changed;
|
||||
}
|
||||
|
@ -1079,9 +1079,9 @@ static bool do_goto_track(struct mpl_mediaplayer *pl, int32_t tracknum)
|
|||
int32_t count = 0;
|
||||
int32_t k;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID before: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (tracknum > 0) {
|
||||
/* Goto first track */
|
||||
|
@ -1113,9 +1113,9 @@ static bool do_goto_track(struct mpl_mediaplayer *pl, int32_t tracknum)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Track ID after: ", pl->group->track->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
/* The track has changed if we have moved more in one direction */
|
||||
/* than in the other */
|
||||
|
@ -1127,18 +1127,18 @@ static bool do_prev_group(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool group_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID before: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->prev != NULL) {
|
||||
pl->group = pl->group->prev;
|
||||
group_changed = true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID after: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return group_changed;
|
||||
}
|
||||
|
@ -1147,18 +1147,18 @@ static bool do_next_group(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool group_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID before: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->next != NULL) {
|
||||
pl->group = pl->group->next;
|
||||
group_changed = true;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID after: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return group_changed;
|
||||
}
|
||||
|
@ -1167,9 +1167,9 @@ static bool do_first_group(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool group_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID before: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->prev != NULL) {
|
||||
pl->group = pl->group->prev;
|
||||
|
@ -1179,9 +1179,9 @@ static bool do_first_group(struct mpl_mediaplayer *pl)
|
|||
pl->group = pl->group->prev;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID after: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return group_changed;
|
||||
}
|
||||
|
@ -1190,9 +1190,9 @@ static bool do_last_group(struct mpl_mediaplayer *pl)
|
|||
{
|
||||
bool group_changed = false;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID before: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (pl->group->next != NULL) {
|
||||
pl->group = pl->group->next;
|
||||
|
@ -1202,9 +1202,9 @@ static bool do_last_group(struct mpl_mediaplayer *pl)
|
|||
pl->group = pl->group->next;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID after: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
return group_changed;
|
||||
}
|
||||
|
@ -1214,9 +1214,9 @@ static bool do_goto_group(struct mpl_mediaplayer *pl, int32_t groupnum)
|
|||
int32_t count = 0;
|
||||
int32_t k;
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID before: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (groupnum > 0) {
|
||||
/* Goto first group */
|
||||
|
@ -1248,9 +1248,9 @@ static bool do_goto_group(struct mpl_mediaplayer *pl, int32_t groupnum)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
BT_DBG_OBJ_ID("Group ID after: ", pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
/* The group has changed if we have moved more in one direction */
|
||||
/* than in the other */
|
||||
|
@ -1263,7 +1263,7 @@ void do_track_change_notifications(struct mpl_mediaplayer *pl)
|
|||
media_proxy_pl_track_title_cb(pl->group->track->title);
|
||||
media_proxy_pl_track_duration_cb(pl->group->track->duration);
|
||||
media_proxy_pl_track_position_cb(pl->track_pos);
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
media_proxy_pl_current_track_id_cb(pl->group->track->id);
|
||||
if (pl->group->track->next) {
|
||||
media_proxy_pl_next_track_id_cb(pl->group->track->next->id);
|
||||
|
@ -1271,14 +1271,14 @@ void do_track_change_notifications(struct mpl_mediaplayer *pl)
|
|||
/* Send a zero value to indicate that there is no next track */
|
||||
media_proxy_pl_next_track_id_cb(MPL_NO_TRACK_ID);
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
}
|
||||
|
||||
void do_group_change_notifications(struct mpl_mediaplayer *pl)
|
||||
{
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
media_proxy_pl_current_group_id_cb(pl->group->id);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
}
|
||||
|
||||
void do_full_prev_group(struct mpl_mediaplayer *pl)
|
||||
|
@ -1401,7 +1401,7 @@ void inactive_state_command_handler(struct mpl_cmd command,
|
|||
struct mpl_cmd_ntf ntf)
|
||||
{
|
||||
BT_DBG("Command opcode: %d", command.opcode);
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
if (command.use_param) {
|
||||
BT_DBG("Command parameter: %d", command.param);
|
||||
}
|
||||
|
@ -1561,7 +1561,7 @@ void playing_state_command_handler(struct mpl_cmd command,
|
|||
struct mpl_cmd_ntf ntf)
|
||||
{
|
||||
BT_DBG("Command opcode: %d", command.opcode);
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
if (command.use_param) {
|
||||
BT_DBG("Command parameter: %d", command.param);
|
||||
}
|
||||
|
@ -1787,7 +1787,7 @@ void paused_state_command_handler(struct mpl_cmd command,
|
|||
struct mpl_cmd_ntf ntf)
|
||||
{
|
||||
BT_DBG("Command opcode: %d", command.opcode);
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
if (command.use_param) {
|
||||
BT_DBG("Command parameter: %d", command.param);
|
||||
}
|
||||
|
@ -2013,7 +2013,7 @@ void seeking_state_command_handler(struct mpl_cmd command,
|
|||
struct mpl_cmd_ntf ntf)
|
||||
{
|
||||
BT_DBG("Command opcode: %d", command.opcode);
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MCS)) {
|
||||
if (IS_ENABLED(CONFIG_BT_DEBUG_MPL)) {
|
||||
if (command.use_param) {
|
||||
BT_DBG("Command parameter: %d", command.param);
|
||||
}
|
||||
|
@ -2283,7 +2283,7 @@ void (*command_handlers[BT_MCS_MEDIA_STATE_LAST])(struct mpl_cmd command,
|
|||
seeking_state_command_handler
|
||||
};
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
/* Find a track by ID
|
||||
*
|
||||
* If found, return pointers to the group of the track and the track,
|
||||
|
@ -2357,19 +2357,19 @@ static bool find_group_by_id(const struct mpl_mediaplayer *pl, uint64_t id,
|
|||
*group = NULL;
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
const char *get_player_name(void)
|
||||
{
|
||||
return pl.name;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
uint64_t get_icon_id(void)
|
||||
{
|
||||
return pl.icon_id;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
const char *get_icon_url(void)
|
||||
{
|
||||
|
@ -2443,7 +2443,7 @@ int8_t get_seeking_speed(void)
|
|||
return pl.seeking_speed_factor;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
uint64_t get_track_segments_id(void)
|
||||
{
|
||||
return pl.group->track->segments_id;
|
||||
|
@ -2555,7 +2555,7 @@ void set_current_group_id(uint64_t id)
|
|||
|
||||
BT_DBG("Group not found");
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
uint8_t get_playing_order(void)
|
||||
{
|
||||
|
@ -2606,7 +2606,7 @@ uint32_t get_commands_supported(void)
|
|||
return pl.opcodes_supported;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
static void parse_search(struct mpl_search search)
|
||||
{
|
||||
uint8_t index = 0;
|
||||
|
@ -2676,7 +2676,7 @@ uint64_t get_search_results_id(void)
|
|||
{
|
||||
return pl.search_results_id;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
uint8_t get_content_ctrl_id(void)
|
||||
{
|
||||
|
@ -2694,11 +2694,11 @@ int media_proxy_pl_init(void)
|
|||
}
|
||||
|
||||
/* Set up the media control service */
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
ret = bt_mcs_init(&ots_cbs);
|
||||
#else
|
||||
ret = bt_mcs_init(NULL);
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
if (ret < 0) {
|
||||
BT_ERR("Could not init MCS: %d", ret);
|
||||
|
@ -2708,7 +2708,7 @@ int media_proxy_pl_init(void)
|
|||
/* Get a Content Control ID */
|
||||
pl.content_ctrl_id = bt_ccid_get_value();
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
/* Initialize the object content buffer */
|
||||
net_buf_simple_init(obj.content, 0);
|
||||
|
||||
|
@ -2734,13 +2734,13 @@ int media_proxy_pl_init(void)
|
|||
BT_ERR("Error adding Track Segments Object to OTS, error %d", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
/* Set up the calls structure */
|
||||
pl.calls.get_player_name = get_player_name;
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
pl.calls.get_icon_id = get_icon_id;
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
pl.calls.get_icon_url = get_icon_url;
|
||||
pl.calls.get_track_title = get_track_title;
|
||||
pl.calls.get_track_duration = get_track_duration;
|
||||
|
@ -2749,7 +2749,7 @@ int media_proxy_pl_init(void)
|
|||
pl.calls.get_playback_speed = get_playback_speed;
|
||||
pl.calls.set_playback_speed = set_playback_speed;
|
||||
pl.calls.get_seeking_speed = get_seeking_speed;
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
pl.calls.get_track_segments_id = get_track_segments_id;
|
||||
pl.calls.get_current_track_id = get_current_track_id;
|
||||
pl.calls.set_current_track_id = set_current_track_id;
|
||||
|
@ -2758,16 +2758,16 @@ int media_proxy_pl_init(void)
|
|||
pl.calls.get_parent_group_id = get_parent_group_id;
|
||||
pl.calls.get_current_group_id = get_current_group_id;
|
||||
pl.calls.set_current_group_id = set_current_group_id;
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
pl.calls.get_playing_order = get_playing_order;
|
||||
pl.calls.set_playing_order = set_playing_order;
|
||||
pl.calls.get_playing_orders_supported = get_playing_orders_supported;
|
||||
pl.calls.get_media_state = get_media_state;
|
||||
pl.calls.send_command = send_command;
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
pl.calls.send_search = send_search;
|
||||
pl.calls.get_search_results_id = get_search_results_id;
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
pl.calls.get_content_ctrl_id = get_content_ctrl_id;
|
||||
|
||||
ret = media_proxy_pl_register(&pl.calls);
|
||||
|
@ -2780,22 +2780,22 @@ int media_proxy_pl_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_DEBUG_MCS /* Special commands for debugging */
|
||||
#if CONFIG_BT_DEBUG_MPL /* Special commands for debugging */
|
||||
|
||||
void mpl_debug_dump_state(void)
|
||||
{
|
||||
#if CONFIG_BT_OTS
|
||||
#if CONFIG_BT_MPL_OBJECTS
|
||||
char t[BT_OTS_OBJ_ID_STR_LEN];
|
||||
struct mpl_group *group;
|
||||
struct mpl_track *track;
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
BT_DBG("Mediaplayer name: %s", log_strdup(pl.name));
|
||||
|
||||
#if CONFIG_BT_OTS
|
||||
#if CONFIG_BT_MPL_OBJECTS
|
||||
(void)bt_ots_obj_id_to_str(pl.icon_id, t, sizeof(t));
|
||||
BT_DBG("Icon ID: %s", log_strdup(t));
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
BT_DBG("Icon URL: %s", log_strdup(pl.icon_url));
|
||||
BT_DBG("Track position: %d", pl.track_pos);
|
||||
|
@ -2807,7 +2807,7 @@ void mpl_debug_dump_state(void)
|
|||
BT_DBG("Opcodes supported: %d", pl.opcodes_supported);
|
||||
BT_DBG("Content control ID: %d", pl.content_ctrl_id);
|
||||
|
||||
#if CONFIG_BT_OTS
|
||||
#if CONFIG_BT_MPL_OBJECTS
|
||||
(void)bt_ots_obj_id_to_str(pl.group->parent->id, t, sizeof(t));
|
||||
BT_DBG("Current group's parent: %s", log_strdup(t));
|
||||
|
||||
|
@ -2865,20 +2865,20 @@ void mpl_debug_dump_state(void)
|
|||
|
||||
group = group->next;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
}
|
||||
#endif /* CONFIG_BT_DEBUG_MCS */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL */
|
||||
|
||||
|
||||
#if defined(CONFIG_BT_DEBUG_MCS) && defined(CONFIG_BT_TESTING) /* Special commands for testing */
|
||||
#if defined(CONFIG_BT_DEBUG_MPL) && defined(CONFIG_BT_TESTING) /* Special commands for testing */
|
||||
|
||||
#if CONFIG_BT_OTS
|
||||
#if CONFIG_BT_MPL_OBJECTS
|
||||
void mpl_test_unset_parent_group(void)
|
||||
{
|
||||
BT_DBG("Setting current group to be it's own parent");
|
||||
pl.group->parent = pl.group;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
void mpl_test_media_state_set(uint8_t state)
|
||||
{
|
||||
|
@ -2916,7 +2916,7 @@ void mpl_test_seeking_speed_changed_cb(void)
|
|||
media_proxy_pl_seeking_speed_cb(pl.seeking_speed_factor);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
void mpl_test_current_track_id_changed_cb(void)
|
||||
{
|
||||
media_proxy_pl_current_track_id_cb(pl.group->track->id);
|
||||
|
@ -2936,7 +2936,7 @@ void mpl_test_current_group_id_changed_cb(void)
|
|||
{
|
||||
media_proxy_pl_current_group_id_cb(pl.group->id);
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
void mpl_test_playing_order_changed_cb(void)
|
||||
{
|
||||
|
@ -2953,11 +2953,11 @@ void mpl_test_opcodes_supported_changed_cb(void)
|
|||
media_proxy_pl_commands_supported_cb(pl.opcodes_supported);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
void mpl_test_search_results_changed_cb(void)
|
||||
{
|
||||
media_proxy_pl_search_cb(pl.search_results_id);
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
#endif /* CONFIG_BT_DEBUG_MCS && CONFIG_BT_TESTING */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL && CONFIG_BT_TESTING */
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
/* Track segments */
|
||||
struct mpl_tseg {
|
||||
uint8_t name_len;
|
||||
char name[CONFIG_BT_MCS_SEGMENT_NAME_MAX];
|
||||
char name[CONFIG_BT_MPL_SEGMENT_NAME_MAX];
|
||||
int32_t pos;
|
||||
struct mpl_tseg *prev;
|
||||
struct mpl_tseg *next;
|
||||
|
@ -39,25 +39,25 @@ struct mpl_tseg {
|
|||
|
||||
/* Tracks */
|
||||
struct mpl_track {
|
||||
#if defined(CONFIG_BT_OTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
#if defined(CONFIG_BT_MPL_OBJECTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
uint64_t id;
|
||||
#endif /* CONFIG_BT_OTS || CONFIG_BT_OTS_CLIENT */
|
||||
char title[CONFIG_BT_MCS_TRACK_TITLE_MAX];
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS || CONFIG_BT_OTS_CLIENT */
|
||||
char title[CONFIG_BT_MPL_TRACK_TITLE_MAX];
|
||||
int32_t duration;
|
||||
struct mpl_tseg *segment;
|
||||
#if defined(CONFIG_BT_OTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
#if defined(CONFIG_BT_MPL_OBJECTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
uint64_t segments_id;
|
||||
#endif /* CONFIG_BT_OTS || CONFIG_BT_OTS_CLIENT */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS || CONFIG_BT_OTS_CLIENT */
|
||||
struct mpl_track *prev;
|
||||
struct mpl_track *next;
|
||||
};
|
||||
|
||||
/* Groups */
|
||||
struct mpl_group {
|
||||
#if defined(CONFIG_BT_OTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
#if defined(CONFIG_BT_MPL_OBJECTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
uint64_t id;
|
||||
#endif /* CONFIG_BT_OTS || CONFIG_BT_OTS_CLIENT */
|
||||
char title[CONFIG_BT_MCS_GROUP_TITLE_MAX];
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS || CONFIG_BT_OTS_CLIENT */
|
||||
char title[CONFIG_BT_MPL_GROUP_TITLE_MAX];
|
||||
struct mpl_track *track;
|
||||
struct mpl_group *parent;
|
||||
struct mpl_group *prev;
|
||||
|
@ -66,11 +66,11 @@ struct mpl_group {
|
|||
|
||||
/** @brief Media Player */
|
||||
struct mpl_mediaplayer {
|
||||
char name[CONFIG_BT_MCS_MEDIA_PLAYER_NAME_MAX];
|
||||
#if defined(CONFIG_BT_OTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
char name[CONFIG_BT_MPL_MEDIA_PLAYER_NAME_MAX];
|
||||
#if defined(CONFIG_BT_MPL_OBJECTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
uint64_t icon_id;
|
||||
#endif /* CONFIG_BT_OTS || CONFIG_BT_OTS_CLIENT */
|
||||
char icon_url[CONFIG_BT_MCS_ICON_URL_MAX];
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS || CONFIG_BT_OTS_CLIENT */
|
||||
char icon_url[CONFIG_BT_MPL_ICON_URL_MAX];
|
||||
struct mpl_group *group;
|
||||
int32_t track_pos;
|
||||
uint8_t state;
|
||||
|
@ -79,9 +79,9 @@ struct mpl_mediaplayer {
|
|||
uint8_t playing_order;
|
||||
uint16_t playing_orders_supported;
|
||||
uint32_t opcodes_supported;
|
||||
#if defined(CONFIG_BT_OTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
#if defined(CONFIG_BT_MPL_OBJECTS) || defined(CONFIG_BT_OTS_CLIENT)
|
||||
uint64_t search_results_id;
|
||||
#endif /* CONFIG_BT_OTS || CONFIG_BT_OTS_CLIENT */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS || CONFIG_BT_OTS_CLIENT */
|
||||
uint8_t content_ctrl_id;
|
||||
struct media_proxy_pl_calls calls;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ zephyr_library_sources_ifdef(
|
|||
csis_client.c
|
||||
)
|
||||
zephyr_library_sources_ifdef(
|
||||
CONFIG_BT_MCS
|
||||
CONFIG_BT_MPL
|
||||
mpl.c
|
||||
)
|
||||
zephyr_library_sources_ifdef(
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include <bluetooth/audio/media_proxy.h>
|
||||
#include "../audio/mpl_internal.h"
|
||||
|
||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_MCS)
|
||||
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_MPL)
|
||||
#define LOG_MODULE_NAME bt_mpl_shell
|
||||
#include "common/log.h"
|
||||
|
||||
#if defined(CONFIG_BT_MCS)
|
||||
#if defined(CONFIG_BT_MPL)
|
||||
|
||||
#if defined(CONFIG_BT_DEBUG_MCS) && defined(CONFIG_BT_TESTING)
|
||||
#if defined(CONFIG_BT_DEBUG_MPL) && defined(CONFIG_BT_TESTING)
|
||||
int cmd_mpl_test_set_media_state(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ int cmd_mpl_test_set_media_state(const struct shell *sh, size_t argc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
int cmd_mpl_test_unset_parent_group(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
{
|
||||
|
@ -44,10 +44,10 @@ int cmd_mpl_test_unset_parent_group(const struct shell *sh, size_t argc,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_DEBUG_MCS && CONFIG_BT_TESTING */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL && CONFIG_BT_TESTING */
|
||||
|
||||
#if defined(CONFIG_BT_DEBUG_MCS)
|
||||
#if defined(CONFIG_BT_DEBUG_MPL)
|
||||
int cmd_mpl_debug_dump_state(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ int cmd_mpl_debug_dump_state(const struct shell *sh, size_t argc,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BT_DEBUG_MCS */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL */
|
||||
|
||||
int cmd_media_proxy_pl_init(const struct shell *sh, size_t argc, char *argv[])
|
||||
{
|
||||
|
@ -115,7 +115,7 @@ int cmd_mpl_test_seeking_speed_changed_cb(const struct shell *sh, size_t argc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
int cmd_mpl_test_current_track_id_changed_cb(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ int cmd_mpl_test_parent_group_id_changed_cb(const struct shell *sh, size_t argc,
|
|||
mpl_test_parent_group_id_changed_cb();
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
int cmd_mpl_test_playing_order_changed_cb(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
|
@ -166,14 +166,14 @@ int cmd_mpl_test_media_opcodes_supported_changed_cb(const struct shell *sh, size
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
int cmd_mpl_test_search_results_changed_cb(const struct shell *sh, size_t argc,
|
||||
char *argv[])
|
||||
{
|
||||
mpl_test_search_results_changed_cb();
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
|
||||
static int cmd_mpl(const struct shell *sh, size_t argc, char **argv)
|
||||
{
|
||||
|
@ -183,21 +183,21 @@ static int cmd_mpl(const struct shell *sh, size_t argc, char **argv)
|
|||
}
|
||||
|
||||
SHELL_STATIC_SUBCMD_SET_CREATE(mpl_cmds,
|
||||
#if defined(CONFIG_BT_DEBUG_MCS) && defined(CONFIG_BT_TESTING)
|
||||
#if defined(CONFIG_BT_DEBUG_MPL) && defined(CONFIG_BT_TESTING)
|
||||
SHELL_CMD_ARG(test_set_media_state, NULL,
|
||||
"Set the media player state (test) <state>",
|
||||
cmd_mpl_test_set_media_state, 2, 0),
|
||||
#if CONFIG_BT_OTS
|
||||
#if CONFIG_BT_MPL_OBJECTS
|
||||
SHELL_CMD_ARG(test_unset_parent_group, NULL,
|
||||
"Set current group to be its own parent (test)",
|
||||
cmd_mpl_test_unset_parent_group, 1, 0),
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_DEBUG_MCS && CONFIG_BT_TESTING */
|
||||
#if defined(CONFIG_BT_DEBUG_MCS)
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL && CONFIG_BT_TESTING */
|
||||
#if defined(CONFIG_BT_DEBUG_MPL)
|
||||
SHELL_CMD_ARG(debug_dump_state, NULL,
|
||||
"Dump media player's state as debug output (debug)",
|
||||
cmd_mpl_debug_dump_state, 1, 0),
|
||||
#endif /* CONFIG_BT_DEBUG_MCC */
|
||||
#endif /* CONFIG_BT_DEBUG_MPL */
|
||||
SHELL_CMD_ARG(init, NULL,
|
||||
"Initialize media player",
|
||||
cmd_media_proxy_pl_init, 1, 0),
|
||||
|
@ -219,7 +219,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(mpl_cmds,
|
|||
SHELL_CMD_ARG(seeking_speed_changed_cb, NULL,
|
||||
"Trigger Seeking Speed callback (test)",
|
||||
cmd_mpl_test_seeking_speed_changed_cb, 1, 0),
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
SHELL_CMD_ARG(current_track_id_changed_cb, NULL,
|
||||
"Trigger Current Track callback (test)",
|
||||
cmd_mpl_test_current_track_id_changed_cb, 1, 0),
|
||||
|
@ -232,7 +232,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(mpl_cmds,
|
|||
SHELL_CMD_ARG(parent_group_id_changed_cb, NULL,
|
||||
"Trigger Parent Group callback (test)",
|
||||
cmd_mpl_test_parent_group_id_changed_cb, 1, 0),
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
SHELL_CMD_ARG(playing_order_changed_cb, NULL,
|
||||
"Trigger Playing Order callback (test)",
|
||||
cmd_mpl_test_playing_order_changed_cb, 1, 0),
|
||||
|
@ -242,11 +242,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(mpl_cmds,
|
|||
SHELL_CMD_ARG(media_opcodes_changed_cb, NULL,
|
||||
"Trigger Opcodes Supported callback (test)",
|
||||
cmd_mpl_test_media_opcodes_supported_changed_cb, 1, 0),
|
||||
#ifdef CONFIG_BT_OTS
|
||||
#ifdef CONFIG_BT_MPL_OBJECTS
|
||||
SHELL_CMD_ARG(search_results_changed_cb, NULL,
|
||||
"Trigger Search Results Object ID callback (test)",
|
||||
cmd_mpl_test_search_results_changed_cb, 1, 0),
|
||||
#endif /* CONFIG_BT_OTS */
|
||||
#endif /* CONFIG_BT_MPL_OBJECTS */
|
||||
SHELL_SUBCMD_SET_END
|
||||
);
|
||||
|
||||
|
@ -257,7 +257,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(mpl_cmds,
|
|||
* and https://github.com/nexB/scancode-toolkit/commit/6abbc4a22973f40ab74f6f8d948dd06416c97bd4
|
||||
*/
|
||||
#define CMD_NQM cmd_mpl
|
||||
SHELL_CMD_ARG_REGISTER(mpl, &mpl_cmds, "Media player (MCS) related commands",
|
||||
SHELL_CMD_ARG_REGISTER(mpl, &mpl_cmds, "Media player (MPL) related commands",
|
||||
CMD_NQM, 1, 1);
|
||||
|
||||
#endif /* CONFIG_BT_MCS */
|
||||
#endif /* CONFIG_BT_MPL */
|
||||
|
|
|
@ -55,6 +55,13 @@ CONFIG_BT_CSIS_TEST_SAMPLE_DATA=y
|
|||
CONFIG_BT_CSIS_CLIENT=y
|
||||
CONFIG_BT_CSIS_CLIENT_TEST_SAMPLE_DATA=y
|
||||
|
||||
# Media player
|
||||
CONFIG_BT_MPL=y
|
||||
CONFIG_BT_MPL_OBJECTS=y
|
||||
CONFIG_BT_MPL_TRACK_TITLE_MAX=40
|
||||
CONFIG_BT_MPL_ICON_URL_MAX=40
|
||||
CONFIG_BT_MPL_MAX_OBJ_SIZE=600
|
||||
|
||||
# Media control
|
||||
CONFIG_BT_MCS=y
|
||||
CONFIG_BT_MCC=y
|
||||
|
@ -63,7 +70,6 @@ CONFIG_BT_MCC_SHELL=y
|
|||
CONFIG_BT_MCS_TRACK_TITLE_MAX=40
|
||||
CONFIG_BT_MCS_ICON_URL_MAX=40
|
||||
CONFIG_BT_MCC_TOTAL_OBJ_CONTENT_MEM=4096
|
||||
CONFIG_BT_MCS_MAX_OBJ_SIZE=600
|
||||
|
||||
# Object Transfer
|
||||
CONFIG_BT_OTS=y
|
||||
|
@ -85,6 +91,7 @@ CONFIG_BT_DEBUG_VOCS=y
|
|||
CONFIG_BT_DEBUG_VOCS_CLIENT=y
|
||||
CONFIG_BT_DEBUG_MICS=y
|
||||
CONFIG_BT_DEBUG_MICS_CLIENT=y
|
||||
CONFIG_BT_DEBUG_MPL=y
|
||||
CONFIG_BT_DEBUG_MCS=y
|
||||
CONFIG_BT_DEBUG_MCC=y
|
||||
CONFIG_BT_OTS_LOG_LEVEL_DBG=y
|
||||
|
|
|
@ -64,24 +64,28 @@ CONFIG_BT_CSIS=y
|
|||
CONFIG_BT_CSIS_CLIENT=y
|
||||
CONFIG_BT_CSIS_CLIENT_MAX_CSIS_INSTANCES=2
|
||||
|
||||
CONFIG_BT_MPL=y
|
||||
CONFIG_BT_MPL_MEDIA_PLAYER_NAME_MAX=30
|
||||
CONFIG_BT_MPL_MEDIA_PLAYER_NAME="My media player"
|
||||
CONFIG_BT_MPL_ICON_URL_MAX=27
|
||||
CONFIG_BT_MPL_ICON_URL="http://www.somecompany.com"
|
||||
CONFIG_BT_MPL_TRACK_TITLE_MAX=40
|
||||
CONFIG_BT_MPL_SEGMENT_NAME_MAX=35
|
||||
CONFIG_BT_MPL_OBJECTS=y
|
||||
# TODO Check which value is sensible in the line below
|
||||
# Must be larger than any of the object sizes - icon, track, group, segments, ...
|
||||
CONFIG_BT_MPL_MAX_OBJ_SIZE=600
|
||||
CONFIG_BT_MPL_ICON_BITMAP_SIZE=321
|
||||
CONFIG_BT_MPL_TRACK_MAX_SIZE=50
|
||||
|
||||
CONFIG_BT_MCS=y
|
||||
CONFIG_BT_MCS_MEDIA_PLAYER_NAME_MAX=30
|
||||
CONFIG_BT_MCS_MEDIA_PLAYER_NAME="My media player"
|
||||
CONFIG_BT_MCS_ICON_URL_MAX=27
|
||||
CONFIG_BT_MCS_ICON_URL="http://www.somecompany.com"
|
||||
CONFIG_BT_MCS_TRACK_TITLE_MAX=40
|
||||
CONFIG_BT_MCS_GROUP_TITLE_MAX=40
|
||||
CONFIG_BT_MCS_SEGMENT_NAME_MAX=35
|
||||
CONFIG_BT_MCS_ICON_BITMAP_SIZE=321
|
||||
CONFIG_BT_MCC=y
|
||||
CONFIG_BT_MCC_OTS=y
|
||||
CONFIG_BT_MCC_TOTAL_OBJ_CONTENT_MEM=4096
|
||||
# TODO Check which value is sensible in the line below
|
||||
# Must be larger than any of the object sizes - icon, track, group, segments, ...
|
||||
CONFIG_BT_MCS_MAX_OBJ_SIZE=600
|
||||
CONFIG_BT_MCS_TRACK_MAX_SIZE=50
|
||||
CONFIG_BT_MCS_TRACK_SEG_MAX_SIZE=500
|
||||
CONFIG_BT_MCS_GROUP_MAX_SIZE=552
|
||||
|
||||
# Object Transfer
|
||||
CONFIG_BT_OTS=y
|
||||
|
@ -98,6 +102,7 @@ CONFIG_BT_HAS_HEARING_AID_MONAURAL=y
|
|||
|
||||
# DEBUGGING
|
||||
CONFIG_BT_DEBUG_LOG=y
|
||||
CONFIG_BT_DEBUG_MPL=y
|
||||
CONFIG_BT_DEBUG_MCS=y
|
||||
CONFIG_BT_DEBUG_MCC=y
|
||||
CONFIG_BT_OTS_LOG_LEVEL_DBG=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue