Bluetooth: Audio: Fix bad warning when creating MPL OTS objects
The return check for adding MPL objects in OTS with bt_ots_obj_add was incorrect, as only negative values indicate an error, and a positive value returns the ID. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
05f3e87280
commit
8673fab276
1 changed files with 23 additions and 13 deletions
|
@ -474,14 +474,16 @@ static int add_icon_object(struct mpl_mediaplayer *pl)
|
|||
add_param.type.uuid_16.val = BT_UUID_16(icon_type)->val;
|
||||
|
||||
ret = bt_ots_obj_add(bt_mcs_get_ots(), &add_param);
|
||||
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
BT_WARN("Unable to add icon object, error %d", ret);
|
||||
obj.busy = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add a track segments object to the OTS */
|
||||
static int add_current_track_segments_object(struct mpl_mediaplayer *pl)
|
||||
{
|
||||
|
@ -507,13 +509,16 @@ static int add_current_track_segments_object(struct mpl_mediaplayer *pl)
|
|||
add_param.type.uuid_16.val = BT_UUID_16(segs_type)->val;
|
||||
|
||||
ret = bt_ots_obj_add(bt_mcs_get_ots(), &add_param);
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
BT_WARN("Unable to add track segments object: %d", ret);
|
||||
obj.busy = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add a single track to the OTS */
|
||||
static int add_track_object(struct mpl_track *track)
|
||||
{
|
||||
|
@ -546,15 +551,16 @@ static int add_track_object(struct mpl_track *track)
|
|||
add_param.type.uuid_16.val = BT_UUID_16(track_type)->val;
|
||||
|
||||
ret = bt_ots_obj_add(bt_mcs_get_ots(), &add_param);
|
||||
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
BT_WARN("Unable to add track object: %d", ret);
|
||||
obj.busy = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add the parent group to the OTS */
|
||||
static int add_parent_group_object(struct mpl_mediaplayer *pl)
|
||||
{
|
||||
|
@ -580,13 +586,16 @@ static int add_parent_group_object(struct mpl_mediaplayer *pl)
|
|||
add_param.type.uuid_16.val = BT_UUID_16(group_type)->val;
|
||||
|
||||
ret = bt_ots_obj_add(bt_mcs_get_ots(), &add_param);
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
BT_WARN("Unable to add parent group object");
|
||||
obj.busy = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add a single group to the OTS */
|
||||
static int add_group_object(struct mpl_group *group)
|
||||
{
|
||||
|
@ -620,15 +629,16 @@ static int add_group_object(struct mpl_group *group)
|
|||
add_param.type.uuid_16.val = BT_UUID_16(group_type)->val;
|
||||
|
||||
ret = bt_ots_obj_add(bt_mcs_get_ots(), &add_param);
|
||||
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
BT_WARN("Unable to add group object: %d", ret);
|
||||
obj.busy = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add all tracks of a group to the OTS */
|
||||
static int add_group_tracks(struct mpl_group *group)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue