Bluetooth: Audio: Fix broadcast assistant recv state pointer value
When reporting a receive state to the upper layers, the broadcast assistant should report NULL if there is not a receive state active. The "activeness" of a receive state is determined by the length of the characteristic - If it is 0 then there is no receive state active. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
bcf32d74f8
commit
f3b0a8f478
1 changed files with 9 additions and 3 deletions
|
@ -286,9 +286,15 @@ static uint8_t read_recv_state_cb(struct bt_conn *conn, uint8_t err,
|
||||||
} else {
|
} else {
|
||||||
if (broadcast_assistant_cbs != NULL &&
|
if (broadcast_assistant_cbs != NULL &&
|
||||||
broadcast_assistant_cbs->recv_state != NULL) {
|
broadcast_assistant_cbs->recv_state != NULL) {
|
||||||
broadcast_assistant_cbs->recv_state(conn,
|
if (active_recv_state) {
|
||||||
cb_err,
|
broadcast_assistant_cbs->recv_state(conn,
|
||||||
&recv_state);
|
cb_err,
|
||||||
|
&recv_state);
|
||||||
|
} else {
|
||||||
|
broadcast_assistant_cbs->recv_state(conn,
|
||||||
|
cb_err,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue