Skip to content
Snippets Groups Projects
Commit f1597a27 authored by schneider's avatar schneider
Browse files

feat(ble): Decode some more events

parent 93991bda
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "wsf_msg.h" #include "wsf_msg.h"
#include "wsf_trace.h" #include "wsf_trace.h"
#include "hci_api.h" #include "hci_api.h"
#include "l2c_api.h"
#include "dm_api.h" #include "dm_api.h"
#include "att_api.h" #include "att_api.h"
#include "smp_api.h" #include "smp_api.h"
...@@ -203,6 +204,28 @@ static uint32_t pair_confirm_value; ...@@ -203,6 +204,28 @@ static uint32_t pair_confirm_value;
static void BleHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg); static void BleHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg);
static const char * const att_events[] = {
"ATTC_FIND_INFO_RSP",
"ATTC_FIND_BY_TYPE_VALUE_RSP",
"ATTC_READ_BY_TYPE_RSP",
"ATTC_READ_RSP",
"ATTC_READ_LONG_RSP",
"ATTC_READ_MULTIPLE_RSP",
"ATTC_READ_BY_GROUP_TYPE_RSP",
"ATTC_WRITE_RSP",
"ATTC_WRITE_CMD_RSP",
"ATTC_PREPARE_WRITE_RSP",
"ATTC_EXECUTE_WRITE_RSP",
"ATTC_HANDLE_VALUE_NTF",
"ATTC_HANDLE_VALUE_IND",
/* ATT server callback events */
"ATTS_HANDLE_VALUE_CNF",
"ATTS_CCC_STATE_IND",
"ATTS_DB_HASH_CALC_CMPL_IND",
/* ATT common callback events */
"ATT_MTU_UPDATE_IND"
};
static const char * const dm_events[] = { static const char * const dm_events[] = {
"DM_RESET_CMPL_IND", "DM_RESET_CMPL_IND",
"DM_ADV_START_IND", "DM_ADV_START_IND",
...@@ -276,6 +299,13 @@ static const char * const dm_events[] = { ...@@ -276,6 +299,13 @@ static const char * const dm_events[] = {
"DM_HW_ERROR_IND", "DM_HW_ERROR_IND",
"DM_VENDOR_SPEC_IND" "DM_VENDOR_SPEC_IND"
}; };
static const char * const l2c_coc_events[] = {
"L2C_COC_CONNECT_IND",
"L2C_COC_DISCONNECT_IND",
"L2C_COC_DATA_IND",
"L2C_COC_DATA_CNF"
};
/*************************************************************************************************/ /*************************************************************************************************/
/*! /*!
* \brief Application DM callback. * \brief Application DM callback.
...@@ -748,7 +778,17 @@ static void BleHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg) ...@@ -748,7 +778,17 @@ static void BleHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg)
/* process security-related messages */ /* process security-related messages */
AppSlaveSecProcDmMsg((dmEvt_t *) pMsg); AppSlaveSecProcDmMsg((dmEvt_t *) pMsg);
} else { }
else if (pMsg->event >= ATT_CBACK_START && pMsg->event <= ATT_CBACK_END)
{
LOG_INFO("ble", "Ble got evt %d: %s", pMsg->event, att_events[pMsg->event - ATT_CBACK_START]);
}
else if (pMsg->event >= L2C_COC_CBACK_START && pMsg->event <= L2C_COC_CBACK_CBACK_END)
{
LOG_INFO("ble", "Ble got evt %d: %s", pMsg->event, l2c_coc_events[pMsg->event - L2C_COC_CBACK_START]);
}
else
{
LOG_INFO("ble", "Ble got evt %d", pMsg->event); LOG_INFO("ble", "Ble got evt %d", pMsg->event);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment