Bluetooth: Audio: Add value_handle check to MCC subscribe cb
If the subscribed callback is called with value_handle = 0, then it should not be treated as a subscription complete. This will happen when bt_mcc_discover_mcs is called, as reset_mcs_inst unsubscribed to all characteristics before discovering again. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
ca4d8a483b
commit
b7c2629a6f
1 changed files with 5 additions and 0 deletions
|
@ -1334,6 +1334,11 @@ static void subscribe_mcs_char_func(struct bt_conn *conn, uint8_t err,
|
|||
LOG_DBG("Subscribed: value handle: %d, ccc handle: %d",
|
||||
params->value_handle, params->ccc_handle);
|
||||
|
||||
if (params->value_handle == 0) {
|
||||
/* Unsubscribing, ignore */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Subscribe to next characteristic */
|
||||
subscription_done = subscribe_next_mcs_char(mcs_inst, conn);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue