# DBG_TASK
[DEBUG]

Debug Task management module. More...

Collaboration diagram for DBG_TASK:

## Data Structures
struct | dbg_mem_read_req
| Structure containing the parameters of the DBG_MEM_READ_REQ message. More...
struct | dbg_mem_read_cfm
| Structure containing the parameters of the DBG_MEM_READ_CFM message. More...
struct | dbg_mem_write_req
| Structure containing the parameters of the DBG_MEM_WRITE_REQ message. More...
struct | dbg_mem_write_cfm
| Structure containing the parameters of the DBG_MEM_WRITE_CFM message. More...
struct | dbg_set_mod_filter_req
| Structure containing the parameters of the DBG_SET_MOD_FILTER_REQ message. More...
struct | dbg_set_sev_filter_req
| Structure containing the parameters of the DBG_SET_MOD_FILTER_REQ message. More...
struct | dbg_get_sys_stat_cfm
| Structure containing the parameters of the DBG_GET_SYS_STAT_CFM message. More...
## Enumerations
enum | dbg_msg_tag { DBG_MEM_READ_REQ = KE_FIRST_MSG(TASK_DBG), DBG_MEM_READ_CFM, DBG_MEM_WRITE_REQ, DBG_MEM_WRITE_CFM, DBG_SET_MOD_FILTER_REQ, DBG_SET_MOD_FILTER_CFM, DBG_SET_SEV_FILTER_REQ, DBG_SET_SEV_FILTER_CFM, DBG_ERROR_IND, DBG_GET_SYS_STAT_REQ, DBG_GET_SYS_STAT_CFM, DBG_SYS_STAT_TIMER }
| Messages related to Debug Task. More...
## Functions
static int | dbg_mem_read_req_handler (ke_msg_id_t const msgid, struct dbg_mem_read_req const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
| This function handles the DBG_MEM_READ_REQ message.
static int | dbg_mem_write_req_handler (ke_msg_id_t const msgid, struct dbg_mem_write_req const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
| This function handles the DBG_MEM_WRITE_REQ message.
static int | dbg_set_mod_filter_req_handler (ke_msg_id_t const msgid, struct dbg_set_mod_filter_req const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
| This function handles the DBG_SET_MOD_FILTER_REQ message.
static int | dbg_set_sev_filter_req_handler (ke_msg_id_t const msgid, struct dbg_set_sev_filter_req const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
| This function handles the DBG_SET_SEV_FILTER_REQ message.
static int | dbg_get_sys_stat_req_handler (ke_msg_id_t const msgid, void const *param, ke_task_id_t const dest_id, ke_task_id_t const src_id)
| This function handles the DBG_GET_SYS_STAT_REQ message.
## Variables
struct ke_msg_handler | dbg_default_state []
| DEFAULT handler.
struct ke_state_handler | dbg_default_handler
| Specifies the message handlers that are common to all states.
struct ke_state_handler | dbg_default_handler
| Specifies the message handlers that are common to all states.

## Detailed Description

Debug Task management module.

## Enumeration Type Documentation

enum dbg_msg_tag

Messages related to Debug Task.

Enumerator:

  DBG_MEM_READ_REQ | Memory read request.
  DBG_MEM_READ_CFM | Memory read confirm.
  DBG_MEM_WRITE_REQ | Memory write request.
  DBG_MEM_WRITE_CFM | Memory write confirm.
  DBG_SET_MOD_FILTER_REQ | Module filter request.
  DBG_SET_MOD_FILTER_CFM | Module filter confirm.
  DBG_SET_SEV_FILTER_REQ | Severity filter request.
  DBG_SET_SEV_FILTER_CFM | Severity filter confirm.
  DBG_ERROR_IND | Fatal error indication.
  DBG_GET_SYS_STAT_REQ | Request to get system statistics.
  DBG_GET_SYS_STAT_CFM | COnfirmation of system statistics.
  DBG_SYS_STAT_TIMER | Timer allowing resetting the system statistics periodically to avoid wrap around of timer.

Definition at line 44 of file dbg_task.h.

## Function Documentation

static int dbg_get_sys_stat_req_handler | ( | ke_msg_id_t const | msgid,
|  | void const * | param,
|  | ke_task_id_t const | dest_id,
|  | ke_task_id_t const | src_id |
| ) |  |  | `[static]`

This function handles the DBG_GET_SYS_STAT_REQ message.

Parameters:

  `[in]` | msgid | Id of the message received
  `[in]` | param | Pointer to the parameters of the message
  `[in]` | dest_id | TaskId of the receiving task
  `[in]` | src_id | TaskId of the sending task

Returns:
  Whether the message was consumed or not

Definition at line 185 of file dbg_task.c.

References dbg_get_sys_stat_cfm::cpu_sleep_time, dbg_env, DBG_GET_SYS_STAT_CFM, dbg_get_sys_stat_cfm::doze_time, KE_MSG_ALLOC, KE_MSG_CONSUMED, ke_msg_send(), and dbg_get_sys_stat_cfm::stats_time.

static int dbg_mem_read_req_handler | ( | ke_msg_id_t const | msgid,
|  | struct dbg_mem_read_req const * | param,
|  | ke_task_id_t const | dest_id,
|  | ke_task_id_t const | src_id |
| ) |  |  | `[static]`

This function handles the DBG_MEM_READ_REQ message.

Parameters:

  `[in]` | msgid | Id of the message received
  `[in]` | param | Pointer to the parameters of the message
  `[in]` | dest_id | TaskId of the receiving task
  `[in]` | src_id | TaskId of the sending task

Returns:
  Whether the message was consumed or not

Read from the corresponding memory location

Definition at line 53 of file dbg_task.c.

References D_DBG, D_INF, dbg, DBG_MEM_READ_CFM, KE_MSG_ALLOC, KE_MSG_CONSUMED, ke_msg_send(), dbg_mem_read_cfm::memaddr, dbg_mem_read_req::memaddr, and dbg_mem_read_cfm::memdata.

static int dbg_mem_write_req_handler | ( | ke_msg_id_t const | msgid,
|  | struct dbg_mem_write_req const * | param,
|  | ke_task_id_t const | dest_id,
|  | ke_task_id_t const | src_id |
| ) |  |  | `[static]`

This function handles the DBG_MEM_WRITE_REQ message.

Parameters:

  `[in]` | msgid | Id of the message received
  `[in]` | param | Pointer to the parameters of the message
  `[in]` | dest_id | TaskId of the receiving task
  `[in]` | src_id | TaskId of the sending task

Returns:
  Whether the message was consumed or not

Definition at line 88 of file dbg_task.c.

References D_DBG, D_INF, dbg, DBG_MEM_WRITE_CFM, KE_MSG_ALLOC, KE_MSG_CONSUMED, ke_msg_send(), dbg_mem_write_cfm::memaddr, dbg_mem_write_req::memaddr, dbg_mem_write_cfm::memdata, and dbg_mem_write_req::memdata.

static int dbg_set_mod_filter_req_handler | ( | ke_msg_id_t const | msgid,
|  | struct dbg_set_mod_filter_req const * | param,
|  | ke_task_id_t const | dest_id,
|  | ke_task_id_t const | src_id |
| ) |  |  | `[static]`

This function handles the DBG_SET_MOD_FILTER_REQ message.

Parameters:

  `[in]` | msgid | Id of the message received
  `[in]` | param | Pointer to the parameters of the message
  `[in]` | dest_id | TaskId of the receiving task
  `[in]` | src_id | TaskId of the sending task

Returns:
  Whether the message was consumed or not

Set the module filter according to the parameters

Definition at line 125 of file dbg_task.c.

References D_DBG, D_INF, dbg, dbg_env, DBG_SET_MOD_FILTER_CFM, debug_env_tag::filter_module, KE_MSG_CONSUMED, ke_msg_send_basic(), and dbg_set_mod_filter_req::mod_filter.

static int dbg_set_sev_filter_req_handler | ( | ke_msg_id_t const | msgid,
|  | struct dbg_set_sev_filter_req const * | param,
|  | ke_task_id_t const | dest_id,
|  | ke_task_id_t const | src_id |
| ) |  |  | `[static]`

This function handles the DBG_SET_SEV_FILTER_REQ message.

Parameters:

  `[in]` | msgid | Id of the message received
  `[in]` | param | Pointer to the parameters of the message
  `[in]` | dest_id | TaskId of the receiving task
  `[in]` | src_id | TaskId of the sending task

Returns:
  Whether the message was consumed or not

Set the severity filter according to the parameters

Definition at line 155 of file dbg_task.c.

References D_DBG, D_INF, dbg, dbg_env, DBG_SET_SEV_FILTER_CFM, debug_env_tag::filter_severity, KE_MSG_CONSUMED, ke_msg_send_basic(), and dbg_set_sev_filter_req::sev_filter.

## Variable Documentation

struct ke_state_handler dbg_default_handler

Initial value:

        KE_STATE_HANDLER(dbg_default_state)

Specifies the message handlers that are common to all states.

Definition at line 269 of file dbg_task.c.

struct ke_msg_handler dbg_default_state[]

Initial value:

    {

        {DBG_MEM_READ_REQ, (ke_msg_func_t)dbg_mem_read_req_handler},

        {DBG_MEM_WRITE_REQ, (ke_msg_func_t)dbg_mem_write_req_handler},

        {DBG_SET_MOD_FILTER_REQ, (ke_msg_func_t)dbg_set_mod_filter_req_handler},

        {DBG_SET_SEV_FILTER_REQ, (ke_msg_func_t)dbg_set_sev_filter_req_handler},

        {DBG_GET_SYS_STAT_REQ, (ke_msg_func_t)dbg_get_sys_stat_req_handler},

    }

DEFAULT handler.

Definition at line 250 of file dbg_task.c.