Lines Matching refs:chan
11 int zbus_chan_add_obs(const struct zbus_channel *chan, const struct zbus_observer *obs, in zbus_chan_add_obs() argument
19 _ZBUS_ASSERT(chan != NULL, "chan is required"); in zbus_chan_add_obs()
22 err = k_sem_take(&chan->data->sem, timeout); in zbus_chan_add_obs()
27 for (int16_t i = chan->data->observers_start_idx, limit = chan->data->observers_end_idx; in zbus_chan_add_obs()
34 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
41 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&chan->data->observers, obs_nd, tmp, node) { in zbus_chan_add_obs()
43 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
54 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
61 sys_slist_append(&chan->data->observers, &new_obs_nd->node); in zbus_chan_add_obs()
63 k_sem_give(&chan->data->sem); in zbus_chan_add_obs()
68 int zbus_chan_rm_obs(const struct zbus_channel *chan, const struct zbus_observer *obs, in zbus_chan_rm_obs() argument
76 _ZBUS_ASSERT(chan != NULL, "chan is required"); in zbus_chan_rm_obs()
79 err = k_sem_take(&chan->data->sem, timeout); in zbus_chan_rm_obs()
84 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&chan->data->observers, obs_nd, tmp, node) { in zbus_chan_rm_obs()
86 sys_slist_remove(&chan->data->observers, &prev_obs_nd->node, &obs_nd->node); in zbus_chan_rm_obs()
90 k_sem_give(&chan->data->sem); in zbus_chan_rm_obs()
98 k_sem_give(&chan->data->sem); in zbus_chan_rm_obs()