Commit ceee8856 authored by Federico Vaga's avatar Federico Vaga

wrtd:lib: add function to get log-level

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>


NOTE
This commit has been created by `git subtree` on the Mock Turtle repository
on tag mock-turtle-2.0

This commit will not compile
parent 6fd2cefa
...@@ -292,6 +292,28 @@ int wrtd_out_log_level_set(struct wrtd_node *dev, unsigned int output, ...@@ -292,6 +292,28 @@ int wrtd_out_log_level_set(struct wrtd_node *dev, unsigned int output,
} }
/**
* It gets the logging level for an output channel
* @param[in] dev device token
* @param[in] output index (0-based) of output channel
* @param[out] log_level current log level used by the Real-Time application
* @return 0 on success, -1 on error and errno is set appropriately
*/
int wrtd_out_log_level_get(struct wrtd_node *dev, unsigned int input,
uint32_t *log_level)
{
struct wrtd_output_state state;
int err;
err = wrtd_out_state_get(dev, input, &state);
if (err)
return err;
*log_level = state.log_level;
return 0;
}
/** /**
* It opens the logging interface for device a given divice. The default * It opens the logging interface for device a given divice. The default
* logging level will be applied to all device channels. You can change it * logging level will be applied to all device channels. You can change it
...@@ -322,3 +344,25 @@ int wrtd_in_log_level_set(struct wrtd_node *dev, unsigned int input, ...@@ -322,3 +344,25 @@ int wrtd_in_log_level_set(struct wrtd_node *dev, unsigned int input,
{ {
return wrtd_log_level_set(dev, input, log_level, WRTD_CORE_IN); return wrtd_log_level_set(dev, input, log_level, WRTD_CORE_IN);
} }
/**
* It gets the logging level for an input channel
* @param[in] dev device token
* @param[in] input index (0-based) of input channel
* @param[out] log_level current log level used by the Real-Time application
* @return 0 on success, -1 on error and errno is set appropriately
*/
int wrtd_in_log_level_get(struct wrtd_node *dev, unsigned int input,
uint32_t *log_level)
{
struct wrtd_input_state state;
int err;
err = wrtd_in_state_get(dev, input, &state);
if (err)
return err;
*log_level = state.log_level;
return 0;
}
...@@ -199,8 +199,12 @@ extern struct wrnc_hmq *wrtd_in_log_open(struct wrtd_node *dev, ...@@ -199,8 +199,12 @@ extern struct wrnc_hmq *wrtd_in_log_open(struct wrtd_node *dev,
int input); int input);
extern int wrtd_in_log_level_set(struct wrtd_node *dev, unsigned int input, extern int wrtd_in_log_level_set(struct wrtd_node *dev, unsigned int input,
uint32_t log_level); uint32_t log_level);
extern int wrtd_in_log_level_get(struct wrtd_node *dev, unsigned int input,
uint32_t *log_level);
extern int wrtd_out_log_level_set(struct wrtd_node *dev, unsigned int output, extern int wrtd_out_log_level_set(struct wrtd_node *dev, unsigned int output,
uint32_t log_level); uint32_t log_level);
extern int wrtd_out_log_level_get(struct wrtd_node *dev, unsigned int input,
uint32_t *log_level);
extern struct wrnc_hmq *wrtd_out_log_open(struct wrtd_node *dev, extern struct wrnc_hmq *wrtd_out_log_open(struct wrtd_node *dev,
uint32_t lvl, uint32_t lvl,
int output); int output);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment