Lines Matching full:link

20  * @brief Log link API
21 * @defgroup log_link Log link API
28 typedef void (*log_link_callback_t)(const struct log_link *link,
31 typedef void (*log_link_dropped_cb_t)(const struct log_link *link,
40 int (*initiate)(const struct log_link *link, struct log_link_config *config);
41 int (*activate)(const struct log_link *link);
42 int (*get_domain_name)(const struct log_link *link, uint32_t domain_id,
44 int (*get_source_name)(const struct log_link *link, uint32_t domain_id,
46 int (*get_levels)(const struct log_link *link, uint32_t domain_id,
49 int (*set_runtime_level)(const struct log_link *link, uint32_t domain_id,
71 /** @brief Create instance of a log link.
73 * Link can have dedicated buffer for messages if @p _buf_len is positive. In
84 * @param _ctx Context (void *) associated with the link.
112 /** @brief Initiate log link.
114 * Function initiates the link. Since initialization procedure may be time
115 * consuming, function returns before link is ready to not block logging
116 * initialization. @ref log_link_activate is called to complete link initialization.
118 * @param link Log link instance.
123 static inline int log_link_initiate(const struct log_link *link, in log_link_initiate() argument
126 __ASSERT_NO_MSG(link); in log_link_initiate()
128 return link->api->initiate(link, config); in log_link_initiate()
131 /** @brief Activate log link.
133 * Function checks if link is initialized and completes initialization process.
134 * When successfully returns, link is ready with domain and sources count fetched
137 * @param link Log link instance.
142 static inline int log_link_activate(const struct log_link *link) in log_link_activate() argument
144 __ASSERT_NO_MSG(link); in log_link_activate()
146 return link->api->activate(link); in log_link_activate()
149 /** @brief Check if link is activated.
151 * @param link Log link instance.
156 static inline int log_link_is_active(const struct log_link *link) in log_link_is_active() argument
158 return link->ctrl_blk->domain_offset > 0 ? 0 : -EINPROGRESS; in log_link_is_active()
161 /** @brief Get number of domains in the link.
163 * @param[in] link Log link instance.
167 static inline uint8_t log_link_domains_count(const struct log_link *link) in log_link_domains_count() argument
169 __ASSERT_NO_MSG(link); in log_link_domains_count()
171 return link->ctrl_blk->domain_cnt; in log_link_domains_count()
176 * @param[in] link Log link instance.
181 static inline uint16_t log_link_sources_count(const struct log_link *link, in log_link_sources_count() argument
184 __ASSERT_NO_MSG(link); in log_link_sources_count()
186 return link->ctrl_blk->source_cnt[domain_id]; in log_link_sources_count()
191 * @param[in] link Log link instance.
201 static inline int log_link_get_domain_name(const struct log_link *link, in log_link_get_domain_name() argument
205 __ASSERT_NO_MSG(link); in log_link_get_domain_name()
207 return link->api->get_domain_name(link, domain_id, buf, length); in log_link_get_domain_name()
212 * @param[in] link Log link instance.
222 static inline int log_link_get_source_name(const struct log_link *link, in log_link_get_source_name() argument
226 __ASSERT_NO_MSG(link); in log_link_get_source_name()
229 return link->api->get_source_name(link, domain_id, source_id, in log_link_get_source_name()
235 * @param[in] link Log link instance.
243 static inline int log_link_get_levels(const struct log_link *link, in log_link_get_levels() argument
247 __ASSERT_NO_MSG(link); in log_link_get_levels()
249 return link->api->get_levels(link, domain_id, source_id, in log_link_get_levels()
255 * @param[in] link Log link instance.
262 static inline int log_link_set_runtime_level(const struct log_link *link, in log_link_set_runtime_level() argument
266 __ASSERT_NO_MSG(link); in log_link_set_runtime_level()
269 return link->api->set_runtime_level(link, domain_id, source_id, level); in log_link_set_runtime_level()
278 * @param link Log link instance.
282 void z_log_msg_enqueue(const struct log_link *link, const void *data, size_t len);