fix(ble_audio): Miscellaneous fixes for ISO & LE Audio (stage 1)

This commit is contained in:
Liu Linyan
2026-05-12 16:38:57 +08:00
parent 036fcf8e37
commit d3da42e608
14 changed files with 328 additions and 71 deletions
@@ -1216,6 +1216,8 @@ struct bt_gatt_notify_params {
uint16_t len;
/** Notification Value callback */
bt_gatt_complete_func_t func;
/** Data passed to @ref func when the notification completes. */
void *user_data;
/** Att channel options. */
enum bt_att_chan_opt chan_opt;
};
@@ -67,12 +67,23 @@ static inline int k_mutex_lock(struct k_mutex *mutex, uint32_t timeout)
assert(mutex);
assert(mutex->handle);
if (xSemaphoreTakeRecursive(mutex->handle, timeout) != pdTRUE) {
K_MUTEX_LOG_ERR("LockFail");
return -EIO;
if (xSemaphoreTakeRecursive(mutex->handle, timeout) == pdTRUE) {
return 0;
}
return 0;
#if !CONFIG_BT_ISO_NO_LOG && (CONFIG_BT_ISO_LOG_LEVEL >= BT_ISO_LOG_ERROR)
/* On timeout, dump who timed out and who is currently holding the
* mutex so the caller's log makes wedge diagnosis a one-look job
* instead of a multi-task scavenger hunt.
*/
TaskHandle_t holder = xSemaphoreGetMutexHolder(mutex->handle);
K_MUTEX_LOG_ERR("LockFail[self=%s][holder=%s]",
pcTaskGetName(NULL),
holder ? pcTaskGetName(holder) : "<none>");
#else
K_MUTEX_LOG_ERR("LockFail");
#endif
return -EIO;
}
static inline int k_mutex_unlock(struct k_mutex *mutex)